Fw: Treating filehandles like strings
[email protected] ("Michael Mathews") Mon, 7 Aug 2000 18:01:49 -0400
| Newsgroups | perl.perl6.language.io |
|---|---|
| Organization | Oxygen Media, Inc. |
| Message-ID | <[email protected]> |
[fwd from the general language list] Michael Mathews wrote: > > From: "Jon Ericson" <[email protected]> > > This is what the angle brackets do currently, unless I > > misunderstand you. I don't like the no-operator > > syntax you propose, because it hides the file > > operation. I'd rather have a filehandle stringify to > > the filename instead. > > Okay, I see now. Your examples all work and are pretty much what I was > wishing for. Actually I'm very pleased for the new tricks to add to my bag. > Thanks!! > > > > > <FH> =~ s/pattern/replacement/; # dies in current Perl > > > > Perhaps this behaviour should be changed for files > > opened '+<'? > > > > Hmmm, this one seems *very* powerful, maybe a little dangerous? I'm not > sure I would want to be able to alter the contents of a saved file, in-place > like that so easily. > > --Michael