"Bernie Cosell" <[EMAIL PROTECTED]> writes:
> On 5 Dec 2001, at 18:04, [EMAIL PROTECTED] wrote:
>
>> Piers Cawley wrote:
>> > I think the particular 'creative in the extreme' entry that Andrew was
>> > referring to was my head.pl that printed 10 lines then crashed using:
>> >
>> > #!perl -p
>> > 11..&
>>
>> Yes indeed. When I first saw that I fell off my chair laughing.
>> When I was finally able to pick myself up off the floor, I stared
>> at the error message it produced for a while, then realised I had
>> no idea what it did, how it worked, or even if it was valid Perl or
>> Swahili or whatever, ...
>
> Me, too. Is that actually exploiting a bug in perl? [which is legit,
> of course -- I just seeking some clarification/understanding here].
> It seems that "&<ENDOFFILE>" is interpreted as a subroutine call to
> a subtroutine with no name. I'd have thought that that would get you
> a syntax error (as you do get in almost every other case I tried
> that tried to call an null-named subroutine. Or am I
> misunderstanding [likely] how that works??
It depends on how the -p works. And it's (sort of) documented.
--
Piers
"It is a truth universally acknowledged that a language in
possession of a rich syntax must be in need of a rewrite."
-- Jane Austen?