On Sat, 17 Feb 2018 18:21:26 +0100
Manfred Lotz wrote:
> Thanks. The attached program does better as https://notabug.org
> works. Only http://scripts.sil.org doesn't work. It seems there are
> special checks active on that site.
Yeah, some sites block user-agents recognised as robots, scripts
On Thu, 15 Feb 2018 05:46:33 -0600
Mike Flannigan wrote:
> See if some version of the attached program
> gives the results you expect.
>
>
> Mike
>
>
Thanks. The attached program does better as https://notabug.org works.
Only http://scripts.sil.org doesn't work.
See if some version of the attached program
gives the results you expect.
Mike
On 2/13/2018 8:33 PM, beginners-digest-h...@perl.org wrote:
I tried WWW::Mechanize, and (of course) got also 403.
Really strange.
Is there another tool I could use for checking? I mean some tool in the
Perl
;
>
>
> > On Tue, Feb 13, 2018 at 11:33 AM, Manfred Lotz
> > wrote:
> >
> > > On Tue, 13 Feb 2018 10:47:42 -0600
> > > Andy Bach wrote:
> > >
> > > > The site doesn't like 'head' requests? get works
> > > &g
On Tue, 13 Feb 2018 10:47:42 -0600
> > Andy Bach wrote:
> >
> > > The site doesn't like 'head' requests? get works
> > > #!/usr/bin/perl
> > >
> > > use strict;
> > > use warnings;
> > >
> > > use LWP::Simple
t;https://shlomif.github.io/";;
> > my $url="http://www.notabug.org/";;
> > print "$url is ", (
> > (! get($url)) ? "DOWN"
> > : "up"
> > ), "\n";
> >
> >
my $url="http://www.notabug.org/";;
> print "$url is ", (
> (! get($url)) ? "DOWN"
> : "up"
> ), "\n";
>
> $ is_it_up.pl
> http://www.notabug.org/ is up
>
You are right.
ot;DOWN"
: "up"
), "\n";
$ is_it_up.pl
http://www.notabug.org/ is up
On Tue, Feb 13, 2018 at 5:25 AM, Manfred Lotz wrote:
> Hi there,
> Somewhere I found an example how to check if a website is up.
>
> Her
Hi Manfred!
On Tue, 13 Feb 2018 12:25:31 +0100
Manfred Lotz wrote:
> Hi there,
> Somewhere I found an example how to check if a website is up.
>
> Here my sample:
>
> #! /usr/bin/perl
>
> use strict;
>
> use LWP::Simple;
> my $url="https://notabug.
Hi there,
Somewhere I found an example how to check if a website is up.
Here my sample:
#! /usr/bin/perl
use strict;
use LWP::Simple;
my $url="https://notabug.org";;
if (! head($url)) {
die "$url is DOWN"
}
Running above code I get
https://notabug.org is DOWN!!
> On Mar 28, 2017, at 1:58 PM, Uri Guttman wrote:
>
> the only difference i see is using defined in the 2nd line.
Thanks, Uri. Yeah, I got overly aggressive there.
> also i would test $field ne 'categories' first as if that is true why even
> test $out-
Hi!
First of all, using unless with complex logic inside the condition,
especially using negatives (unless not...) is much harder to read and
understand than using if.
See http://stackoverflow.com/a/3048787 and of course see original adwise
from Conway's perl best practices
On 03/28/2017 04:46 PM, SSC_perl wrote:
I could use another set of eyes on this. Could someone please double
check these two sets of conditions and let me know if the first is equivalent
to the second? I believe they are, but I don’t want to take any chances.
# Both of these should
I could use another set of eyes on this. Could someone please double
check these two sets of conditions and let me know if the first is equivalent
to the second? I believe they are, but I don’t want to take any chances.
# Both of these should be equivalent.
$out->{$field} =~ s/``
On Fri, Aug 19, 2016 at 2:22 PM Chas. Owens wrote:
> Truth. If you are checking in lots of things exist a hashset might be a
> better way to go:
>
> my %hashset = map { ($_ => undef) } (3,1,4,2,9,0);
>
> my $found = exists $hashset{4} || 0;
> my $not_found = exists $
Truth. If you are checking in lots of things exist a hashset might be a
better way to go:
my %hashset = map { ($_ => undef) } (3,1,4,2,9,0);
my $found = exists $hashset{4} || 0;
my $not_found = exists $hashset{10} || 0;
By setting the value of the hash to be undef, you take up less space t
But does it need to be an array. Rethink into hash and life could be a little
bit easier...
Wags ;)
WagsWorld
Hebrews 4:15
Ph: 408-914-1341
On Aug 18, 2016, 19:41 -0700, kp...@freenet.de, wrote:
> Thanks for all the replies.
> Yes I found List::Util is a useful toolset.
>
>
> On 2016/8/19 10:00,
Thanks for all the replies.
Yes I found List::Util is a useful toolset.
On 2016/8/19 10:00, Chas. Owens wrote:
The any function from List::Util will also do what you want.
perldoc List::Util
http://perldoc.perl.org/List/Util.html#any
my $found = any { $_ == 4 } (3, 1, 4, 2, 9, 0); # true
my
On Thu, Aug 18, 2016 at 9:39 PM wrote:
> Hello,
>
> What's the better way to decide if an element exists in an array?
> Something like what ruby does,
>
> irb(main):001:0> x=[3,1,4,2,9,0]
> => [3, 1, 4, 2, 9, 0]
> irb(main):002:0> x.include? 4
>
llo,
>
> What's the better way to decide if an element exists in an array?
> Something like what ruby does,
>
> irb(main):001:0> x=[3,1,4,2,9,0]
> => [3, 1, 4, 2, 9, 0]
> irb(main):002:0> x.include? 4
> => true
> irb(main):003:0> x.include? 10
> => fa
On 19 August 2016 at 13:45, Kent Fredric wrote:
> if ( first { $item == 4 } @items ) {
>say "Yes";
>}
>
Ugh, my bad.
if ( first { $_ == 4 } @items ) {
say "Yes";
}
--
Kent
KENTNL - https://metacpan.org/author/KENTNL
--
T
On 19 August 2016 at 13:35, wrote:
>
> What's the better way to decide if an element exists in an array?
> Something like what ruby does,
>
> irb(main):001:0> x=[3,1,4,2,9,0]
> => [3, 1, 4, 2, 9, 0]
> irb(main):002:0> x.include? 4
> => true
> irb(main
Hello,
What's the better way to decide if an element exists in an array?
Something like what ruby does,
irb(main):001:0> x=[3,1,4,2,9,0]
=> [3, 1, 4, 2, 9, 0]
irb(main):002:0> x.include? 4
=> true
irb(main):003:0> x.include? 10
=> false
irb(main):004:0> quit
I
t;); my @b = sort { $a <=> $b } @a; say
join("\n",@b)'
12 hi
37 b
123 c
187 a
You can scope this if you like:
my @result;
{
no warnings 'numeric';
@result = sort { $a <=> $b } @source;
}
You could also force the strin
On Tue, 8 Mar 2016 13:29:40 -0800
Kenneth Wolcott wrote:
> How do I call the built-in Perl sort function on an array of strings
> where the string is composed of one or more digits, followed by a tab
> which is followed by a string and I want the results to be sorted in
> reverse numeric order?
://perldoc.perl.org/functions/sort.html and I still
> don't know the right answer to this question. I suppose if I disable
> warnings, then it works ok?
>
> The GNU sort (Cygwin/Linux) function does not complain about numbers
> followed by strings for the data when requested with reve
and I still
don't know the right answer to this question. I suppose if I disable
warnings, then it works ok?
The GNU sort (Cygwin/Linux) function does not complain about numbers
followed by strings for the data when requested with reverse sort and
just does it.
The "$b <=> $a
Hi;
What is the Perl equivalent of "net user username \domain" if I am
on Linux or Mac?
None of our Linux or Mac machines are a member of the specific
domain in question.
Do have to obtain the name of the AD/LDAP server and obtain some
kind of credentials for me to inqui
I tend to use Strawberry perl these days and would certainly recommend it.
Regarding the file paths you mentioned, the double back slash is correct
but also difficult to read. I change my windows scripts to use File::Spec
paths whenever I have to revisit them. This makes paths portable and easy
on
On 12/10/2015 5:40 AM, beginners-digest-h...@perl.org wrote:
On Mon, Dec 7, 2015 at 6:33 PM, Brock Wilcox wrote:
>Give devel::trace or devel::tracemore a try:)
Is it possible to install this from Active State repository without
having an-up-date ActiveState Perl DevKit license?
Thanks,
dead code and duplicate code. There are weird dependencies here
> > and there on Cygwin. Apparently there was an earlier (still present?)
> > dependency on MKTools. Some scripts need to be modified prior to
> > first build on a new branch. The builds sometimes work fine and
&g
this from Active State repository without
>> having an-up-date ActiveState Perl DevKit license?
Hi Brock;
Thanks so much for the tip!
It helps a lot!
I think I'll have to thank the author directly.
Now if the code was only in Perl instead of a chain of bash to Perl
t
I don't know. But I think that worst case you can just download the single
file from this library and add it to your application directly. It requires
no compilation or anything.
https://metacpan.org/source/MJD/Devel-Trace-0.12/Trace.pm
--Brock
On Mon, Dec 7, 2015 at 9:39 PM, Kenneth Wolcott
wr
On Mon, Dec 7, 2015 at 6:33 PM, Brock Wilcox wrote:
> Give devel::trace or devel::tracemore a try :)
Is it possible to install this from Active State repository without
having an-up-date ActiveState Perl DevKit license?
Thanks,
Ken Wolcott
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.
there was an earlier (still present?)
> dependency on MKTools. Some scripts need to be modified prior to
> first build on a new branch. The builds sometimes work fine and
> sometimes fail in strange ways.
>
> It would be nice if there was a trace facility built-in to Perl that
&
s here
> and there on Cygwin. Apparently there was an earlier (still present?)
> dependency on MKTools. Some scripts need to be modified prior to
> first build on a new branch. The builds sometimes work fine and
> sometimes fail in strange ways.
>
> It would be nice if there w
o
first build on a new branch. The builds sometimes work fine and
sometimes fail in strange ways.
It would be nice if there was a trace facility built-in to Perl that
I could enable that would tell me each line number of each script that
was currently executing.
I'd love to replace al
Brandon McCaig writes:
> Hope that helps.
Yes it does.
Thanks for the continuing review and criticism much needed in my case...
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Fri, Nov 28, 2014 at 9:40 AM, Brandon McCaig wrote:
> # Protip: I'm not sure which is better, interpolating $status
> # into the format string, or passing it as an argument. I'm
> # sure it's negligible in this case.
> printf "<%-60s> $status\n", $abs_path;
I lied. To be safe $
On Tue, Nov 18, 2014 at 05:46:15PM -0500, Harry Putnam wrote:
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> if (!@ARGV) {
Alternatively to the @ARGV == 0 suggested by others, there's
always:
unless(@ARGV) { ... }
It's a matter of taste. Nothing really w
d up copy-pasting it not fully understanding what it does.
Usually my workflow is
a) See if there's a CPAN module that does it
b) Talk to somebody who knows better.
Don't be afraid of asking questions, its just asking the right questions
and the right people where it gets complicated =)
Harry Putnam writes:
> Carl Inglis writes:
>
>> Interesting - in perl 5.10.1 on my system it works as expected.
>>
>> One point to note, your "$myscript" in your usage should be escaped
>> otherwise you get an error.
>
> No. That changed in some previous version a while ago I
> believe... any w
e.
[...]
Kent Fredric writes:
> On 19 November 2014 11:46, Harry Putnam wrote:
>
>> Only thing I did to debug was to make sure `use File::Find; comes
>> after if (!@ARGV), but that seems not to matter.
>>
>
> That will be because 'use' is processed during BE
On 18/11/2014 22:46, Harry Putnam wrote:
I'll probably be battered for general poor perlmanship but still
risking posting my whole script (fairly brief).
The problem I'm having with it, that I don't see how to debug is that
it breaks out on code inside Find.pm instead of breakin
On 19 November 2014 11:46, Harry Putnam wrote:
> Only thing I did to debug was to make sure `use File::Find; comes
> after if (!@ARGV), but that seems not to matter.
>
That will be because 'use' is processed during BEGIN { }, while your
condition is during the main executi
don't see how to debug is that
> it breaks out on code inside Find.pm instead of breaking out on the
> if clause designed to catch the advent of user forgetting to supply a
> target directory.
>
> The `if (!@ARGV) {[...] bleh; exit}' thing.
>
> I'm pretty sure it is
I'll probably be battered for general poor perlmanship but still
risking posting my whole script (fairly brief).
The problem I'm having with it, that I don't see how to debug is that
it breaks out on code inside Find.pm instead of breaking out on the
if clause designed to catc
On 18/09/2014 00:34, SSC_perl wrote:
On Sep 17, 2014, at 3:32 PM, Rob Dixon wrote:
As you have presented them, those code fragments are identical in meaning.
That was my understanding as well, but the inline 'if' gave an error
while the block didn't. Running the code by itself
On Sep 17, 2014, at 3:32 PM, Rob Dixon wrote:
> As you have presented them, those code fragments are identical in meaning.
That was my understanding as well, but the inline 'if' gave an error
while the block didn't. Running the code by itself in TextWrangler doe
On 17/09/2014 01:37, SSC_perl wrote:
I just ran across something puzzling. Why are these two statements
not equivalent when it comes to warnings?
if ($item->{'optionprice'}) {
$item->{'unitprice'} += $item->{'optionprice'};
}
and
$item
elf and it doesn't produce that warning, so it must be
> something upstream that's causing it.
>
> Thanks,
> Frank
The code
if (' ') { ... } will execute the block.
The code
if ('') { ...} will not
Neither ' ' nor '' are numer
On Sep 16, 2014, at 6:58 PM,
wrote:
> Are you sure you've quoted the code (that's producing the warning) correctly?
Yes, I did. I double-checked it just to be certain. However, I ran
the code by itself and it doesn't produce that warning, so it must be something
upstream that's caus
-Original Message-
From: SSC_perl
Sent: Wednesday, September 17, 2014 10:37 AM
To: Perl Beginners
Subject: Argument isn't numeric warning in if statement
I just ran across something puzzling. Why are these two statements not
equivalent when it comes to warnings?
if (
I just ran across something puzzling. Why are these two statements not
equivalent when it comes to warnings?
if ($item->{'optionprice'}) {
$item->{'unitprice'} += $item->{'optionprice'};
}
and
$item->{'unitprice'
Artifactory-Client: zero length file uploads
https://rt.cpan.org/Public/Bug/Display.html?id=97772
'expect' => '100-continue' undefined value as a SCALAR reference #63
https://github.com/libwww-perl/libwww-perl/issues/63
if(defined($wbits)) is giving me can't use and
On 2/25/2014 7:07 PM, Jim Gibson wrote:
On Feb 25, 2014, at 2:30 PM, Bill McCormick wrote:
What would be the perl'ish way using map or some other sugar to check if a list
of values meet some criteria? Instead of doing something like
my @issues = qq(123,456,a45);
my $max = 999;
for (@i
Hi all,
On Tue, 25 Feb 2014 17:07:00 -0800
Jim Gibson wrote:
>
> On Feb 25, 2014, at 2:30 PM, Bill McCormick wrote:
>
> > What would be the perl'ish way using map or some other sugar to check if a
> > list of values meet some criteria? Instead of doing something lik
On 25/02/2014 23:46, Bill McCormick wrote:
On 2/25/2014 4:36 PM, Bill McCormick wrote:
On 2/25/2014 4:30 PM, Bill McCormick wrote:
What would be the perl'ish way using map or some other sugar to check if
a list of values meet some criteria? Instead of doing something like
my @issues
On Feb 25, 2014, at 2:30 PM, Bill McCormick wrote:
> What would be the perl'ish way using map or some other sugar to check if a
> list of values meet some criteria? Instead of doing something like
>
> my @issues = qq(123,456,a45);
> my $max = 999;
>
> for (@iss
On 2/25/2014 4:36 PM, Bill McCormick wrote:
On 2/25/2014 4:30 PM, Bill McCormick wrote:
What would be the perl'ish way using map or some other sugar to check if
a list of values meet some criteria? Instead of doing something like
my @issues = qq(123,456,a45);
my $max = 999;
for (@i
Data::Constraint is an alternative if you are thinking to add more different
types of constraints.
On 25 Feb 2014, at 22:36, Bill McCormick wrote:
> On 2/25/2014 4:30 PM, Bill McCormick wrote:
>> What would be the perl'ish way using map or some other sugar to check if
>> a
Bill McCormick wrote:
> On 2/25/2014 4:30 PM, Bill McCormick wrote:
>> What would be the perl'ish way using map or some other sugar to check if
>> a list of values meet some criteria? Instead of doing something like
>>
>> my @issues = qq(123,456,a45);
>
On Tue, 25 Feb 2014 16:30:35 -0600
Bill McCormick wrote:
> I want to check if each list item is numeric and > 0 but less than
> $max.
See `perldoc Scalar::Util` and search for looks_like_number().
http://perldoc.perl.org/Scalar/Util.html
--
Don't stop where the ink does.
On 2/25/2014 4:30 PM, Bill McCormick wrote:
What would be the perl'ish way using map or some other sugar to check if
a list of values meet some criteria? Instead of doing something like
my @issues = qq(123,456,a45);
my $max = 999;
for (@issues) {
die if $_ < 0 or $_ > $max;
}
What would be the perl'ish way using map or some other sugar to check if
a list of values meet some criteria? Instead of doing something like
my @issues = qq(123,456,a45);
my $max = 999;
for (@issues) {
die if $_ < 0 or $_ > $max;
}
I want to check if each list item is numeric
2013/8/15 Brian Fraser :
> On Wed, Aug 14, 2013 at 6:09 PM, Alexey Mishustin
>> I'm sorry only that there is no built-in option with which one could
>> enable/disable easily assignments inside `if'. (E.g., like re 'eval'/
>> no re 'eval'). It wo
igning it - I have never done this at the same
> >>> time...
> >>
> >>
> >>
> >> Doing both in while statements is very common:
> >>
> >>while( my $line = <$fh> ) {
> >> ...
> >>}
> >>
gt; Doing both in while statements is very common:
>>
>>while( my $line = <$fh> ) {
>> ...
>>}
>>
>> Try to write that loop with two separate statements, one an
>> assignment
>
> and the other an if statement, and you may see the
t loop with two separate statements, one an
assignment
and the other an if statement, and you may see the advantage of the
currently-allowed syntax.
The general policy is that assignment statements return a value that
may be further used or tested.
i have a common idiom when dealing with a
s, one an assignment and the
other an if statement, and you may see the advantage of the currently-allowed
syntax.
The general policy is that assignment statements return a value that may be
further used or tested.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional command
Thanks to all,
2013/8/14 Jim Gibson :
> The problem is that the construct
>
> if( $foo = $bar ) {
> ...
>
> is not always a typo. It means: "assign value of $bar to variable $foo and
> test if the result is logically true", which is perfectly valid. If tha
Or maybe he can write a perl script to check the "if/while" conditionals of his
perl script...
while(<>){
say '= is detected where == is expected at line ',"$." if
/if\s*\(\S+?=[^=]/;
}
On 15 Aug 2013, at 03:02, Rob Dixon wrote:
> On 14/08/2013 1
Hi Alex,
I guess it would be very difficult and error-prone to do it. Here's my thought:
my $bar = 3;
my $assign = (my $foo = $bar);
if($assign){
say '$assign=',$assign;
}
my $equal = ($foo == $bar);
if($equal){
say '$equal=',$equal;
}
output:
$ perl tst.pl
$
On 14/08/2013 18:21, Alexey Mishustin wrote:
If I make a typo and write a single "equals" operator here:
if ($foo = 2) {
print "yes\n";
}
...then the "warnings" pragma works OK and tells me "Found = in
conditional, should be ==..."
But if
On Aug 14, 2013, at 11:34 AM, Alexey Mishustin wrote:
> Hi Jing,
>
> Thanks for the reply.
>
> So, there is no built-in way to catch these typos?
The problem is that the construct
if( $foo = $bar ) {
...
is not always a typo. It means: "assign value of $bar to va
Hi Jing,
Thanks for the reply.
So, there is no built-in way to catch these typos?
--
Regards,
Alex
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Hi there,
Allow me to correct myself, the value of the assignment is the new value of the
variable. But in the end it is the same. The compiler won't be able to see what
$bar is when used in if ($foo=$bar), therefore won't throw any warnings.
Cheers,
Jing
On 15 Aug 2013, at 01:
Hi Alexey,
If I remember correctly, when you assign a value to an lvalue like this:
$foo = 1;
The value of the assignment is the value on the right hand side of the equal
sign.
So when you do something like:
if ($foo=2){...}
It has the same effect as this:
$foo=2;
If (2){...}
The condition
Hello all,
If I make a typo and write a single "equals" operator here:
#!/usr/bin/perl
use strict;
use warnings;
my $foo = 1;
my $bar = 2;
if ($foo = 2) {
print "yes\n";
}
else {
print "no\n";
}
...then the "warnings" pragma works
lina wrote:
Thanks Jim and John.
btw, what does the fileno mean? mean file-not-open?
It means file number. For example, STDIN is file number 0, STDOUT is
file number 1, STDERR is file number 2 and the next file opened is file
number 3, etc.
John
--
Any intelligent fool can make things bi
Hi,
On Tue, Aug 28, 2012 at 12:15 PM, lina wrote:
> Thanks Jim and John.
>
> btw, what does the fileno mean? mean file-not-open?
>
perldoc -f fileno
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org
Thanks Jim and John.
btw, what does the fileno mean? mean file-not-open?
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
7;<', $fn;
my $ofh;
while(my $line =<$fh>){
if($line =~ /MODEL \s+(3|5|80|89|459)$/){
my $model = $1;
open $ofh, '>', "extracted_$model.pdb";
print $ofh $_;
}
if($line =~ /ENDMDL/){
On Aug 27, 2012, at 9:30 PM, lina wrote:
> Hi,
>
> I don't know which is the best way to "check whether this file is open
> or not,"
In general, you don't have to worry about it, because:
1. If a file handle goes out of scope, the file will be closed.
2. If
$fn;
my $ofh;
while(my $line = <$fh>){
if($line =~ /MODEL \s+(3|5|80|89|459)$/){
my $model = $1;
open $ofh, '>', "extracted_$model.pdb";
print $ofh $_;
}
if($line =~ /ENDMDL/){
close($ofh) if
On 12-03-14 12:35 AM, John W. Krahn wrote:
cmp is a binary operator just like eq, ne, gt, lt, ge and le.
See `perldoc perlop` and search for /Equality Operators/
--
Just my 0.0002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about co
Noah wrote:
Hi there,
Hello,
I am trying to get two conditions matched
how can I get if ( ($source_location eq $destination_location ) && (
$source_device < $destination_device ) ) {
That should be:
if ( $source_location eq $destination_location && $source_device lt
Hi there,
I am trying to get two conditions matched
how can I get if ( ($source_location eq
$destination_location ) && ( $source_device < $destination_device ) ) {
and
if ( ($source_location eq $destination_location ) && (
$source_device &g
On 21/06/2011 15:01, Bob McConnell wrote:
From: Paul Johnson
On Tue, Jun 21, 2011 at 05:57:22AM -0700, Beware wrote:
Hi to all,
First of all, sorry for the late of my answer.
Thank for all your sentence.
Here's my solution (for now) :
for my $w (@keywords)
{
if ( /\
all your sentence.
> >>
> >> Here's my solution (for now) :
> >>
> >> for my $w (@keywords)
> >> {
> >> if ( /\b$w\b/ and !/\buc($w)\b/ )
> >> {
> >> print "Keyword '$w' no
From: Paul Johnson
> On Tue, Jun 21, 2011 at 05:57:22AM -0700, Beware wrote:
>
> > Hi to all,
>>
>> First of all, sorry for the late of my answer.
>> Thank for all your sentence.
>>
>> Here's my solution (for now) :
>>
>> for my $w
On Tue, Jun 21, 2011 at 05:57:22AM -0700, Beware wrote:
> Hi to all,
>
> First of all, sorry for the late of my answer.
> Thank for all your sentence.
>
> Here's my solution (for now) :
>
> for my $w (@keywords)
> {
>
Hi to all,
First of all, sorry for the late of my answer.
Thank for all your sentence.
Here's my solution (for now) :
for my $w (@keywords)
{
if ( /\b$w\b/ and !/\buc($w)\b/ )
{
print "Keyword '$w' not uppercase line $.\n";
On Wed, Jun 15, 2011 at 12:09 PM, Jim Gibson wrote:
> '$w eq $w' is always true.
It certainly is more sane when that holds true, but to have a little
fun there is overload. ;D
use strict;
use warnings;
use overload '==' => sub { return 0; };
my $foo = bless {};
print $foo == $foo;
__END__
On 15/06/2011 17:09, Jim Gibson wrote:
On 6/15/11 Wed Jun 15, 2011 8:20 AM, "Rob Dixon"
scribbled:
I am afraid that will not work. $w is extracted from the input line and may
contain lower-case letters. You must compare $w to uc $w to see if it
contains any lower-case letters.
example.
>>>>
>>>> (I prefer my keywords to be in lowercase.)
>>>>
>>>>
>>>> #!/usr/bin/perl
>>>>
>>>> use strict;
>>>> use warnings;
>>>>
>>>> my @keywords = qw
>>&g
ntity exit file for function generate generic
group
guarded if impure in inertial inout is label library linkage literal
loop
map mod nand new next nor not null of on open or others out package port
postponed procedure process pure range record register reject return rol
ror select severity signal sha
le for function generate
generic group
guarded if impure in inertial inout is label library linkage
literal loop
map mod nand new next nor not null of on open or others out package port
postponed procedure process pure range record register reject return rol
ror select severit
exit file for function generate generic
group
guarded if impure in inertial inout is label library linkage literal loop
map mod nand new next nor not null of on open or others out package port
postponed procedure process pure range record register reject return rol
ror select severity signal shared
r/bin/perl
use strict;
use warnings;
my @keywords = qw
(
abs access after alias all and architecture array assert attribute begin
block body buffer bus case component configuration constant disconnect
downto else elsif end entity exit file for function generate generic group
guard
1 - 100 of 1357 matches
Mail list logo