Re: [MacPerl-AnyPerl] testing numericity

2002-07-15 Thread Joel Rees
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

Re: [MacPerl-AnyPerl] testing numericity

2002-07-15 Thread Chris Nandor
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/

Re: [MacPerl-AnyPerl] testing numericity

2002-07-15 Thread Bart Lateur
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

[MacPerl-AnyPerl] testing numericity

2002-07-15 Thread Joel Rees
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