At 03:27 PM 6/27/01 -0700, Paul wrote:
>--- "Randal L. Schwartz" <[EMAIL PROTECTED]> wrote:
> > >>>>> "Silvio" == Silvio Luis Leite Santana <[EMAIL PROTECTED]>
> > writes:
> > Silvio> What would +>> do? the same as +< ? the camel-book
> > Silvio> says nothing, as far I've read.
> >
> > No. there's always a primary mode for the open, and that isn't
> > affected by the +. For <, the file must exist. For >>, every write
> > is at the end of file, for >, the file is truncated. The "+" merely
> > means that once the file is opened, both reading and writing are
> > possible on the same handle.
>
>Though on our machine (if I remember correctly), it won't let you write
>to anywhere but the end of the file, since it's in append mode, even if
>you seek to the beginning before you write. You can read from wherever
>you like, but writes are always reset to the end of the file.
>
>I thought it was odd, but I've seen crazier specs. =o)
It's handy for ensuring that a file exists:
open TOUCH, "+>>$FILE" or die "open $FILE: $!\n";
close TOUCH;
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com