in reply to Store the outcome of a foreach loop in an array
Now that the OP updated code tags is obvious he didn't mean @val2 but @val[2]
You are pushing @val2 not @val.
Better use strict and warnings to catch typos!
Please put <code> </code> tags around your code and data
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Store the outcome of a foreach loop in an array
by perl_5eeker (Novice) on Jan 10, 2019 at 22:29 UTC | |
by pryrt (Abbot) on Jan 10, 2019 at 22:30 UTC | |
by LanX (Saint) on Jan 10, 2019 at 22:33 UTC |