But I did $var = *x
So did I. I said \*x also works.
it's not obvious that $val needs dereferencing.
I showed that it doesn't need dereferencing.
$gv = *x; @$gv => @x
Of course, one needs to use the sigil to access the components of the glob.
$gv = *x; $gv{ARRAY} # Obviously wrong. *$gv{ARRAY} # Ok
...and not this:
Do you really want print($count + 2) to use $count as a file handle?
print(STDOUT + 2) => print( { STDOUT } 2 )
Barewords will be handled as expected, but anything else followed by what could be an infix operator will be treated as an argument to that operator.
print(*STDOUT + 2) => print( { select() } *STDOUT+2 ) print(*$x + 2) => print( { select() } *$x+2 ) print($x + 2) => print( { select() } $x+2 )
In reply to Re^3: typeglob: $var = *x ???
by ikegami
in thread typeglob: $var = *x ???
by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |