in reply to why do I have to provide context to split result in a separate statement?
\(@arr = split / /, '') returns a list of references.
For example \( $a, $b, $c ) is actually ( \$a, \$b, \$c ) and you can't dereference that as an array.
What you could do is copy the list to an anonymous array:
print @{[@arr = split / /, '']}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: why do I have to provide context to split result in a separate statement?
by ikegami (Patriarch) on Sep 21, 2011 at 01:43 UTC | |
by Mark_Galeck (Novice) on Sep 21, 2011 at 02:04 UTC | |
by jwkrahn (Abbot) on Sep 21, 2011 at 01:59 UTC | |
by ikegami (Patriarch) on Sep 21, 2011 at 02:11 UTC |