Skip Menu |
 

This queue is for tickets about the File-Path CPAN distribution.

Report information
The Basics
Id: 110143
Status: rejected
Priority: 0/
Queue: File-Path

People
Owner: Nobody in particular
Requestors: sftf-misc [...] mail.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: File::Path->make_path strange behavior
Date: Mon, 7 Dec 2015 23:34:24 +0600
To: bug-File-Path [...] rt.cpan.org
From: sftf <sftf-misc [...] mail.ru>
Download (untitled) / with headers
text/plain 1.2k
#perl -M'File::Path' -e 'print $File::Path::VERSION'; 2.08_01 #perl -v This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi (with 89 registered patches, see perl -V for more detail) #uname -a Linux om-b0 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u6 x86_64 GNU/Linux Code below creates directory with name 'File::Path' in current dir. No matter, with or without 'use File::Path qw(make_path);' Show quoted text
--- code start --- #!/usr/bin/perl use File::Path qw(make_path); File::Path->make_path('/tmp/11',{verbose => 1}); # create '/tmp/11' AND './File::Path' --- code end ---
--- output start --- mkdir File::Path mkdir /tmp/11 --- output end --- On Windows and perl v5.20.2 there is similar issue with code below.
--- code start --- #!/usr/bin/perl use File::Path qw(make_path); File::Path->make_path('e:/11',{verbose => 1}); --- code end ---
--- output start --- mkdir File::. mkdir File::.: Invalid argument; The filename, directory name, or volume label syntax is incorrect at D:\f.pl line 3 --- output end --- Code below (calling 'make_path' without 'File::Path->') is ok.
--- code start --- #!/usr/bin/perl use File::Path qw(make_path); make_path('/tmp/11',{verbose => 1}); # create '/tmp/11' AND './File::Path' --- code end ---
Download (untitled) / with headers
text/plain 1.7k
On 2015-12-07 12:34:34, sftf-misc@mail.ru wrote: Show quoted text
> #perl -M'File::Path' -e 'print $File::Path::VERSION'; > 2.08_01 > > #perl -v > This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64- > linux-gnu-thread-multi > (with 89 registered patches, see perl -V for more detail) > > #uname -a > Linux om-b0 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u6 x86_64 > GNU/Linux > > Code below creates directory with name 'File::Path' in current dir. > No matter, with or without 'use File::Path qw(make_path);' > --- code start --- > #!/usr/bin/perl > use File::Path qw(make_path); > File::Path->make_path('/tmp/11',{verbose => 1}); # create '/tmp/11' > AND './File::Path' > --- code end --- > > --- output start --- > mkdir File::Path > mkdir /tmp/11 > --- output end --- > > > On Windows and perl v5.20.2 there is similar issue with code below. > --- code start --- > #!/usr/bin/perl > use File::Path qw(make_path); > File::Path->make_path('e:/11',{verbose => 1}); > --- code end --- > > --- output start --- > mkdir File::. > mkdir File::.: Invalid argument; The filename, directory name, or > volume label syntax is incorrect at D:\f.pl line 3 > --- output end --- > > Code below (calling 'make_path' without 'File::Path->') is ok. > --- code start --- > #!/usr/bin/perl > use File::Path qw(make_path); > make_path('/tmp/11',{verbose => 1}); # create '/tmp/11' AND > './File::Path' > --- code end ---
By using the class method style you're really calling make_path() like this: File::Path::make_path('File::Path', '/tmp/11',{verbose => 1}); That is, the package name is used as the first argument in the function/method call. This is standard Perl behavior. Probably you got confused by File::Spec, where functions are really called in this style.
As Slaven indicates, this is not a bug. Closing ticket. Thank you very much. Jim Keenan


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.