in reply to Re^3: vec overflow?
in thread vec overflow?
I think using a foreach alias like shown in the docs for substr is a clearer alternative to lvalue-refs.
Maybe, though I've been aware of LVALUE refs, and using them regularly, for a long time, but I've never seen a use of a for alias used that way until I followed your link to a newer set of docs than I have locally.
Comparing:
my $ref = \ substr( $astring, $start, $len ); vec( $$ref, $offset, $size ) = 1;
To:
vec( $_, $offset, $size ) = 1 for substr( $astring, $start, $len );
The first one is very familiar (to me), whereas the latter just looks weird.
The presence of \ and $$ref seem stronger clues than the $_ and for.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: vec overflow?
by LanX (Saint) on Jun 25, 2013 at 14:04 UTC | |
by BrowserUk (Patriarch) on Jun 25, 2013 at 14:18 UTC | |
by LanX (Saint) on Jun 25, 2013 at 14:32 UTC |