Closed samuelckaufman closed 7 years ago
skaufman@yibberdibber:~ $ perl -MFile::Spec::Win32 -e 'warn File::Spec::Win32->VERSION'
3.47 at -e line 1.
adding use overload 'eq' => '_overload_stringify'; to IO::All fixes it, haarg suggested adding a fallback to _overload_stringify.
Would'nt it be better to add a cmp overload?
@xlat as long as it fixes the 'Operation "eq": no method found' I'm happy. The answer to your question as far as I'm concerned is if overloading cmp overloads eq by proxy then sure, that would be better.
@ediblenergy yes, it looks like to be the case if you take a look at the first test I have added to overload.t ;)
Ah cool now I see it, looks good to me :) I'll ping in #io-all because github notifications are terrible.
I'll try to get a fix released for this soonish; thanks for the research all!
I have this issue as well on Windows using ->relative($path)
.
perl -MCarp::Always -E "use IO::All; my $p = io->dir('C:\Inetpub\log');
my $f = $p->file('06-30-2017.txt'); say $f->relative($p)"
Operation "eq": no method found,
left argument in overloaded package IO::All::Dir,
right argument has no overloaded magic at C:/Inetpub/lynx/strawberry/perl/site/lib/File/Spec/Win32.pm line 186.
File::Spec::Win32::canonpath("File::Spec", IO::All::Dir=GLOB(0x3faf3c)) called at C:/Inetpub/lynx/strawberry/perl/site/lib/File/Spec/Unix.pm line 414
File::Spec::Unix::abs2rel("File::Spec", "..\\..\\log\\06-30-2017.txt", IO::All::Dir=GLOB(0x3faf3c)) called at C:/Inetpub/lynx/strawberry/perl/site/lib/IO/All/Filesys.pm line 77
IO::All::Filesys::relative(IO::All::File=GLOB(0x228a354), IO::All::Dir=GLOB(0x3faf3c)) called at -e line 1
Wes told me he'd write a test; I'll incorporate one of the fixes above, have him ensure that the test passes on win32 (and ofc I'll run on linux) and then I'll cut a rel.
This is resolved in the 0.87 release and can be closed.
Also see: http://www.cpantesters.org/cpan/report/608781a5-9264-1014-8cee-01022b825c07 For when that bug shows up from another package.
Googling around I found: http://www.nntp.perl.org/group/perl.beginners/2005/04/msg74371.html Which somewhat suggests that overloading "" is not enough, you may have to overload 'eq' as well. That seems odd to me, but maybe.