May 8, 2007 #1 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
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
May 8, 2007 #2 KevinADC Technical User Joined Jan 21, 2005 Messages 5,070 Location US 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! Upvote 0 Downvote
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!
May 9, 2007 #3 ishnid Programmer Joined Aug 29, 2003 Messages 1,422 Location IE 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. Upvote 0 Downvote
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.
May 9, 2007 Thread starter #4 margamo Technical User Joined Feb 1, 2002 Messages 9 Location US 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. Upvote 0 Downvote
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.
May 9, 2007 #5 KevinADC Technical User Joined Jan 21, 2005 Messages 5,070 Location US does your module create $title object? ------------------------------------------ - Kevin, perl coder unexceptional! Upvote 0 Downvote
does your module create $title object? ------------------------------------------ - Kevin, perl coder unexceptional!
May 10, 2007 Thread starter #6 margamo Technical User Joined Feb 1, 2002 Messages 9 Location US The package is "This" in the Mark folder, the method is Find_subject, I want to call the method. Margamo Upvote 0 Downvote
The package is "This" in the Mark folder, the method is Find_subject, I want to call the method. Margamo
May 10, 2007 #7 KevinADC Technical User Joined Jan 21, 2005 Messages 5,070 Location US does your module create $title object? ------------------------------------------ - Kevin, perl coder unexceptional! Upvote 0 Downvote
does your module create $title object? ------------------------------------------ - Kevin, perl coder unexceptional!
May 11, 2007 Thread starter #8 margamo Technical User Joined Feb 1, 2002 Messages 9 Location US Yes it does. Margamo Upvote 0 Downvote
May 11, 2007 #9 KevinADC Technical User Joined Jan 21, 2005 Messages 5,070 Location US 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! Upvote 0 Downvote
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!