in reply to Re: Yet another problem with recursive code
in thread Yet another problem with recursive code
Never use defined() on arrays nor on hashes because it doesn't mean what you think it means. You want one of these:
An empty array can still be "defined" (or un"defined"), depending on obscure details about its history. Also, $ARGV[0] =~ /-all/ will be true if your first argument is "tell-all books", for example, probably not what you wanted. - tye (but my friends call me "Tye")if( @ARGV && $ARGV[0] eq "-all" ) { if( 0 < @ARGV && "-all" eq $ARGV[0] ) {
|
|---|