look in
perldoc perlvar for
$/ -- it's the input record separator. So
print $sheet->Name, $/; is just a fancier, more generic way to do
print $sheet->Name, "\n";
what's wrong with using a temp variable? You can always turn the loop into a map and get an array:
# Loop method from above:
foreach my $sheet ( in $xls->Worksheets ) {
print $sheet->Name, $/;
}
# one line to get array of names:
my @names = map { $_->Name } in $xls->Worksheets;
As for the warning, it's because you have
my $current_sheet = $sheet->Name, $/; but i think it was intended as:
my $current_sheet = $sheet->Name . $/;