You're typing too much
#!/usr/bin/perl -- use strict; use warnings; use Path::Class qw/ dir file /; use Data::Dump qw/ dd pp /; my $goner = dir('temp3k'); my $gonee = dir( $goner, 'ro/sham/bo' ); $gonee->mkpath( { verbose => 1 } ); $gonee->rmtree( { verbose => 1 } ); $gonee->mkpath( { verbose => 0 } ); $goner->rmtree( { verbose => 1 } ); __END__ mkdir temp3k mkdir temp3k\ro mkdir temp3k\ro\sham mkdir temp3k\ro\sham\bo rmdir temp3k\ro\sham\bo rmdir bo rmdir sham rmdir ro rmdir temp3k
I imagine the behaviour you're seeing because dir() is a blessed hash
$ perl -le " use Data::Dump; use Path::Class; dd( dir( ) ); bless({ dirs => ["."], file_spec_class => undef, volume => "" }, "Path +::Class::Dir")
And File::Paths checks to see if its a hash and it is, so its used as \%opt
In reply to Re: Problem when using Path::Class::File with File::Path ( dir()->mkpath(
by Anonymous Monk
in thread Problem when using Path::Class::Dir with File::Path
by kevbot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |