Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Use Mkdir to create dir from list

by rovf (Priest)
on Jun 19, 2012 at 08:31 UTC ( #976982=note: print w/ replies, xml ) Need Help??

in reply to Use Mkdir to create dir from list



use File::Path qw(make_path); make_path(map {chomp; $_} <$GSR_fh>);
If you need error handling, have a look at File::Path.

Ronald Fischer <>

Comment on Re: Use Mkdir to create dir from list
Download Code
Replies are listed 'Best First'.
Re^2: Use Mkdir to create dir from list
by Tux (Monsignor) on Jun 20, 2012 at 13:25 UTC

    Huh? chomp does NOT return $_! You will need map { chomp; $_ }

    $ perl -MDP -E'@_=map{$_."\n"}1..5;DDumper[@_]' [ '1 ', '2 ', '3 ', '4 ', '5 ' ] $ perl -MDP -E'@_=map{$_."\n"}1..5;DDumper[map{chomp}@_]' [ 1, 1, 1, 1, 1 ] $ perl -MDP -E'@_=map{$_."\n"}1..5;DDumper[map{chomp;$_}@_]' [ 1, 2, 3, 4, 5 ]

    Enjoy, Have FUN! H.Merijn
      Of course you are right! Silly mistake, thanks for pointing it out. I will update my node.

      Ronald Fischer <>
Re^2: Use Mkdir to create dir from list
by GregorySRobinson (Initiate) on Jun 20, 2012 at 13:10 UTC

    I spent time looking at and testing your solution. As presented and as I interpreted the solution I remains stumped as to how to preform objective. I posted the revised code.Oh, and thank you.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2015-12-01 03:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (791 votes), past polls