On Mon, Dec 1, 2008 at 2:39 PM, Ludwig Isaac Lim <[EMAIL PROTECTED]> wrote:
> Problem:
> Everytime I want to deploy, I need to change the following lines:
> #!C:/Perl/bin/Perl # Windows XP
>
> to
> #!/opt/perl/bin/perl # Unix
>
AFAIK, only *nix systems recognize the shebang line. Whatever you put
on that line shouldn't matter on window$ as it uses file association to
open .pl files, at least that's what I remember from back when I was
programming Perl on window$.
>
> Is there a better way of doing it, short of reformatting my PC to Linux
> (Not allowed)? :)
>
> Question #2:
> Similar to above question, Is there a way of doing the following:
>
>
> BEGIN
> {
> if ( platform is Unix/Linux) {
> push @INC, "....."; # add Unix path to @INC
> elsif (platform is Windows) {
> push @INC< "...."; # add Windows path to @INC
> }
Use $^O and look into the source code of File::Spec for tips. You
should also read `perldoc perlport` on how to write portable Perl
code. If you prefer to read perlport with a web browser, head over to
http://perldoc.perl.org/perlport.html :-)
HTH
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph