I intend to use a scripting language for gathering reports, most of which will be filtering through command line outputs (The cli application is accessed through Ubuntu Linux). It has been over 10 years that I have written a script in Perl. Back then too, It was nothing earth shattering, just gathering command outputs and filtering stuff through regex. This time though, I need to gather outputs and redirect to an existing excel file, either populate the blank fields or update the existing fields with new data.
Cool. I use Getopt::Long for dealing with command line arguments, and in the past I have used Spreadsheet::ParseExcel for reading Excel spreadsheets. Both modules work very well.
I checked a few articles though, and they all seem to say that 1) Python offers better error handling than Perl 2)Functions are first class citizens in Python, 3)Even for the kind of reporting I am looking for, Python would be a better choice.
OK, those are valid comments .. but it would be nice to see a link to the articles in which these claims are made, so that we can answer the specific issues that are raised. 1. Perl does a pretty good job or error handling (Try::Tiny comes to mind); 2. I'm not sure I understand how a function can be thought of as a second-class citizen; and 3. One of the things that Perl does an excellent job at is reporting. (I think reporting was one of the tasks it was used for, very early on). So at this point, I'd quote wikipedia.org and say, "Citation(s) required".
Ideally, I would like to refresh my Perl knowledge and learn Python too, however, given my current workload, I can pick only one as of now, and may be 4 to 5 months later, I can focus on 1 more language.
If you want the most bang for the buck, I would suggest continuing with the language you already know (Perl) so that you can be as effective as possible at your job. If you have time after work, you could spend an hour here and there learning Python, starting off with simple programs, and perhaps moving on to more complicated tasks, such as parsing command line arguments.
Alex / talexb / Toronto
Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.