in reply to Inconsistent for the sake of convenience
But in places like map EXPR and grep EXPR, it can mean something very different. This is especially bizarre when foo is a built-in that modifies $_ when it is called with no args:print lc, $/; ## ^^ ## call lc with no args, return the result:
map chop, @items; ## ^^^^ ## calls map with first argument = sub{ chop; } ## doesn't change current value of $_ anyotherfunc chop, @items; ## ^^^^ ## calls anyotherfunc with first argument = result of chop($_) ## changes current value of $_ !!
blokhead
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Inconsistent for the sake of convenience
by hobbs (Monk) on Feb 19, 2009 at 04:20 UTC |