develooper Front page | perl.perl5.porters | Postings from February 2012

autosay

Thread Next
From:
Tom Christiansen
Date:
February 27, 2012 05:23
Subject:
autosay
Message ID:
28806.1330349013@chthon
Is there some reason why say() wasn't made a weak 
keywork the way lock is?  That way, if the user already
had a function by that name, we would not override their
version, but if they didn't, then they'd get Perl's.

In particular, this "error" message:

    $ perl -e 'say "hello there"'
    String found where operator expected at -e line 1, near "say "hello there""
	    (Do you need to predeclare say?)
    syntax error at -e line 1, near "say "hello there""
    Execution of -e aborted due to compilation errors.
    Exit 255

Seems really stupid.  Since it knows what to do, why doesn't
it just do it?

--tom

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About