Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

what does its output mean...whats it do?

by dbs (Sexton)
on Jun 23, 2011 at 17:12 UTC ( #911115=perlquestion: print w/replies, xml ) Need Help??

dbs has asked for the wisdom of the Perl Monks concerning the following question:

perl -le 'print prototype "CORE::open"' perl -le 'print prototype "CORE::close''
why is it useful and in what context? thx!

Replies are listed 'Best First'.
Re: what does its output mean...whats it do?
by toolic (Bishop) on Jun 23, 2011 at 17:18 UTC
Re: what does its output mean...whats it do?
by Marshall (Canon) on Jun 23, 2011 at 19:35 UTC
    why is it useful? If you have actually run the commands, you will see yourself that the output is not that useful! If you want to learn how a function is called, you are far better off looking at the man or perldoc pages.

    Function prototypes can be used to mimic a built-in function and allow the omission of parens. When first learning Perl, I though oh, how cool. As it turns out, this isn't cool - its a bad idea. Perl is so loosely typed that you just don't gain much in the way of argument checking. And because the prototype has to be seen before you make a call to that function, you wind up either placing the subs before main, or putting a duplicate prototype definition before main. This is a hassle. Perl is already very loose about allowing the omission of paren's, some would argue too loose! Having to use parens when calling your own functions as opposed to a built-in is no big deal.

    I would recommend that you stay away from prototypes - I think most folks would too.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://911115]
Approved by toolic
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2021-04-23 04:52 GMT
Find Nodes?
    Voting Booth?

    No recent polls found