Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Array issue

by Ovid (Cardinal)
on Jan 28, 2004 at 20:24 UTC ( [id://324769]=note: print w/replies, xml ) Need Help??


in reply to Array issue

I'd really need more of your code to understand what's happening, but cleaning up your indentation revealed that you were missing a curly brace. Also, you want to push the passwords onto the list. Assigning a password to the list would simply overwrite the last password.

#!/usr/local/bin/perl use strict; use warnings; my @listOfPass; + open(INPUT , "<$input_file" ) or die "couldn't open ($input_file) :$!" +; + my ($section,%passwds); while(<CONFILE>) { chomp; if (/^\[(.*?)\]$/) { $section = $1; next; } if ($section eq 'PASSWORDS') { my ($mkt,$pass) = split; $passwds{$mkt} = $pass; $passwds{$pass} = $mkt; push @listOfPass, $pass; } }#end while loop close (INPUT);

Cheers,
Ovid

New address of my CGI Course.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-22 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found