in reply to Precedence of qw
qw/STRING/ Evaluates to a list of the words extracted out of STRING, using embedded whitespace as the word delimiters. It can be under- stood as being roughly equivalent to: split(’ ’, q/STRING/); the differences being that it generates a real list at compile time, and in scalar context it returns the last element in the list.
So why in the heck would you use this operator on one value in the middle of a push statement. The interpreter does its best but you are making it hemmorage here. use the q operator.
#This works: push @array, q(X) x 2; print @array, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Precedence of qw
by eff_i_g (Curate) on Apr 04, 2006 at 17:14 UTC | |
by ikegami (Patriarch) on Apr 04, 2006 at 17:39 UTC | |
by doc_faustroll (Scribe) on Apr 05, 2006 at 02:51 UTC |