in reply to Re: Array - Reading frame problem
in thread Array - Reading frame problem

Haha :) thanks graff.. but is it possible to just display the sequence from position 1 onwards and right to the end? (excluding position 0)

Replies are listed 'Best First'.
Re^3: Array - Reading frame problem
by graff (Chancellor) on Jul 16, 2005 at 16:37 UTC
    You just need to learn more of the basics of perl syntax. There are lots of ways to do whatever you want with any subset of array elements:
    print "$_\n" for ( @array[1..$#array] ); # which is the same as: for my $i ( 1 .. $#array ) { print "$array[$i]\n"; } # and $" = "\n"; print "@array[1..$#array]\n";
Re^3: Array - Reading frame problem
by holli (Abbot) on Jul 16, 2005 at 16:42 UTC
    It is, using the slice notation already mentioned above.
    my $sequence = "1234567890"; my @chrsequence = (split //, $sequence)[1..length($sequence)-1]; print "array has " . scalar @chrsequence . " elements: @chrsequence\n" +;


    holli, /regexed monk/