- #1
meBigGuy
Gold Member
- 2,325
- 406
I just feel like rambling on, so I will.
Perl gets a bad rap for being hard to read or maintain. But, in reality it is just as easy to read as C or any other language. What is difficult about perl are the regular expressions, which are notoriously cryptic. But, regular expressions are comment-able (embedded comments), but no one bothers.
I find the perl regular expressions to be MUCH more useful than the sed expressions, so I always use grep -P.
Of course, perl can be abused, just as any other language. The namespaces are pretty loose unless you enforce strict (use strict;). Also, people get freaked out about $_
I generally use it for post processing things. For example, write a script to reverse the title and author of a directory full of book titles. Or, use it to analyze histories from online poker playing. And I use the heck out of it at work (digital IC design/synthesis/simulation) for log filtering, file prep, etc. And Tk let's you have a GUI.
But I've done extremely complex things also, like some of my old hacking scripts.
The neat thing about perl is that you can solve your problem anyway you like. The language is flexible enough that nearly any structural approach will work. And the lists and hashes are amazing with easy access to all elements.
And, the things you can do with it on a command line, for example check the version of a tool invoked in a makefile ( I know, its really cryptic and proves everyone's point).
NOTE: DANG, code feature still formats so can't show my codeI use perl, tcl, python, C, C++ and a little java (well, verilog also). I hate tcl (An anal, confusing, language where spaces can be critical and things in comments can break the code (like unbalanced { } and some other tricky constructs).
Also, a 4 hour tcl process can break 3.5 hours in because of a syntax error (not interpreted until it gets there)
Anyway, just my opinion. Very few "real" programmers have need for Perl.
Perl gets a bad rap for being hard to read or maintain. But, in reality it is just as easy to read as C or any other language. What is difficult about perl are the regular expressions, which are notoriously cryptic. But, regular expressions are comment-able (embedded comments), but no one bothers.
I find the perl regular expressions to be MUCH more useful than the sed expressions, so I always use grep -P.
Of course, perl can be abused, just as any other language. The namespaces are pretty loose unless you enforce strict (use strict;). Also, people get freaked out about $_
I generally use it for post processing things. For example, write a script to reverse the title and author of a directory full of book titles. Or, use it to analyze histories from online poker playing. And I use the heck out of it at work (digital IC design/synthesis/simulation) for log filtering, file prep, etc. And Tk let's you have a GUI.
But I've done extremely complex things also, like some of my old hacking scripts.
The neat thing about perl is that you can solve your problem anyway you like. The language is flexible enough that nearly any structural approach will work. And the lists and hashes are amazing with easy access to all elements.
And, the things you can do with it on a command line, for example check the version of a tool invoked in a makefile ( I know, its really cryptic and proves everyone's point).
NOTE: DANG, code feature still formats so can't show my codeI use perl, tcl, python, C, C++ and a little java (well, verilog also). I hate tcl (An anal, confusing, language where spaces can be critical and things in comments can break the code (like unbalanced { } and some other tricky constructs).
Also, a 4 hour tcl process can break 3.5 hours in because of a syntax error (not interpreted until it gets there)
Anyway, just my opinion. Very few "real" programmers have need for Perl.
Last edited: