http://qs1969.pair.com?node_id=1071123


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

Adding to the other comments if you really want to make this an array then use spaces between the letters, this is the delimiter for "qw" elements:

my @array = qw(L a r r y W a l l);

Replies are listed 'Best First'.
Re^2: How to access each element in an array Perl
by three18ti (Monk) on Jan 18, 2014 at 18:58 UTC
    Why not:
    use Data::Dump; my $string = 'LarryWall'; my @array = split//, $string; dd @array;

    (Data::Dump is just to show what's in the array)

    Here's a oneliner doing the same thing

    perl -MData::Dump -e 'my $str = 'LarryWall'; my @arr = split//,$str; d +d @arr;'