[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: change ni * protos
On Fri, Jan 21, 2000 at 05:01:07PM -0800, Gurusamy Sarathy wrote:
> On Fri, 21 Jan 2000 16:48:26 MST, Tom Christiansen wrote:
> >Could you please remind me why you intentionally broke
> >
> > use strict;
> > sub fn(*) { my $fh = shift; print $fh "Boo!\n" }
> > *SNEAK = *STDOUT;
> > fn(SNEAK);
>
> Did you see:
>
> http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-04/msg00312.html
>
> The long and the short of it is that the current semantics make it
> possible to override builtins like open() and require(), which need to
> see simple scalar values as they were passed, not as typeglobs. When
> you see the "*" prototype, think "any scalar including bareword" rather
> than "typeglob".
How about allowing
sub fn(\*);
to force a ref to a typeglob for those that want it?
Seems reasonably consistent with the other backwacked prototypes.
Tim.
- Follow-Ups from:
-
Gurusamy Sarathy <gsar@ActiveState.com>
- References to:
-
Tom Christiansen <tchrist@chthon.perl.com>
Gurusamy Sarathy <gsar@ActiveState.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]