in reply to Regex practice script
while ((say "Input template string:") && ($string = <>) ) { while ((say "Input pattern:") && ($pattern = <STDIN>)) {
That should be:
while ((say "Input template string:") && defined(my $string = <>) ) { while ((say "Input pattern:") && defined(my $pattern = <STDIN>)) {
If you enter "0" for either $string or $pattern your loop will end prematurely.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex practice script
by JavaFan (Canon) on Jul 25, 2011 at 14:15 UTC | |
|
Re^2: Regex practice script
by kindlychung (Initiate) on Jul 25, 2011 at 15:35 UTC |