Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: File Handles Chapter(not homework)

by moritz (Cardinal)
on Aug 02, 2012 at 08:01 UTC ( #984973=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use autodie;
    my $filename = <STDIN>;
    chomp $filename;     # remove trailing newline character
    open my $handle, '>', $filename;
    #                 ^  if you want to write to that file
    
  2. or download this
    use autodie;
    open my $handle, '<', 'yourfile.txt';
    ...
         chomp $line;  # remove trailing newline
         # do something with $line here.
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984973]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2017-06-25 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (564 votes). Check out past polls.