in reply to RE: Re: Prettyprint
in thread Prettyprint

mysub{} prints HTML code. Just one of life's mysteries, I guess.

I read that in Perl the parentheses surrounding a subroutine's arguments are completely optional, so it should not matter whether I use parentheses to call subroutines in my prettified code, but it does.

Replies are listed 'Best First'.
RE: RE: RE: Re: Prettyprint
by Adam (Vicar) on Sep 09, 2000 at 00:23 UTC
    Wrong! Those parentheses are not "completely optional!"
    Parentheses are required when clarification is required. For example, if you don't prototype your subroutine, then you must use either an ampersand & or parentheses to tell Perl that its a user defined subroutine. You are probably not using strict or warnings, so the bareword message probably slipped past you unnoticed. I'm not sure why the deparser would drop the parentheses, but it makes sense that you would need them.