Lennotoecom has asked for the wisdom of the Perl Monks concerning the following question:
Hi, please advice me on implicit dereference of the shift
if it is possible.
!update
Mr LanX thank you very much for provided answers.
the answers are:
${shift()}+=2
${+shift}+=2
though I'm going to google what that "+" stuff exactly does.
-this works just fine, but is there any chance to dereference it somehow as ${$shift}+=2; ? without interim variable?$a = 5; $add2= sub{ $b = shift; $$b+=2;}; &$add2(\$a);
!update
Mr LanX thank you very much for provided answers.
the answers are:
${shift()}+=2
${+shift}+=2
though I'm going to google what that "+" stuff exactly does.
Back to
Seekers of Perl Wisdom