Ñåðãåé ×åðíèåíêî wrote:
> Çäðàâñòâóéòå Sisyphus,
>
> Thursday, July 07, 2005, 3:58:43 PM, Âû íàïèñàëè:
>
>
> S> ----- Original Message -----
> S> From: "Ñåðãåé ×åðíèåíêî" <[EMAIL PROTECTED]>
>
>>> But path separator (slash or backclash) as first symbol
>>>of path in require produces an error on win98 and perl5.8.6 b811 of
>>>mine:
>>> Can't locate \includes\28ESP.pl in @INC (@INC contains: C:/Perl/lib
>>> C:/Perl/site/lib .)
>>>
>
>
> S> I won't believe that until it's proven to me :-)
>
> S> First up, which drive contains \includes\28ESP.pl ?
>
> it is d:\perl_projects\ The file 28esp.pl contains only string "1;"
>
> S> Run this script:
>
> S> use warnings;
> S> use Cwd;
> S> print getcwd(), "\n";
> S> require '\\includes\\28ESP.pl';
> S> __END__
>
> Output is:
>
> Can't locate \includes\28ESP.pl in @INC (@INC contains:
> C:/.ActiveState/GUI_Builder
> C:/Perl/lib C:/Perl/site/lib .) at D:\perl_projects\pw_form.pl line 4.
> D:/perl_projects
>
> Not so amazing. Single quotes is not interpreted in perl. And no
> doubt that nobody expect to find directory named '\\includes'.
> Only 'includes'.
Now you're not making any sense at all. \\ will generate \ in either '' or ""
type of quoting. If you don't believe me, try running this in a script:
print '\\some\\path\\', "\n";
and see what it prints.
> I've tried all combinations of quotes (single, double) and
> separators ( / or \ or \\). The way to eliminate the
> error is removing of path separator (any of them) from beginning of
> quoted path or prepending dot to path (resulting in
> '.\\includes\\28ESP.pl'). And I think it's quite natural. Certainly
> can be a lot of meanings, but personally for me: The path to
> current directory is always ended with path separator even if
> modules like Cwd prints curdir path without final separator. Quoted
> path is RELATIVE to curdir. On Linux path like this
> '/includes/28ESP.pl' isn't relative.is
/directory is relative to the drive not the current directory (that's true
on UNIX [except drive is file system on UNIX] as well as Windoze - at least
the NT based Windoze).
./directory would be relative to the current directory.
Try running this:
my $file = '/includes/28ESP.pl'; # relative to drive/FS
open IN, $file or die "open $file: $!";
print <IN>;
close IN;
and
my $file = './includes/28ESP.pl'; # relative to CWD
open IN, $file or die "open $file: $!";
print <IN>;
close IN;
And post results.
--
,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED]
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs