Taking our anonymous brother's spec literally, here is a solution which produces the actual output he says is desired:
use strict; use warnings; while (my $line = <DATA>) { my ($key, @nums) = split /[\s-]+/, $line; $key =~ s/f$/d/; print "$key $_\n" for @nums; } __DATA__ abcd 723-724 abcde 552-554-553 abcdef 756
In reply to Re: regex problem
by hippo
in thread regex problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |