Sponsored Content
Full Discussion: perl limitations vs. bash?
Top Forums Shell Programming and Scripting perl limitations vs. bash? Post 302420856 by deindorfer on Wednesday 12th of May 2010 05:41:07 PM
Old 05-12-2010
Use Perl;

Quote:
Originally Posted by unclecameron

1. Is there anything bash will do that perl won't?
Perl can do everything BASH can do a lot faster. Perl can also do many things which BASH cannot, e.g. connect to a legion of RDBMS implementations seemlessly with DBI, and support full OO application development.

Quote:
Originally Posted by unclecameron

2. How steep is the learning curve?
Many feel it is quite sharp. This is a good place to start: Amazon.com: Learning Perl, 5th Edition (9780596520106): Randal Schwartz, Tom Phoenix, brian d foy: Books


Quote:
Originally Posted by unclecameron

3. If perl's more powerful, why?
1. Perl's has stronger standard data types, excellent support for references and complex data structures, a rich set of built-in functions and superb support for regular expressions.

2. Perl is much faster than BASH ( but then, so is almost everything else. Time how long it takes both to count to 500,000,000, or to compute a factorial ).

3. Perl has unparalleled 3rd party support with external libraries available from CPAN ( the Comprehensive Perl Archive Network ). For Instance, want to encrypt something with the Whirlpool algorithm? Just use Digest::Whirlpool right out of the box. You would not be so lucky in BASH, Python, or PHP. i.e. you'd be implementing the algorithm on your own.

There are 115 modules in the Digest:: space and 409 modules in Crypt:: compare that to PHP PEAR for instance. It's not even close.

Quote:
Originally Posted by unclecameron

4. I've built a small app in python, which seemed nice, isn't there a wider support depth (i.e. example code, # of users)in perl than python?
Compare CPAN to Python's Python Package Index : PyPI and you are likely to find CPAN superior. Python really does not have a community-accepted one-stop-shop for all serious 3rd-Party Modules. PHP Pear is much more serious, but it still fails in comparison to CPAN. Knowledge of the pre-existing code on CPAN can make writting applications in Perl Geometrically faster, even without a framework.

Frameworks are where Perl has been weak ( compare, Python Django, Ruby on Rails, or PHP Zend ), until the advent of Catalyst which is a fully featured Perl MVC framework which is catching on very rapidly.

Combine CPAN and Catalyst, and you are really cooking with propane.

Quote:
Originally Posted by unclecameron

5. I'm building mostly sysadmin scripts, if I were going to do more web integration (think php/javascript) with my code, would perl or python be easier to build, and which would be more powerful, or are they roughly the same?
Don't build sysadmin scripts in Python or PHP. Use Perl, BASH, awk, sed for those things.

For the Web PHP, Perl, and Python all have strengths and weakness. You could write a thesis on this topic and some do. I'll avoid that.

Summary: despite taking a lot of mostly undeserved guff, Perl remains an excellent choice for everything from one-line one-shot filesystem transforms to full-fledged MVC OO Web Applications.

If you can handle a steep learning curve and *symbolism*, e.g. $# instead of LAST_ELEMENT_IN_THE_ARRAY, Perl will serve you well for many years to come.

Hope That Helps.

Last edited by deindorfer; 05-12-2010 at 06:47 PM.. Reason: Removed Duplication
These 2 Users Gave Thanks to deindorfer For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mkdir limitations

What characters can't be used with a mkdir? Any limits on length of name? Thank you, Randy M. Zeitman http://www.StoneRoseDesign.com (12 Replies)
Discussion started by: flignar
12 Replies

2. UNIX for Dummies Questions & Answers

Unix Sort - Limitations

Hi All, I want to sort a flat file which will contain millions of records based on a key/field. For this I want to use unix sort command and before that I want to make sure that unix sort command has any file size limitations. And also please let me know whether I have to change any... (2 Replies)
Discussion started by: chprvkmr
2 Replies

3. AIX

SORT Command Limitations

Hi every body, On AIX 4.3.3 what is the maximum file size that can be used with sort command? (0 Replies)
Discussion started by: aldowsary
0 Replies

4. UNIX for Dummies Questions & Answers

csplit limitations

I am trying to use the csplit file on a file that contains records that have more than 2048 characters on a line. The resultant split file seems to ignore the rest of the line and I lose the data. Is there any way that csplit can handle record lengths greater than 2048? Thanks (0 Replies)
Discussion started by: ravagga
0 Replies

5. UNIX for Dummies Questions & Answers

Password limitations.

I would like to set my minimum password length to on Linux and AIX. However, doing this normally would only make it so newly added users will be affected by this. I would like for when I make this change, it either truncates everyone elses password, or prompts them to change it to 8+ characters.... (2 Replies)
Discussion started by: syndex
2 Replies

6. Shell Programming and Scripting

passing variable from bash to perl from bash script

Hi All, I need to pass a variable to perl script from bash script, where in perl i am using if condition. Here is the cmd what i am using in perl FROM_DATE="06/05/2008" TO_DATE="07/05/2008" "perl -ne ' print if ( $_ >="$FROM_DATE" && $_ <= "$TO_DATE" ) ' filename" filename has... (10 Replies)
Discussion started by: arsidh
10 Replies

7. UNIX and Linux Applications

gnuplot limitations

I'm running a simulation (programmed in C) which makes calls to gnuplot periodically to plot data I have stored. First I open a pipe to gnuplot and set it to multiplot: FILE * pipe = popen("gnuplot", "w"); fprintf(pipe, "set multiplot\n"); fflush(pipe); (this pipe stays open until the... (0 Replies)
Discussion started by: sedavidw
0 Replies

8. Red Hat

Eth0 Limitations

Hi, I have noticed some performance issues on my RHEL5 server but the memory and CPU utilization on the box is fine. I have a 1G full duplexed eth0 card and I am suspicious that this may be causing the problem. My eth0 settings are as follows: Settings for eth0: Supported ports: ... (12 Replies)
Discussion started by: Duffs22
12 Replies

9. Solaris

Solaris limitations

Hi, I recently started working with Solaris, and what I noticed is that a lot of commands I used to regularly use don't work, like sed -i and grep -r. I have found work arounds for these problems though but it's a pain in the ass. I'm just wondering why they decided not to include these handy... (4 Replies)
Discussion started by: Subbeh
4 Replies

10. Linux

Linux partitions and limitations

In recently reading an article on linux basics before I embark and my personal installation project I came across this passage - IDE drives have three types of partition: primary, logical, and extended. The partition table is located in the master boot record (MBR) of a disk. The MBR is the... (12 Replies)
Discussion started by: Synchlavier
12 Replies
All times are GMT -4. The time now is 03:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy