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: Beginner: Re: [tbone587] Taking input multiples times and storing into array: Edit Log



FishMonger
Veteran / Moderator

Mar 5, 2011, 5:34 AM


Views: 2242
Re: [tbone587] Taking input multiples times and storing into array

Please post your responses here instead of a PM.


Quote
thanks a lot for your help. When I go to print out the input how to I print each one? For instance how would I print the second input? Also can you explainm the $i-1 part? I really appreciate any help.


Use a for/foreach loop to output each element of the array.

Arrays are zero indexed, meaning the first element is index 0. Since the for loop I used starts at 1 instead of 0, you need to subtract 1 from $i to access the proper index.

The second input, which is the second array element, is accessed as:

Code
$Mon_UserName[1]



(This post was edited by FishMonger on Mar 5, 2011, 5:39 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Mar 5, 2011, 5:39 AM


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

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