in reply to using push
When you use something like foreach (@thescore) each element of @thescore is placed into the "default" variable, $_, unless you tell it different.
So, something like
would work for what you have above.foreach (@thescore) { print $_, "\n"; }
If you specifically wanted to assign the data to, for example, the $score variable, you can do this by specifying the variable when you define the loop:
Hope that helps a little.foreach my $score (@thescore) { print $score, "\n"; }
|
|---|