On Sun, Sep 09, 2001 at 12:18:22PM +1000, [EMAIL PROTECTED] wrote:
> The JAPH below is generated from this program:
> open 0;
> $/ = undef;
> $x = <0>;
> close 0;
> $x =~ tr/!-~/#/;
> print $x;
> I noticed this "zero file handle trick" in Acme::Bleach,
> but it does not seem to be mentioned in the docs.
> Does anyone have more information on this trick?
perlfunc:
open FILEHANDLE,EXPR
open FILEHANDLE
Opens the file whose filename is given by EXPR, and associates it with
FILEHANDLE. If FILEHANDLE is an expression, its value is used as the
name of the real filehandle wanted. If EXPR is omitted, the scalar
variable of the same name as the FILEHANDLE contains the filename.
perlvar:
$0
Contains the name of the file containing the Perl script being
executed.
So, open(0) opens the filehandle 0 on the file named in the variable $0,
which happens to be the file that is being executed.
Ronald
- Re: World's Largest JAPH Andrew . Savige
- Re: World's Largest JAPH Matthew Byng-Maddick
- Re: World's Largest JAPH Ian Phillipps
- Testing dots, sorry. Ian Phillipps
- Re: World's Largest JAPH Ronald J Kimball
- Re: World's Largest JAPH Ian Phillipps
- Re: World's Largest JAPH Randal L. Schwartz
- Double dots. Was Re: World'... Ian Phillipps
- Re: World's Largest JAPH Ask Bjoern Hansen
- Re: World's Largest JAPH Andrew . Savige
- Re: World's Largest JAPH Ronald J Kimball
- Re: World's Largest JAPH Andy Bach
- Re: World's Largest JAPH Bart Lateur
- RE: World's Largest JAPH Andrew . Savige
- Re: World's Largest JAPH Newton, Philip
- RE: World's Largest JAPH Andrew . Savige
- Re: World's Largest JAPH Ian Phillipps
- Re: World's Largest JAPH Bart Lateur
- Re: World's Largest JAPH Andrew . Savige
- Re: World's Largest JAPH Ronald J Kimball
- RE: World's Largest JAPH Andrew . Savige
