in reply to reading a changing file

Opening a file every 10 seconds is to a CPU like a fly to a windshield: hardly noticable

Here a short test:

time perl -e 'for (1..100000) { open($f,"<","./t7.pl"); close($f); }' real 0m0.446s user 0m0.229s sys 0m0.201s

So my machine here can open and close a file about 250000 times a seconds

(This node was reparented from a duplicate question node)

Replies are listed 'Best First'.
Re^2: reading a changing file
by slogger (Initiate) on Jun 07, 2011 at 13:57 UTC
    yep - appreciate that, not so much of a performance question/worry as an 'am I doing this the right way' - i.e. is there a better way of reading a dynamically updating file than the way I am doing it here .. being a beginner more of an educational question really.( also I realise timtowodt! - but some prob better than others)

      Lets say, I would do it the same way.