develooper Front page | perl.perl5.porters | Postings from April 2003

Re: windows, shortcuts and 'use lib'

Thread Previous | Thread Next
Benjamin Goldberg
April 26, 2003 18:47
Re: windows, shortcuts and 'use lib'
Message ID:
Edward Peschko wrote:
> hey,
> I just noticed that on Windows - at least in the activestate build -
> perl doesn't handle
> use lib 'shortcut.lnk';
> This is very unfortunate for us who want to take our unix environments
> and make them work seamlessly on NT (and need the capability of
> symbolic links and are willing to fake them via shortcuts).
> Anyways, would people be interested in a patch to 'use lib'? I'd rather
> not write another directive, because of the ubiquitousness of 'use lib'
> and the fact that other modules out of my control use it extensively...

A better patch (imho) would be to make the "-l" operator return true for
filenames which end in ".lnk", and hack "readlink" on windows to grock
the format of shortcut files.  Then, one could write:

   use lib readlink('shortcut.lnk');

Which would thus require no alteration of

Or at least it would make the patch to much smaller.

Of course, if such hackery were added, users might become tempted to use
shortcuts as if they really *were* full fledged symbolic links, and try
and open paths like "C:/path/foo.lnk/bar" ... which wouldn't be work,
unless we did lots more hackery... thus, this might not be a good idea.

$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}

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