Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Surprising quirk of method call parser

by talexb (Canon)
on Nov 04, 2010 at 15:47 UTC ( #869491=note: print w/replies, xml ) Need Help??

in reply to Surprising quirk of method call parser

In Perl, braces are used to force the parser to evaluate those items first. You've solved the issue by putting braces around your hash access, so this means the parser was reading your code left to right, $obj->$meth followed by {a}, which it presumably hated.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re^2: Surprising quirk of method call parser
by kstar (Novice) on Nov 04, 2010 at 17:28 UTC
    Alex, I can almost buy your explanation, but this code had "use strict", yet it didn't crap out with 'Global symbol "$a" requires explicit package name' (yes, I know that $a is special because of sort(); in the actual code, the variable had a different name (%Schema, to be precise), and was definitely declared as only a hash).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://869491]
[LanX]: yes I worked ...
[LanX]: ... and hope to get a free work day in compensation. :)
choroba went to a museum with the older children. The exhibition was called "American Indians".
[Discipulus]: this and...
[Discipulus]: shaving the ceil

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2018-02-19 10:30 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (261 votes). Check out past polls.