in reply to Re^2: why does push not default to $_?
in thread why does push not default to $_?
Well for me, calling push with only one parameter is quite obvious. At least not less than print without parameter.The difference is that print does not alter its operands but push does. Even ignoring these there is hardly a good reason to use $_ for push. For example, in iterators which set the $_ you might want to use something like: for(1..100) { push @a;}, but still you would be better going by push @a,(1..100);
Please, in which chapter did you find that quote in the camel book?You can find the quote in Chapter 28-Special Names, page 659.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: why does push not default to $_?
by LanX (Saint) on Dec 06, 2008 at 02:13 UTC |