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

File I/O #2

by vroom (His Eminence)
on Nov 19, 1999 at 02:12 UTC ( [id://1010]=note: print w/replies, xml ) Need Help??


in reply to File Input and Output Exercises

# prompts the user for a filename, then logs all input lines # to that file, until a line consisting only of "." is seen. print "What is the name of the keylogging data file? "; my $file = <>; chomp $file; open LOG, "> $file" or die "error writing $file - $!"; while ( $line = <> and $line ne ".\n" ) { print LOG $line; } close LOG;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1010]
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-25 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found