in reply to Re: (my?) problem with re-blessed references(?)
in thread (my?) problem with re-blessed references(?)
Just wanted to say that the standard way of doing this is not to parethesize the shift, but to put a + in front of it. This is perls way of ensuring that whatever follows the plus is construed as code and not something else. Note that this is NOT the same as 0+shift, which coerces numeric context.
This is IME particularly useful with print and with hash keys.
print +($.>10) ? "Skipped." : "Ok"; $foo{+shift}=10;
--- demerphq
my friends call me, usually because I'm late....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: (my?) problem with re-blessed references(?)
by Aristotle (Chancellor) on Dec 15, 2002 at 02:01 UTC | |
|
Re^3: (my?) problem with re-blessed references(?)
by adrianh (Chancellor) on Dec 13, 2002 at 13:51 UTC |