Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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);


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

Replies are listed 'Best First'.
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); }

    OmG! They killed tilly! You *bleep*!!

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


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://205149]
[Discipulus]: shmem the first time I was in germany I was so smart to learn by heart the address of the hostel: Einbahnstraße..
[Discipulus]: james28909 you are welcome
james28909 doesnt drink much alcohol
james28909 does enjoy blazing up though
james28909 also walks around hunting for his cell phone while using its flashlight function

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2018-05-20 16:17 GMT
Find Nodes?
    Voting Booth?