Re: Perl as a second language

[email protected] (Bruce Alderson) Wed, 03 Oct 2007 10:11:10 -0700
Newsgroups perl.advocacy
Message-ID <[email protected]>
> So I would really like to hear what does a Java/C*/etc..programmer with several
> years of experience need to do to improve his working conditions that he would
> be better off doing with Perl after just 1 day of training...
>
>
>   
Hi,

I've been developing systems stuff in C/C++ and web/GUI stuff (in every 
other common language) since the mid 80s.  I've only used Perl as a 
primary language on a few projects, which were mostly ancillary GUIs, 
reports, or report readers to larger projects.  But I do use Perl in 
nearly every project for a wide variety of systems tasks.  It's a 
powerful shell language on Unix, Linux, Windows (w/Cygwin or 
ActiveState), and Mac, so it has fit nearly any requirement for 
portability that I've encountered, and the language is well suited for 
shell and textual tasks. 

Some of the things I've used Perl for:

1. Protocol test drivers (serial/TCP/UDP).  Perl's rich network 
libraries (and Linux's /dev-like systems) make it simple to write 
protocol drivers for testing device drivers.  Example:

    text file -> perl test script -> tcp/ip -> actual C driver

2.  Unit/system test tools.  Perl handles shell stuff well, and is a 
quick language to put together robust data-driven unit and system 
testing tools.  Combine the XS helper libraries (like the inline C 
module) and your own shared libraries, and you have a really simple way 
of testing code in an automated way.

3. Code generation.  Perl has libraries for parsing nearly any format 
(and with regex builtins, adding your own is trivial), so I tend to use 
little languages to generate C/C++ (or other) code.  For example, a 
current C++ project has a fairly large SQL schema, which we define in 
plain SQL.  Our simple Perl tools convert that SQL to C++ code and 
constants, text templates, and even Php code.

4. Special CGI bridges.  While I don't use Perl for much of my web work, 
I do find it the perfect tool for API CGIs.  One example is a crash 
reporting CGI we have, which is fed crash reports from C/C++ code, and 
proxies the report to Bugzilla, email, and an internal CRM system.  It's 
also a good language for automating CGI testing, and for the 
implementation of SOAP web APIs.

5. Text and data analysis helper tools.  On several projects I've used 
Perl as a data transformation/filtering tool, to do performance 
analysis, and capacity analysis. 

Hope this helps,

--
http://warpedvisions.org