Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by JohnMG (Beadle)
on Dec 19, 2005 at 18:36 UTC ( #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? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2022-05-21 16:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?