CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Apostrophe in subroutine call

 



robbo
New User

Aug 15, 2007, 11:49 PM

Post #1 of 2 (355 views)
Apostrophe in subroutine call Can't Post

Hi,

I'm trying to understand a bit of opensource perl and I have come across something I have never seen before. When various subroutines are called, they have an apostrophe somewhere in the middle of it, per (see underlined parts of code):

sub HttpInit
{
local($arg, $db, $pw, $headers, $agent) = @_;
defined &Http'Init || do {
unshift(@INC, $HOME);
require "linkhttp.pl";
};
&Http'Init($arg, $db, $pw, $headers, $agent);
}


This one calls itself! Does anyone know what this means or what it does? Examples of this are littered throughout this particular package. Any help is appreciated.
ROBBO


KevinR
Veteran


Aug 16, 2007, 1:37 AM

Post #2 of 2 (354 views)
Re: [robbo] Apostrophe in subroutine call [In reply to] Can't Post

I believe that is an old style of perl syntax. It would be the same as:

&Http::Init

but that would be calling the Init function from the Http package, not main.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives