[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Directory separator magic?



At 10.48 +0000 1999.12.15, Bart Lateur wrote:
>Excuse me? On a Mac? Oddly enough, it even seems to be working! Is there
>some kind of '/' to ':' mapping going on behind the scenes that I'm
>unaware of?

Just for do() and require().


>It looks like dirty code to me. The first one should have been:
>
>	require URI::URL;

I guess it doesn't matter much.


>but I can't grasp how the second one can work at all, especially since
>the Mac NEEDS the use of File::Spec.
>
>I guess that this doesn't work:
>
>	$have_File_Spec = do File::Spec;
>
>No it doesn't. Oh well.

No, only use() and require() can take the bareword.


>But what's the exact status on this undocomented (AFAIK) directory
>separator magic?

It works.  :-)  I don't know why, but I suspect it may be related to %INC.

  do 'File/Spec.pm';
  print $INC{'File/Spec.pm'};

Since you should not have a / in a filename or path passed to require,
there shouldn't be a problem.  Although, you very well could have a / in a
path passed to do().  do("Bourque:work/stuff:foo.plx") ...

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org