lists.zerezo.com



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

***BOGO*** Re: [Mingw-users] perl 5.8?



Quoting Earnie Boyd as he wrote on Thu, 09 Oct
2008 06:32:00 -0400

> Quoting Sisyphus <sisyphus1@xxxxxxxxxxxxxxx>:
> 
> >
> > You can, of course, run any Windows perl (including ActiveState and
> > Strawberry builds) from within the MSYS shell.
> >
> 
> But be aware that the perl scripts would need to contain windows
> paths and not unix paths.

Yes, since a native Windows Perl won't be linked to MSYS' DLL
and so couldn't understand absolute pathnames like /c/bing.bmp
(or however MSYS does it ...it's been a while).

However, it's actually not very common in my experience to have
a true need to hard-code an absolute path in a Perl program.
Doing so may in fact be a sign of bad programming practice more
than anything else, except when it isn't (there are always
exceptions). More commonly a relative pathname will do just
fine.

When people read "Windows path" I am not sure what they are going
to think that means. Unfortunately for those of us who like
things to be done right, many times people have had a grossly
unclear notion of what it means, in fact. They think all sorts
of stuff that isn't true based on myths that the ignorant have
unfortunately repeated to others over and over again.

How many times have we seen something like this in a Perl
program?:
 if ($^O =~ /MSWin/i) { # have to use backslashes on Windows,grr
   $pathname = ".\\MyMess\\goes\\Here";
 } else {
   $pathname = "./MyMess/goes/Here";
 }

 open my($FH), $pathname or
  die "Why doesn't anything ever go easily!?!";

Heh ;-/.  That's a relative path and the condition is completely
unnecessary. All Perls use the canonical forward slash
internally and when the Windows OS gets the request to open()
the pathname with canonical slashes it does not blink an "eye".

Basically, the only Unix-ism that you have to avoid in scripts
run by a native MS Windows Perl under MSYS is "/X/" (the root
directory followed by the Windows drive [volume] letter). That
shouldn't be too hard to do for many programmers.

   Thanks for letting me wax pedantic,
            Soren Andersen

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users