Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: File Input and Output

by marlowe (Beadle)
on Feb 06, 2002 at 02:10 UTC ( [id://143528]=note: print w/replies, xml ) Need Help??


in reply to Re: File Input and Output
in thread File Input and Output

try this. #!/usr/bin/perl -w use strict; my $output_file = "out.txt"; my $user_input = ""; my $quit_code = "quit\n"; open(OUTPUT, ">$output_file) || die "Unable to open $output_file for writing: $!\n"; while ($user_input ne $quit_code) { print "Enter some text: "; $user_input = <STDIN>; print OUTPUT $user_input; } close(OUTPUT) || die "Unable to close $output_file: $!\n;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-19 01:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found