Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Print from array element to another array element

by kcott (Canon)
on Apr 07, 2013 at 09:34 UTC ( #1027341=note: print w/replies, xml ) Need Help??


in reply to Print from array element to another array element

G'day Dr Manhattan,

What you're attempting to use here are called Array Slices. They take the form: @array_name[<list of indices>]. See perldata - Slices. Your code should look something like this:

$ perl -Mstrict -Mwarnings -E ' my $word = q{catfood}; my @array = split // => $word; say join q{} => @array[3 .. $#array]; ' food

-- Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027341]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2017-02-20 03:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (293 votes). Check out past polls.