Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Why should I use perl 5.10?

by mwah (Hermit)
on Nov 30, 2007 at 10:20 UTC ( [id://654077]=note: print w/replies, xml ) Need Help??


in reply to Re: Why should I use perl 5.10?
in thread Why should I use perl 5.10?

Well, it has the say builtin.

and

Admitted, doesn't sound really great,

this is exactly my opinion too, say() doesn't say anything about its use ;-)

Wouldn't even println() have been a better naming choice? (BYMMV) ;-)

... { local $\ = "\n"; ... ... print $foo; ... }

Regards

mwa

Replies are listed 'Best First'.
Re^3: Why should I use perl 5.10?
by moritz (Cardinal) on Nov 30, 2007 at 10:31 UTC
    Wouldn't even println() have been a better naming choice?

    Surely not!

    Perl builtins tend to be one word that can (syntactically) be read as plain English, with a few exceptions that come from POSIX system calls (like gethostbyname)

    And println is too long, compared to say ;-)

    The word say suggests some I/O similar to print, which in fact it is. The exact semantics are not obvious, but they aren't hard to learn.

      And println is too long, compared to say ;-)

      I personally believe that this is serious enough not to warrant a ;-) since the keyword is huffmanization. IME I tend to print ... "\n" just as often or more than in "\n"-less form so in oneliners and minimal example scripts I tend to use -l quite a lot. But that is bad and risky in that as sometimes it pops up, it can interact with modules that do actual prints. And module authors probably should not be concerned with setting local $\ accordingly. So for all these reasons and for the others that have been said here thus far, however simple it is say() is welcome, and a blessing!

        And module authors probably should not be concerned with setting local $\ accordingly.

        They are exactly the people who should be concerned with it. They are making assumptions about the environment in which they will run, which is not theirs to dictate.

        But overall, I welcome say.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: Why should I use perl 5.10?
by Anonymous Monk on Dec 01, 2007 at 02:16 UTC

    I don't understand why we didn't just use puts(). NIH?

      That's easy: because puts is a stupid name. Why continue the confusion that C has already creatd?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://654077]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-19 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found