On Mon, Dec 1, 2008 at 2:39 PM, Ludwig Isaac Lim <[EMAIL PROTECTED]> wrote:
>
> Hi:
>
>    Scenario:
>    The deployment server (in Unix) is somewhere in United Stated. Using ssh / 
> vi (no VIM, yuck)
> to edit CGI scripts is inefficient due to the distance not to mention I have 
> to use vi (VIM is
> fine). But the machine in my office  is running on  Windows XP. I already 
> have an Apache / Perl in
> my Windows machine, and I can execute Perl CGI on my Windows Apache Server.
>
>    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
>
>
>    Is there a better way of doing it, short of reformatting my PC to Linux 
> (Not allowed)? :)

Shouldn't you be using the latter shebang in the first place? IIRC
Windows doesn't even look at this (it uses Registry file associations
instead) so you might be just running into a !problem here ;)

But if you really need to have the Windows shebang line above, since
this is more of a deployment problem rather than a development
problem, you might try looking into tools like Archer or even Ruby's
capistrano, that may be able to change the shebang line for you at
deploy time.

>    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
> }

Manipulating @INC directly is usually tricky; you might want to do
`use lib' instead, or local::lib.  Ideally however, you don't want to
jump through these hoops;  you might want to try looking at making
your Windows Perl setup as equivalent to the Unix setup instead.  If
you're a heavy CPAN/CPANPLUS user, you can try Strawberry Perl (which
recently made Slashdot headlines.)

Cheers,

Zak


-- 
Zak B. Elep  ||  http://zakame.spunge.org
[EMAIL PROTECTED]  ||  [EMAIL PROTECTED]  ||  [EMAIL PROTECTED]
1486 7957 454D E529 E4F1  F75E 5787 B1FD FA53 851D
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph

Reply via email to