Do you know where your variables are? | |
PerlMonks |
Re: For loop problemby ehdonhon (Curate) |
on Nov 28, 2002 at 14:56 UTC ( [id://216313]=note: print w/replies, xml ) | Need Help?? |
for ($d=1;$d<10;$d++){ That's going to iterate $d from 1 to 9. Its valid syntax, but its easier to read, and more perlish this way: for my $d ( 1..9 ) {
if ($line =~ /^(\d{1,10})/){
if ($d =~ /^$key$/){ this is my 023 string hello 10 hi there 0 how are you 03
In Section
Seekers of Perl Wisdom
|
|