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

Re: MySQL gone Away

by bronto (Priest)
on Oct 14, 2002 at 16:43 UTC ( #205149=note: print w/ replies, xml ) Need Help??


in reply to MySQL gone Away

Since you already had your MySQL replies, I'll concentrate on your Perl :-)

Without loss of readability, you could compact your code in:

open(FILE,"<".$filename) || die ("Could not open FILE"); $data .= $_ foreach <FILE> ; # for example close(FILE);

Ciao!
--bronto

# Another Perl edition of a song:
# The End, by The Beatles
END {
  $you->take($love) eq $you->make($love) ;
}


Comment on Re: MySQL gone Away
Download Code
Re: Re: MySQL gone Away
by maverick (Curate) on Oct 14, 2002 at 17:08 UTC
    Why iterate, when you can get the whole file in one big slurp?
    { local $/ = undef; open(FILE,"<".$filename) || die ("Could not open: $!"); $data = <FILE>; close(FILE); }

    /\/\averick
    OmG! They killed tilly! You *bleep*!!

      Only for the sake of KISS, nothing more and nothing less.

      Ciao!
      --bronto

      # Another Perl edition of a song:
      # The End, by The Beatles
      END {
        $you->take($love) eq $you->make($love) ;
      }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-10-01 00:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (386 votes), past polls