Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Read entire file from given folder

by holli (Abbot)
on Aug 29, 2006 at 10:03 UTC ( #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
Node Status?
node history
Node Type: note [id://570120]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2021-04-21 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?