Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Read entire file from given folder

by holli (Abbot)
on Aug 29, 2006 at 10:03 UTC ( [id://570120]=note: print w/replies, xml ) Need Help??


in reply to Read entire file from given folder

You're reading the $dir from STDIN? My guess is you forgot to get rid of the newline. Try
$dir = <STDIN>; chomp $dir;
And next time, please post the code that does *not* work.


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Read entire file from given folder
by izut (Chaplain) on Aug 29, 2006 at 15:40 UTC

    Can also be written as:

    chomp(my $dir = <STDIN>);

    It's nice because you don't have to write two statements, and it is very clear.

    Igor 'izut' Sutton
    your code, your rules.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-25 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found