Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: What the [sub]in 'L value do they have?

by adrianh (Chancellor)
on Dec 15, 2002 at 12:01 UTC ( #219987=note: print w/ replies, xml ) Need Help??


in reply to What the [sub]in 'L value do they have?

Since I wrote "lvalue considered harmful..." you can probably guess how much I use them :-)

My ideal would be to be able to separate setting & getting into separate subs like in Pop-11 so you could do:

sub foo { my $self = shift; $self->{foo}; }; sub :updater foo { my ($self, $val) = @_; $self->{foo} = $val; }; print "foo is ", $self->foo, "\n"; $self->foo = 42;

Having this sort of structure keeps the getting and setting logic nice and clear, and (in an ideal world) you would be able to override the setter/getter subroutines separately in subclasses.

Probably a complete sod to implement tho' :-)


Comment on Re: What the [sub]in 'L value do they have?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (15)
As of 2014-09-17 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (88 votes), past polls