Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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;


Comment on Re: Re: File Input and Output
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2014-10-31 07:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (215 votes), past polls