- or download this
use strict;
use warnings;
...
my $var = 'abcd,ef,,ghijkl,mnop';
print "$1\n" while $var =~ /$regex/g;
- or download this
18:27 >perl 827_SoPW.pl
abcd
...
mnop
18:27 >
- or download this
use strict;
use warnings;
...
my @matches = split /,/, $var;
$_ && print "$_\n" for @matches;