Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: $foo->bar = 14;

by jimc (Sexton)
on Jan 03, 2003 at 16:09 UTC ( #224054=note: print w/ replies, xml ) Need Help??


in reply to $foo->bar = 14;

lvalue methods are a questionable idea, at least if used universally.

an lvalue method just exposes a variable (ie the storage for) to the assignment, it runs b4 the assignment is done.

It gets no chance to validate the RHS, thus you could accidentally do:

$person->age = -1;
$person->name = '2/22/01';
$person->ssn = 'capt. bob';


Comment on Re: $foo->bar = 14;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2015-07-03 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (51 votes), past polls