Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Difference between a perl script & shell script

by JohnMG (Beadle)
on Dec 19, 2005 at 18:36 UTC ( [id://517843]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Difference between a perl script & shell script
in thread Difference between a perl script & shell script

Interesting. Didn't know you could do that. Thanks.

A quick comparison of Perl, Python, and shell interactive modes:

  • Perl -- You type in the whole script, line by line, and you get the output only after all lines have been entered and after you've typed __END__ as the last line. A syntax error will dump you back to the command line.
  • shell -- you always get the output (if there is any) right after each line/command. View $? to see the return value of the last command that was run.
  • Python -- You get the output of statements as you run them, just like the shell. Also, it automatically prints out the value of the expression evaluated on the line you just typed.

IMO, the Python shell is pretty darn interactive. The Perl shell might be nice for one-liners that take up more than one line ;), but it doesn't seem all that interactive to me.

  • Comment on Re^3: Difference between a perl script & shell script

Replies are listed 'Best First'.
Re^4: Difference between a perl script & shell script
by qq (Hermit) on Dec 19, 2005 at 23:33 UTC

    The python interactive environment is definitely nice.

    Term::ShellKit provides something along the same lines. I generally make do with perl -de1.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://517843]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found