go ahead... be a heretic | |
PerlMonks |
Re: Re: Re: Initialize arrayby aijin (Monk) |
on Jul 03, 2001 at 23:12 UTC ( [id://93640]=note: print w/replies, xml ) | Need Help?? |
Instead of your if ($number > $#lines | $number <=0) section, you could try something like this:
This will check if there's a value at the spot in the array. This will benefit you if, in the future, you expand your code to delete links, or if you accidentally have blank lines in your input file. As always, TMTOWTDI.
In Section
Seekers of Perl Wisdom
|
|