Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Perl: the Markov chain saw
 
PerlMonks  

Re: DBI recipes

by Abigail-II (Bishop)
on Aug 18, 2003 at 10:46 UTC ( #284537=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: DBI recipes
in thread DBI recipes

Error checking is an idiom in itself.

Is it? If you were to discuss idiom for reading in a file line-by-line, would you present something like:

open my $fh, "/path/to/file"; while (<$fh>) { chomp; ... }

and dismiss the checking of the return value of open "it being an idiom in itself"? Error checking should be part of the idiom, and not something you bolt on later, when you are more experienced.

Abigail
--
Now that you have passed your driving test, let me introduce you to the function of safety belts.


Comment on Re: DBI recipes
Download Code
Re: Re: DBI recipes
by demerphq (Chancellor) on Aug 18, 2003 at 18:11 UTC

    would you present something like:

    Hmm, I guess you would be upset with me if I wrote that as

    @ARGV=qw(/path/to/file); while (<>) { chomp; ... }

    which of late ive taken to doing in quick and dirty scripts? *grin*


    ---
    demerphq

    <Elian> And I do take a kind of perverse pleasure in having an OO assembly language...
      Hmm, I guess you would be upset with me if I wrote that as
      ...
      which of late ive taken to doing in quick and dirty scripts?

      Only if you present that as "Perl idiom" in a tutorial.

      Abigail

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2014-04-23 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (555 votes), past polls