Skip Menu |

This queue is for tickets about the Spoon CPAN distribution.

Report information
The Basics
Id: 6704
Status: resolved
Priority: 0/
Queue: Spoon

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

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



Subject: Backslash found where operator expected at (eval 3) line 1, near "Spoon\"
Basically you have the directory separator hardcoded, and that doesn't play well on non-unices. You have this problem in Kwiki also. Solution, replace $name =~ s/^lib\/(.*)\.pm$/$1/; $name =~ s/\//::/g; with $name = substr $name, 4, -3; $name =~ s/[^a-zA-Z0-9_]/::/g;
In case you forgot, this still needs fixing Show quoted text
> Basically you have the directory separator hardcoded, > and that doesn't play well on non-unices. > You have this problem in Kwiki also. > Solution, replace > > $name =~ s/^lib\/(.*)\.pm$/$1/; > $name =~ s/\//::/g; > > with > > $name = substr $name, 4, -3; > $name =~ s/[^a-zA-Z0-9_]/::/g;
This sitll broken in version .20
This is in file t/compile.t
From: barbie [...] missbarbell.co.uk
A better method is the attached patch: --- C:\wip\diffs\spoon\Spoon-0.20/t/compile.t Mon Nov 22 01:36:18 2004 +++ C:\wip\diffs\spoon\Spoon-0.20-barbie/t/compile.t Tue Apr 5 12:02:49 2005 @@ -6,8 +6,8 @@ for (grep {! /CVS/ && ! /(?:~|\.swp)$/} io('lib')->All_Files) { my $name = $_->name; - $name =~ s/^lib\/(.*)\.pm$/$1/; - $name =~ s/\//::/g; + $name =~ s/^lib\W(.*)\.pm$/$1/; + $name =~ s/\W/::/g; eval "require $name; 1"; is($@, '', "Compile $name"); } The problem is that Spoon is assuming this is only being used on *nix machines. I've been attempting to get it to work on Win32, so far this is 1 of 3 failing scripts. :(
--- C:\wip\diffs\spoon\Spoon-0.20/t/compile.t Mon Nov 22 01:36:18 2004 +++ C:\wip\diffs\spoon\Spoon-0.20-barbie/t/compile.t Tue Apr 5 12:02:49 2005 @@ -6,8 +6,8 @@ for (grep {! /CVS/ && ! /(?:~|\.swp)$/} io('lib')->All_Files) { my $name = $_->name; - $name =~ s/^lib\/(.*)\.pm$/$1/; - $name =~ s/\//::/g; + $name =~ s/^lib\W(.*)\.pm$/$1/; + $name =~ s/\W/::/g; eval "require $name; 1"; is($@, '', "Compile $name"); }
Spoon 0.24 now tests and installs cleanly on win32.