Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Perl always reads in 4K chunks and writes in 1K chunks... Loads of IO!

by ChOas (Curate)
on Jan 01, 2006 at 16:48 UTC ( #520261=note: print w/replies, xml ) Need Help??


in reply to Re: Perl always reads in 4K chunks and writes in 1K chunks... Loads of IO!
in thread Perl always reads in 4K chunks and writes in 1K chunks... Loads of IO!

This:

open DF, "test.txt" || die "Can't read 'test.txt': $!\n"

Does not do what you think it does.

The || ties itself to "test.txt", which is always true, and not to the return of the open.

This:
open(DF, "test.txt") || die "Can't read 'test.txt': $!\n"

or:

open DF, "test.txt" or die "Can't read 'test.txt': $!\n"

(or binds less tight than ||)

Would accomplish what you want.


GreetZ!,
    ChOas

print "profeth still\n" if /bird|devil/;

Replies are listed 'Best First'.
Re^3: Perl always reads in 4K chunks and writes in 1K chunks... Loads of IO!
by zebedee (Pilgrim) on Jan 04, 2006 at 02:01 UTC
    Why are you measuring under Windows to see what will happen on Unix?
    If you've only got one machine to play with, why not boot off a LiveCD (like Knoppix) and measure your code (or a key subset) under Linux?
    Might not be the same OS your ISP is using, but closer to Unix than Windows?
    Might make absolutely no difference, but at least you might be a bit closer to comparing apples to apples rather than apples (Unix) to oranges (Windows) ...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://520261]
help
Chatterbox?
[LanX]: xD
[LanX]: .. my boos woke up... ;-)
[Eily]: nice to see I'm not the only one looking like a fool at work
Eily answered a message but made the smiley on his face instead of in the message
[Eily]: when did you become a bishop though? 428 xp that's not too long ago is it?
[Eily]: and congratulations :P
[choroba]: Eily++ # made the smiley on his face instead of in the message
[LanX]: weekend ... and waiting that chacellor choroba finally catches up ;-p

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2017-09-20 15:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (237 votes). Check out past polls.

    Notices?