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

Re: Re: File Input and Output

by marlowe (Beadle)
on Feb 06, 2002 at 02:10 UTC ( #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
Node Status?
node history
Node Type: note [id://143528]
help
Chatterbox?
[choroba]: I can't say "Good morning", getting the "Whoa cowboy"
[marto]: the same thing just happened to me :P
Discipulus our orders office is a crow of idiots...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2017-01-19 10:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (170 votes). Check out past polls.