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.
In reply to Re: Regex practice script
by jwkrahn
in thread Regex practice script
by kindlychung
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |