BUU has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Anyone know how to get cmd line perl?
by Rex(Wrecks) (Curate) on Apr 18, 2002 at 22:15 UTC
    Hmmm, the above answer does it *nix, however it looks like you are doing it with Windows.

    If you just associate the .pl file extension with perl.exe it should work just fine.

    Explorer-->Tools-->Folder Options-->File Types and then add a new one.

    Update: BTW ActiveState Perl will do this by default on install.

    "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!
      Of course you'd have to make some sort of allowance for command-line args, like -w or -T or -c ..
        With ActiveState Perl the perl interpreter will pull the -T -w -etc out of the #!/usr/bin/perl -w -T -etc line for you! So, no you don't really need to make any allowances.

        "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!
Re: Anyone know how to get cmd line perl?
by seattlejohn (Deacon) on Apr 18, 2002 at 22:36 UTC
    It sounds like you are running on a Windows system... if so, under Windows NT-ish systems (including 2000 and XP), you can do this:
    set pathext=%pathext%;.pl
    assoc .pl=perl

    The first line tells Windows to consider .pl an executable extension like .exe, .bat, and so on. (In fact if you look at the value of the pathext environment variable before modifying it you'll see precisely those extensions and a few more.)

    The second line makes sure that the .pl extension is associated with perl (which it probably already is if you're using ActiveState).

    The perl interpreter itself respects command-line arguments used in shebangs, so you can put a statement like this at the beginning of your script:
    #!perl -w

    if you want to enable warnings or set other switches.

    Note that this technique does not work on Windows 95-derived OSes including Windows 98 or ME. I'm not aware of any workaround (though maybe using Cygwin to emulate a more Unix-like system would work?).

Re: Anyone know how to get cmd line perl?
by jmcnamara (Monsignor) on Apr 18, 2002 at 22:26 UTC

    On Windows you can use the pl2bat utility to convert your Perl program into an executable bat file.

    --
    John.

Re: Anyone know how to get cmd line perl?
by CukiMnstr (Deacon) on Apr 18, 2002 at 22:12 UTC
    you could try adding #!/usr/bin/perl -w at the beginning of the script, then chmoding script.pl to give it execution permission, and finally: running it (./script.pl).

    just as with a sh(1) script.

    if you want to run it as script, then name your script 'script'.

    Note: this is for a unix-like OS, so if someone cares to reap the node, go ahead

A reply falls below the community's threshold of quality. You may see it by logging in.
A reply falls below the community's threshold of quality. You may see it by logging in.