in reply to Re^4: vec overflow?
in thread vec overflow?
for me
vec( $_, $offset, $size ) = 1 for substr( $astring, $start, $len );
has no big advantage over
vec( substr( $astring, $start, $len ), $offset, $size ) = 1;
but
for my $chunk ( substr( $astring, $start, $len ) ) { ... vec( $chunk, $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! :)
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: vec overflow?
by BrowserUk (Patriarch) on Jun 25, 2013 at 14:18 UTC | |
by LanX (Saint) on Jun 25, 2013 at 14:32 UTC |