Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Scriptome and Perl One-Liners

by dbwiz (Curate)
on Oct 23, 2005 at 07:59 UTC ( #502301=note: print w/replies, xml ) Need Help??

in reply to Scriptome and Perl One-Liners

Apart from the dubious educational value of one-liners, I don't like this collection at all, for two reasons:

  • It encourages cargo cult programming
  • A great deal of these exampels could be made much easier using a database instead of plain text files. Even a minimalist database such as SQLite would greatly simplify tasks such as "Calculate sum of the nth column of tabular data" or "Calculate sum of a set of columns for each row". I mean, if you need to sum up some values, you need to read all the text anyway, so while you are reading it, it makes sense to export the data into a database, and then get the stats in no time.

Since they are ready-to-use recipes, it would have been more useful to save each case into a well written Perl script, with properly named variables, and using a database when needed.

The way it is now, it will just spread the rumor of Perl being a write-only language.

Replies are listed 'Best First'.
Re^2: Scriptome and Perl One-Liners
by BrowserUk (Patriarch) on Oct 23, 2005 at 12:00 UTC

    Have you ever heard the expression "If you have a hammer, everything looks like a nail"? Or maybe in your case, "If you have a a dirty great big wrench, every nail, screw, thumb-tack and piece of blu-tac looks like it should be replaced with a dirty great big nut'n'bolt :)

    Do you really import flat files into your DB for one-off column sums? You must have an awful lot of once-used, ever-to-be-forgotten junk lying around in DB(s).

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://502301]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2023-09-27 09:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found