Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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\ line 10, near "$property :" BEGIN not safe after errors--compilation aborted at C:\test\ +line 10.


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.

Replies are listed 'Best First'.
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.

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://222957]
[LanX]: Snowden remins me of Evan Spiegel (... start of a new conspiracy theory)
[LanX]: yes! The same person!
[Eily]: LanX can't be, they're both on the picture at the same time. Duh
[LanX]: They hired a Hollywood producer to fake the pic
LanX has to go and change location, I can hear THEM on the stairs...
[Eily]: they can't actually fake the pics, that's what they want you to believe so that you can't accept obvious proofs

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2018-03-19 15:30 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.