develooper Front page | perl.perl5.porters | Postings from November 2008

'do' won't 'do' if '/'

Thread Next
November 26, 2008 15:49
'do' won't 'do' if '/'
Message ID:
Greetings to All from Au,
Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\ to try and 
standardise on '/' separators.

If I run a test script (t/uni/lower.t) with an unmodified, it 
calls t/uni/, that, in, (when the path separators are 
'\'), the $file is '..\lib\unicore\To\' and the following code 
portion works, with $simple getting a returned table:

sub casetest {
     my ($base, $spec, $func) = @_;
     my $file = File::Spec->catfile(File::Spec->catdir(File::Spec->updir,
						      "lib", "unicore", "To"),
     my $simple = do $file;

If, however, $file is '../lib/unicore/To/' (due to the 
tweak), then the 'do' seems to fail and nothing is returned to the 
$simple var.

Can anyone please advise if this is a bug (i.e 'do' being '\' dependant) 
or where in the code I might start looking for a way to overcome what 
may be a NetWare quirk?

I did try the bugs database but 'do' is a little non-descriptive.

Thanks in advance for any assistance,

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About