Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Print from array element to another array element

by kcott (Abbot)
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


Comment on Re: Print from array element to another array element
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027341]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2014-12-21 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls