in reply to Why does this code think I'm trying to use symbolic references?
I know how to work around it; but for the life of me I cannot see why I need to?
This is hairy. It is one case where whitespace matters in perl.
Two things are going on here:
use strict; $n = 1000; $\=$/; print $n +4; # indirect object notation, + is sign marking 4 as posit +ive (unary plus) print $n + 4; # $n + 4 is addition, result is printed print +$n +4; # unary + prevents $n from being interpreted as file han +dle, 1004 is printed print ($n +4); # same as case 1 print ($n + 4); # same as case 2 print+($n +4); #same as case 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why does this code think I'm trying to use symbolic references?
by BrowserUk (Patriarch) on Jun 13, 2016 at 12:37 UTC | |
|
Re^2: Why does this code think I'm trying to use symbolic references?
by Your Mother (Archbishop) on Jun 13, 2016 at 14:54 UTC | |
by shmem (Chancellor) on Jun 14, 2016 at 15:36 UTC |