Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Why can't you do something like this?
opendir(DIR,"/etc")|| die "ERROR_MSG:$!\n"; foo(*DIR); sub foo{ my (*ETC) = $_[0]; while(<ETC>){ print; } }
why does it have to be local?

Replies are listed 'Best First'.
Re: typeglobs
by tachyon (Chancellor) on Sep 03, 2001 at 23:48 UTC

    Have a look at this Seven useful uses for Local by Mark Jason Dominus for an explanation.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Thanks I read it and it cleared up my confusion :) Also introduced me to an interesting site. -thanks again