Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

More newbie basic questions re: Perl

DirigoDirigo Member Posts: 4
Howdie!

1. What is the differences between Perl file extensions of .pl and .plx? Any real significance out there in the real world? Is one extension more Unix specific and the other extension, Win32 platform specific?

2. To execute (run, kick off, start) a Perl script or a Perl application on a Win32 platform does one always have to use the command "perl somescript.pl"?

3. Anyone here read and used the "Perl for Windows Application" book (Schwartz I think)? Would it be worth it to buy it? Seems kind of outdated (circa 1997 or so), but might be worth it overall.

I have searched various resources for explicit answers to these questions, but have found none. I can "assume" by inference that one must issue a "perl somescript.pl" command versus, say, just typing in the script name or @somescript, but it has not been explicitly stated in the material that I have browsed.

A lot of the material I read seems to be perl cgi specific (understand why). I'm primarily only interested in first learning how to manipulate and use Perl to my advantage on a Windows platform at this time.

Since Perl is an interpreter I assume the command must be issued. Is Unix Perl version different in terms of execution, i.e., starting a script? In the back of my mind it seems it is, but am not totally sure. Probably have my wires crossed here.

Thanks in advance.




Comments

  • JonathanJonathan Member Posts: 2,914
    Hi,

    : 2. To execute (run, kick off, start) a Perl script or a Perl
    : application on a Win32 platform does one always have to use the
    : command "perl somescript.pl"?
    OK, here's what I know. Under Windows, I believe you have to issue the full "perl somescript.pl" to execute a Perl script.

    I think this is not needed under UNIX/Linux because these operating systems look at the line at the top of the script, e.g.

    #!/usr/bin/perl

    And then know how to interpret the script. It's similar in shell scripts where they put:-

    #!/bin/sh

    Or something like that. Unfortunately, I can't off hand think of a way of making Windows mimic this behaviour.

    Hope this helps some,

    Jonathan


    -------------------------------------------
    Count your downloads:
    http://www.downloadcounter.com/
    And host your site:
    http://www.incrahost.com/
    Don't say I never give you anything... ;-)

  • heeroyuyheeroyuy Member Posts: 125
    [b][red]This message was edited by Moderator at 2002-9-7 7:46:3[/red][/b][hr]
    : Hi,
    :
    : : 2. To execute (run, kick off, start) a Perl script or a Perl
    : : application on a Win32 platform does one always have to use the
    : : command "perl somescript.pl"?
    : OK, here's what I know. Under Windows, I believe you have to issue the full "perl somescript.pl" to execute a Perl script.
    :
    : I think this is not needed under UNIX/Linux because these operating systems look at the line at the top of the script, e.g.
    :
    : #!/usr/bin/perl
    :
    : And then know how to interpret the script. It's similar in shell scripts where they put:-
    :
    : #!/bin/sh
    :
    : Or something like that. Unfortunately, I can't off hand think of a way of making Windows mimic this behaviour.
    :
    : Hope this helps some,
    :
    : Jonathan
    :
    :
    : -------------------------------------------
    : Count your downloads:
    : http://www.downloadcounter.com/
    : And host your site:
    : http://www.incrahost.com/
    : Don't say I never give you anything... ;-)
    :
    :


    Personally, I never use the plx extension. I mostly use .cgi .pl and a few other extensions for my scripts. Overall, perl could care less what extension your scripts have, provided it knows what the devil they wanna do. On *nix systems I have never tried changing the extensions and running a script in the way Jonathan described. I prefer to just remember to use perl in front so I don't start getting confused(I already try and type ls and pwd in a dos prompt :) ). So basicly, extensions don't matter at all as long as you tell perl what to do.
    -----------------------
    "The three principle virtues of a programmer are laziness, impatience, and hubris"



  • fzapperfzapper Member Posts: 7
    [b][red]This message was edited by fzapper at 2002-9-7 18:31:0[/red][/b][hr]
    : 1. What is the differences between Perl file extensions of .pl and .plx? Any real significance out there in the real world? Is one extension more Unix specific and the other extension, Win32 platform specific?

    The only thing a filename extension does is tell which program to use to run the file (that does not apply under UNIX - the #! syntax tells the shell what to do). Different versions of perl may use different extensions. You could associate different extensions with different versions of perl (see below).

    :
    : 2. To execute (run, kick off, start) a Perl script or a Perl application on a Win32 platform does one always have to use the command "perl somescript.pl"?

    Not at all. All you have to do associate the filename extension with the perl.exe command. This can be be done with any win32 OS. ActivePerl does this automatically (and optionally) on installation. In fact, if you add ".PL" to the PATHEXT environment variable you don't even have to type the extension. If you have a file called "test.pl", all you have to do is type "test" from the command line to run it. I'm running w2k. I don't know if other OS's have PATHEXT. To find out how to associate filename extensions for your win OS, go to help under the start menu and look in the index for "associating extensions".


    : 3. Anyone here read and used the "Perl for Windows Application" book (Schwartz I think)? Would it be worth it to buy it? Seems kind of outdated (circa 1997 or so), but might be worth it overall.

    Can't help with this. I just use the Camel Book.




  • Shawn CarterShawn Carter Member Posts: 0

    _____ | http://forcoder.org | free ebooks and video tutorials about / JavaScript, Go, MATLAB, Visual Basic, Visual Basic .NET, Perl, C#, PHP, C, C++, Delphi, Ruby, Scratch, R, Java, PL/SQL, Objective-C, Assembly, Swift, Python Bash, VBScript, ABAP, Transact-SQL, Fortran, SAS, Scala, Prolog, Logo, LabVIEW, Scheme, FoxPro, Awk, Erlang, ML, COBOL, Dart, Clojure, Alice, D, Hack, Ada, F#, Rust, Kotlin, Lua, Julia, Crystal, Lisp, Apex / _

Sign In or Register to comment.