Bryan Harris wrote:
> > > Is there a way to discover the filename of the current file being read when
> > > using the angle brackets (e.g. while (<>) {} )?
> >
> > Well, as you may know, the <> operator reads from the file names stored
> > in the @ARGV array. The current file name is stored in the $ARGV
> > variable and the current file handle is ARGV. Also, if the $^I variable
> > is defined the current output file handle is ARGVOUT.
>
> Thanks, John and Sudarshan. I have to use <> because I need it to be able
> to read from a pipe (I'm still unclear on how to do that without the <>).
> Thanks again.
Bryan.
Bottom line, <> won't help you!
I can think of ways of piping through ARGV but, really, you don't
want to go there - believe me.
Some points to help you.
- Perl is very good at guessing what you want, but I don't
think reading from a pipe is ever one of its options
- Piping is often a bad way of doing something that Perl
will do much more easily
- There are many, like me, who will enjoy plumbing the depths
of their knowledge in a particular direction which may be of
no use to you
- It's far better to describe your problem to the list than to
ask how to implement your solution. Think "My wife hates me!"
as opposed to "Where do I get Vallium?"
HTH,
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]