in reply to portability!

so does it means that I can write a perl programme and then run it on dec(unix) or sun(unix) or on linux systems.. without modifying the codes at all..

In general, yes. Some modules are system specific (in particular, Win32 systems are pretty different from unix-based systems). And of course, when jumping between systems, you have to worry about the version of perl installed, accessory modules installed, and where everything is installed. But on the whole, with everything installed, you can run scripts without changes on any supported system.

One more thing is that is it when one compiles a programme in perl (by that I mean runs it) why do not we get a executable as once a programme has been compiled it means that it has been converted into machine readable code by the compiler..?

Perl code is interpreted, and run, but a lot of the running is still dynamically determined. There are perl->executable programs out there (I've lost track of the status at the moment), and they work by embedding the perl interpreter into the executable. A compiled C program is very different from a running perl program.

Replies are listed 'Best First'.
RE(2): portability!
by bnanaboy (Beadle) on Oct 14, 2000 at 00:03 UTC
    A compiled C program is very different from a running perl program.

    To try to help clarify your 2nd question a bit more: It is my understanding that, in general, C programs are "compiled" into an executable, whereas Perl scripts are "interpreted" at runtime--each time the script is run (this would not include the executable Perl programs swiftone mentions, I'm assuming). Hence the differing terms, C program and Perl script. Although this adds to the runtime overhead, it makes debugging nicer in Perl since you don't have to re-compile the whole program after every little change. (Please correct me if I'm wrong, though, as I'm still learning Perl and would welcome any chance to improve my understanding)
      C programs are "compiled" into an executable, whereas Perl scripts are "interpreted" at runtime

      Actually, I believe that perl scripts have a sort of "pre-compile" step. This is where BEGIN{} blocks and use statements and other such pre-runtime things are decided. Though this normally happens at the first step of running the program (not true in cases like mod_perl), this step is normally refered to as "compiling"

      As for script versus program, from the perlfaq1:
      Is it a Perl program or a Perl script?

      Larry doesn't really care. He says (half in jest) that "a script is what you give the actors. A program is what you give the audience."

      (More available in the faq)