CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [teknokid1] Need to create a 2D array to store desired data.: Edit Log



BillKSmith
Veteran

Nov 17, 2011, 8:28 AM


Views: 2760
Re: [teknokid1] Need to create a 2D array to store desired data.

Replace @data = .... with:


Code
   

push @data, [(split)[5..7]];



This uses the default arguments for split,

Makes a reference to elements 5 through 7. Note: In perl, array index starts at zero, not one.

pushes that reference into the array @data.
Good Luck,
Bill

(This post was edited by BillKSmith on Nov 18, 2011, 5:47 AM)


Edit Log:
Post edited by BillKSmith (Veteran) on Nov 18, 2011, 5:47 AM: Add comma to code


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives