in reply to Re^2: Mixed lvalue/rvalue sub function
in thread Mixed lvalue/rvalue sub function
Ah, yes, you are of course completely right, I guess I did too much C++ recently :)
Alternatively you could return a reference to the header, of course. But it would look kinda more ugly than the simple optional argument solution:
my $slot = $self->header ('test'); $$slot = "New value"; print "Value for header: $$slot"; # or even $slot, if you overload the + stringification
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Mixed lvalue/rvalue sub function
by mscharrer (Hermit) on Apr 18, 2008 at 17:18 UTC |