From: Paul Brannan Date: 2003-05-03T04:00:19+09:00 Subject: Re: temporary redirection of stdout On Fri, May 02, 2003 at 11:57:55PM +0900, Andrew Walrond wrote: > Paul Brannan wrote: > >This makes sso refer to the same object as $stdout does... > > > > Agreed; they are both references right? Yes. > >... but since $stdout is a hooked variable, this doesn't change the > >object that $stdout refers to; it instead calls dup2() on the underlying > >file descriptor... > > > > Hooked variable? So $stdout isn't a reference after all? It is a reference, but you cannot change what object it is referring to. When you think you are doing assignment, you are actually calling a C function that calls dup2(). > >... so that when you get here, this statement is no different from: > > > > $stdout = $stdout > > Agreed, if $stdout wasn't actually a reference It is a reference, but a special kind of reference. Paul