Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Variable/if question...

by Indomitus (Scribe)
on Nov 04, 2001 at 12:17 UTC ( [id://123152]=note: print w/replies, xml ) Need Help??


in reply to Variable/if question...

You should have a <FILE> in the while() loop. The <FILE> tells perl to loop through your file one line at a time. You can also read the whole file into memory by doing @lines = <FILE> but it's up to you if you want to use that memory.
if($pword==$cpword){ open (FILE, "memberlist.txt"); while(<FILE>){ push @lines,$_; close FILE; } }
UPDATE: You might also want to try checking your open statement to make sure it worked.
open (FILE, "memberlist.txt") || die "Cannot open: $!";
The $! gives you the error message from the open command if it failed.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-03-29 15:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found