Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Array issue

by monktim (Friar)
on Jan 28, 2004 at 20:32 UTC ( [id://324776]=note: print w/replies, xml ) Need Help??


in reply to Array issue

use strict; use warnings; my @listOfPass; my ($section,%passwds); while(<DATA>) { chomp; if (/^\[(.*?)\]$/) { $section = $1; next; } elsif ($section eq 'PASSWORDS') { my ($mkt,$pass) = split; push @listOfPass, $pass; } }#end while loop print join(',', @listOfPass); __DATA__ [PASSWORDS] GUY ddd GIRL dfd33 BOY df341
UPDATE I just reread the OP. The passwords need to be in the order that they were received. I modified this code to use the push function like Ovid suggested. I got too trigger happy with my caffeine induced post :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-16 05:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found