Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: read file into scalar

by tsee (Curate)
on Oct 28, 2006 at 18:46 UTC ( #581101=note: print w/replies, xml ) Need Help??


in reply to read file into scalar

Hi,

perhaps you're doing it just for brevity, but I can't resist pointing out that it's a very bad idea to use flock() with numeric constants (e.g. 1). You should use the Fcntl module and import the flock constants:

use Fcntl qw/:flock/; ... open flock($fh, FLOCK_EX); # or: flock($fh, FLOCK_SH); ...

Aside from being portable, it has the added benefit of being more friendly on the eyes and less demanding to your memory.

Steffen

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://581101]
help
Chatterbox?
[Corion]: For testing I imagine one would want to test a random sampling of such "bad"/"unexpected" requests, while for downloading, one would want to generate them all in order, but not necessarily as a huge list
[Corion]: s/Algorithm:: Permute/Algorithm ::Loops/

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-01-16 15:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (151 votes). Check out past polls.