perlNinny has asked for the wisdom of the Perl Monks concerning the following question:
Now then, does $line end up altered after the first if so that the 2nd if is less effective?my $line = $_; if($line =~ s/^.+\/\.(.*)$/$1/) { print ". extension ".$line."\n"; } elsif ( $line =~ s/^.+\.(.*)$/$1/) { print "Extension ".$line."\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: messing up $line?
by chromatic (Archbishop) on Apr 27, 2007 at 17:19 UTC | |
by perlNinny (Beadle) on Apr 27, 2007 at 20:26 UTC | |
|
Re: messing up $line?
by jettero (Monsignor) on Apr 27, 2007 at 17:17 UTC | |
|
Re: messing up $line?
by johngg (Canon) on Apr 27, 2007 at 20:36 UTC | |
|
Re: messing up $line?
by cengineer (Pilgrim) on Apr 27, 2007 at 17:18 UTC | |
by cengineer (Pilgrim) on Apr 27, 2007 at 17:20 UTC |