in reply to Re^2: Printing a Variable outside of the block
in thread Printing a Variable outside of the block
my ($part1, $part2); for my $line (@l){ chomp $line; ($part1, $part2) = split /\*/,$line; } print "$part1 $part2\n";
But of course that prints only one line (the last), because each iteration of the block overrides the variables.
If you don't like that, use an array and push the values onto the array.
|
|---|