Keary gave me
> Some pointers:
>
> > if ( scalar @ARGV > 0 )
> > { @testList = @ARGV;
> > }
>
> The use of "scalar" here is superfluous "if" and "==" force a scalar
> context.
I am aware of that, but I still have trouble keeping track of what
contexts do what to which. Still kind of new to perl
Some pointers:
> if ( scalar @ARGV > 0 )
> { @testList = @ARGV;
> }
The use of "scalar" here is superfluous "if" and "==" force a scalar
context.
> if ( $level =~ m/^1.*/ )
> { push @testList, @originalTopPagePlusFlack;
> }
Note that this will match if $level is 10-19, 100+ etc as well. Your
o
Thanks, Chris, Bart, and Paul. Got it solved:
if ( scalar @ARGV > 0 )
{ @testList = @ARGV;
}
if ( $level =~ m/^1.*/ )
{ push @testList, @originalTopPagePlusFlack;
}
elsif ( $level =~ m/^2.*/ )
{ push @testList, @ano
Additionally, you can look at perlfaq4, "How do I determine whether a
scalar is a number/whole/integer/float?"
--
Chris Nandor [EMAIL PROTECTED]http://pudge.net/
Open Source Development Network[EMAIL PROTECTED] http://osdn.com/
On Mon, 15 Jul 2002 19:14:32 +0900, Joel Rees wrote:
>I have some code that looks like this:
>
> if ( int( $level ) == 1 )
> { push @testList, @originalTopPagePlusFlack;
> }
Can $level ever be non-integer? If not, you may drop int() call.
>When it runs with an empty stri
I have some code that looks like this:
if ( int( $level ) == 1 )
{ push @testList, @originalTopPagePlusFlack;
}
When it runs with an empty string in $level, (using strict) I get this
warning:
Argument "" isn't numeric in int at autohits.pl line 352