Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: $foo->bar = 14;

by BrowserUk (Pope)
on Dec 29, 2002 at 20:56 UTC ( #222957=note: print w/ replies, xml ) Need Help??


in reply to $foo->bar = 14;

I'm getting

syntax error at C:\test\lvalue.pl line 10, near "$property :" BEGIN not safe after errors--compilation aborted at C:\test\lvalue.pl +line 10.

from

BEGIN { no strict 'refs'; for my $property (qw/id debug display_time default_text/) { *$property : lvalue = sub { $_[SELF]->{$property} }; } }

What am I doing wrong?


Examine what is said, not who speaks.


Comment on Re: $foo->bar = 14;
Select or Download Code
Re: Re: $foo->bar = 14;
by sauoq (Abbot) on Dec 29, 2002 at 20:58 UTC

    I think the proper syntax would be:

    *$property = sub : lvalue { ... }

    Update: It appears Juerd has fixed it in his original post now too.

    -sauoq
    "My two cents aren't worth a dime.";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://222957]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2014-11-23 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (132 votes), past polls