Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Array issue

by monktim (Friar)
on Jan 28, 2004 at 20:32 UTC ( #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? | Other CB clients
Other Users?
Others wandering the Monastery: (1)
As of 2022-11-26 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?