in reply to RE: RE: A minor epiphany with grep and map
in thread A minor epiphany with grep and map
Given the precedence rules, @$x->{y} is not the same as @{$x->{y}}. Rather, it's the same as (@$x)->{y}. Look at the output of -Dx and -Dts if you don't believe me.
In fact, now that I try a simple test, the original code can't work:
$ perl -le '$x={y=>[1]}; print @$x->{y}' Not an ARRAY reference at -e line 1. $ perl -le '$x={y=>[1]}; print @{$x->{y}}' 1
So let's see the full code to the original, OK?
-- Chip Salzenberg, Free-Floating Agent of Chaos
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(No, I am an idiot, not confused) Re: The hash ref hits!
by mwp (Hermit) on Jul 28, 2000 at 23:33 UTC |