Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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?
[virtualsue]: Aha. My crawler didn't deal properly with hrefs starting with ?
[Discipulus]: 1nickt maybe 'cause you ignore what happened in middleage in real monasteries... ;=)
[Corion]: virtualsue: Aaah, yes, we do use these a lot

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2017-12-13 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (368 votes). Check out past polls.

    Notices?