Replacing
by$str =~ s/-/\.\./g;
seems to do what you want... (on correct input: positive numbers, first one lesser than second).$str =~ s/(\d+)-(\d+)/join(",",$1..$2)/ge;
In reply to Re: arrays and loop through array
by Perlbotics
in thread arrays and loop through array
by RedGrinGo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |