Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cgi path to method

Status
Not open for further replies.

margamo

Technical User
Joined
Feb 1, 2002
Messages
9
Location
US
Hi,
I have a package called Mark::This and it I have a method called Find_subject. How do I call the method in my cgi script?
Thanks
Margamo
 
assuming "This" is named "This.pm", maybe:
Code:
use Mark::This;
my $foo = Find_subject();

or:

Code:
my $foo = Mark::This::Find_subject();




------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
The first will only work if Mark::This exports that subroutine by default. You'll also need the "use Mark::This;" line for the second.
 
I want to write something like this where it is an OO method
my $foo = Mark::This::Find_subject();
.
.
.

<input type="hidden"name="action"value"
$title->Find_subject($subject)">

Anyway as you can see I am having proglems with this.
 
does your module create $title object?

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
The package is "This" in the Mark folder, the method is Find_subject, I want to call the method.
Margamo
 
does your module create $title object?


------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Yes it does.
Margamo
 
well, I guess we may need to see some code then to see what the problem is. OO programming is not something I do much myself though.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top