--- Michael Fowler <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 10, 2001 at 10:19:43AM -0700, Paul wrote:
> >    open THIS, ">&THAT"
> 
> This dups (see man 2 dup) fileno(THAT) and opens it with the
> filehandle THIS.  The THIS and THAT filehandles now refer to the same
> file descriptor, and thus the same underlying file.

But do they get seperate buffers?

> >    *THIS = *THAT
> 
> This aliases all symbols named THIS to THAT.  This means \$THIS eq
> \$THAT, \%THIS eq \%THAT, \@THIS eq \@THAT, etc. (yes, I meant to
> take the references to these values, in order to indicate they are
> aliases, different names for the same values) and the filehandles
> THIS and THAT go to the same file.

But in this case, it's not just that they go to the same file --
they're literally using the same "file structure pointer", to use the C
lingo, aren't they?

> > Doesn anybody know the difference?
> > Especially if you use STDERR and STDOUT instead of THIS and THAT?
> 
> The primary difference is that "*THIS = *THAT" are only visible
> from Perl, they (for reasons that should be obvious if you think
> about it) don't propagate to any external processes.  Meaning, if
> you want to redirect STDERR and STDOUT for a subprocess you have to
> use the dup, or the fdopen (<&=fd), form of open, or equivalent.

whoa.... are you sure about that?
I could swear I've used aliasing to redirect subprocesses....


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to