http://qs321.pair.com?node_id=570120


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.