[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Is the prototype for CORE::truncate wrong?



G'day p5p,

I found this little oddity today, again while filling in holes in autodie.
Under perl 5.8.8 and 5.10.0:

	perl -le'print prototype("CORE::truncate");'
	$$

Personally, I would have expected '*$', since truncate takes a filehandle or
an expression that resolves to the name of a filehandle as the first argument.

'$$' as a prototype currently causes me deep distress, as I can't override
it with autodie and still use package filehandles:

	use strict;
	use autodie qw(truncate open);

	open(FOO, "+<", "some_file");

	truncate(FOO, 0);
	__END__

	Bareword "FOO" not allowed while "strict subs" in use at...

This makes me cry.

Have I missed anything here?

Many thanks,

	Paul

-- 
Paul Fenwick <pjf@perltraining.com.au> | http://perltraining.com.au/
Director of Training                   | Ph:  +61 3 9354 6001
Perl Training Australia                | Fax: +61 3 9354 2681


Follow-Ups from:
Michael G Schwern <schwern@pobox.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]