Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: How to access each element in an array Perl

by three18ti (Scribe)
on Jan 18, 2014 at 18:58 UTC ( #1071132=note: print w/replies, xml ) Need Help??


in reply to Re: How to access each element in an array Perl
in thread How to access each element in an array Perl

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;'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1071132]
help
Chatterbox?
[LanX]: met a guy from Aberdeen durin holidays, liked Scotsish accent a lot ... very phonetic
[LanX]: ... understood everything after mentally write down what he said.
[choroba]: Trainspotting?
[choroba]: Ouch, trailing commas in JSON :-(
[LanX]: ... though there seems to exist a taxation for the letter 't' in Northern Bri''ain ;-)
[LanX]: never seen trainspotting in OV ... :(

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2018-02-19 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (261 votes). Check out past polls.

    Notices?