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

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

Thread Next
From:
NormW
Date:
November 26, 2008 15:49
Subject:
'do' won't 'do' if '/'
Message ID:
492DE05E.9050201@gknw.net
Greetings to All from Au,
Have a NetWare Perl 5.8.4 and wanted to tweak File\Spec\NW.pm to try and 
standardise on '/' separators.

If I run a test script (t/uni/lower.t) with an unmodified NW.pm, it 
calls t/uni/case.pl, that, in case.pl, (when the path separators are 
'\'), the $file is '..\lib\unicore\To\Lower.pl' 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"),
				   "$base.pl");
     my $simple = do $file;

If, however, $file is '../lib/unicore/To/Lower.pl' (due to the NW.pm 
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,
Norm

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About