SPUG: Perl Question?

Ben Prew ben.prew at gmail.com
Tue Dec 13 10:22:25 PST 2005


Not that I have any first-hand knowledge in this area, but does't the
previous comment about locking a readonly item hold true for $0 as well?  If
$0 is readonly, wouldn't that also cause the lock to fail?

On 12/13/05, jerry gay <jerry.gay at gmail.com> wrote:
>
> On 12/13/05, jerry gay <jerry.gay at gmail.com> wrote:
> > i have now had the pleasure of experiencing this scenario. not giving
> > up on my favorite hack (above,) and finding a reference in my notes to
> > it's source, i found and modified a similar locking example that works
> > on platforms which don't allow exclusive locks on read-only files.
> >
> > INIT {
> >     open ME => '+<', $0 or die "can't lock";
> >     flock ME => LOCK_EX | LOCK_NB  or exit 1;
> > }
> >
> of course, i forgot to provide the source...
> http://perl.plover.com/yak/flock/
> ~jerry
> _____________________________________________________________
> Seattle Perl Users Group Mailing List
>      POST TO: spug-list at pm.org
> SUBSCRIPTION: http://mail.pm.org/mailman/listinfo/spug-list
>     MEETINGS: 3rd Tuesdays, Location: Amazon.com Pac-Med
>     WEB PAGE: http://seattleperl.org/
>



--
Ben Prew
ben.prew at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/spug-list/attachments/20051213/71e60997/attachment.html


More information about the spug-list mailing list