|Perl: the Markov chain saw|
Re^5: vec overflow?by LanX (Chancellor)
|on Jun 25, 2013 at 14:04 UTC||Need Help??|
A matter of taste ...
vec( $_, $offset, $size ) = 1 for substr( $astring, $start, $len );
has no big advantage over
vec( substr( $astring, $start, $len ), $offset, $size ) = 1;
looks better for me than de/referencing and has the advantage to be documented in the docs.
And your use of \ substr( $astring, $start, $len ); is less frequent and makes me wondering about precedences.
(The practice to reference lvalues is still somehow new for me...)
OTOH your approach has the (dis?)advantage that the ref can be passed around w/o being restricted to the body of a for loop...
Well ... I'll better continue meditating about it after seeing more use cases! :)
( addicted to the Perl Programming Language)