in reply to Anonymous scalar ref revisited
or evenf(\[]);
Whether it is elegant is in the eye of the beholder. It surprised me that this worked, since the scalar is a reference to a reference, but it can be assigned to and modified, unlike f(\1) which gives a reference but is read-only (but does appear to return different addresses each time called).f(\{});
but this is an aberation of the subroutine call interface.f(\());
Gives: Modification of a read-only value attemptedmy $ref = \(); $$ref = 42;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Anonymous scalar ref revisited
by rovf (Priest) on Apr 06, 2010 at 11:36 UTC |