I was rather surprised and then just had to laugh when the first script finished b4 i had time to ALT-TAB to the next window :). I knew file access was fast but thats far out.
peals of laughter at my use of flock also welcome :)
for (1..1000) { print "Next number : ", xCount::next_num(), "\n"; } package xCount; sub next_num { if (open(ON, "+<seqfile")){ flock ON, 2; $ordernum = <ON>; $ordernum += 1; seek ON, 0, 0; print ON $ordernum; flock ON, 8; close(ON); } return $ordernum; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: flock - lordy me....
by c-era (Curate) on Jan 16, 2001 at 19:08 UTC | |
by tilly (Archbishop) on Jan 16, 2001 at 22:41 UTC | |
by tye (Sage) on Jan 16, 2001 at 23:02 UTC | |
by tilly (Archbishop) on Jan 17, 2001 at 00:12 UTC | |
by tye (Sage) on Jan 17, 2001 at 00:45 UTC | |
| |
|
Re: flock - lordy me....
by turnstep (Parson) on Jan 17, 2001 at 03:32 UTC | |
|
Re: flock - lordy me....
by AgentM (Curate) on Jan 16, 2001 at 21:21 UTC | |
by merlyn (Sage) on Jan 16, 2001 at 22:54 UTC | |
by AgentM (Curate) on Jan 16, 2001 at 23:04 UTC | |
by merlyn (Sage) on Jan 16, 2001 at 23:11 UTC | |
by AgentM (Curate) on Jan 16, 2001 at 23:28 UTC |