in reply to array and string split

It seems to me you're asking how to simplify these lines:
foreach my $line (@port) { my @PORTS = split('\n', $line); foreach my $str (@PORTS){ ... } } }
Perhaps something like this:
for my $str ( map { split /\n/ } @port ) { ... }

Replies are listed 'Best First'.
Re^2: array and string split
by Anonymous Monk on Jan 27, 2015 at 13:09 UTC

    Perfect! Thank you!