in reply to Re: a referencable array slice (so assigning to it modifes the original)
in thread a referencable array slice (so assigning to it modifes the original)
use strict; use warnings; use Data::Alias; use Data::Dumper; my @foo = qw( A T T G C T T G C T T C ); alias my @view = ( @foo[1,2], @foo[5,6] ); push @view, @foo[7,8]; map {$_='$'} @view; print Dumper \@foo; print "nok" if $foo[7] ne '$';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: a referencable array slice (so assigning to it modifes the original)
by TGI (Parson) on Jun 18, 2008 at 16:50 UTC | |
by muenalan@cpan.org (Initiate) on Jun 18, 2008 at 18:47 UTC | |
by TGI (Parson) on Jun 18, 2008 at 20:53 UTC |