in reply to How to access each element in an array Perl

See substr or m//atch operator
  • Comment on Re: How to access each element in an array Perl

Replies are listed 'Best First'.
Re^2: How to access each element in an array Perl
by PetreAdi (Sexton) on Jan 18, 2014 at 09:50 UTC

    Try this

    my@arr=qw( Larrywall); print "\n @arr[0]"; $string=@arr[0]; $sub_str1=substr($string,0,4); $sub_str2=substr($string,5,2); print "\n $sub_str1"; print "\n $sub_str2";