in reply to Array Scopes?
A literal translation of your code would be:
my $line = "math101, A, 203, MWF, 9:30am, Einstein"; my ($coursename, $building, $room, $day, $time, $name) = split /, /, $line; say $building; say $name;
But of course, there's no reason to declare six variables when you could store everything in one array variable.
As for any scope problem, you need to prove your case. That means you need to post a complete example that anyone can run, which displays some output inside the loop, then displays some output outside the loop.
|
|---|