For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > January 2006 > A "sub" question...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author A "sub" question...
Robert Hicks

2006-01-10, 4:02 am

I have seen this lately in my readings:]


sub _dfv_profile {
return {
'required' => [ qw( fname lname ) ]
};
}


Note the leading underscore in the sub name. What does that mean? Is that
like making it "private"?

Robert


Adriano Ferreira

2006-01-10, 4:02 am

On 12/30/05, Robert Hicks <sigzero@gmail.com> wrote:
> Note the leading underscore in the sub name. What does that mean? Is that
> like making it "private"?


Yes. But as a convention: that means: you sensible reader, don't you
try to rely on this function outside of this immediate realm of code.
But you can cheat as you like - at your risk.
Robert Hicks

2006-01-10, 4:02 am

"Adriano Ferreira" <a.r.ferreira@gmail.com> wrote in message
news:73ddeb6c0512301007x68ef6738sd2e3d59
c639b6abb@mail.gmail.com...
On 12/30/05, Robert Hicks <sigzero@gmail.com> wrote:
> Note the leading underscore in the sub name. What does that mean? Is that
> like making it "private"?


>Yes. But as a convention: that means: you sensible reader, don't you
>try to rely on this function outside of this immediate realm of code.
>But you can cheat as you like - at your risk.


Okay, that is and a easy way to "mark" something.

Thanks for the answer.

Robert


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com