in reply to Multiple variables sub
It's impossible to do exactly that, since a sub can only return a list of scalars. The entire list would be assigned to @file.
You could return array references, though.
sub getfile { ... return ( \@file, \@file2 ); } my ($file, $file2) = getfile('file.txt', 'file2.txt'); for (@$file ) { ... } for (@$file2) { ... }
|
|---|