Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl functions

Reply
Thread Tools

Perl functions

 
 
Deepan - M.Sc(SE) - 03MW06
Guest
Posts: n/a
 
      03-06-2008
Hi all,
I am using a file abc.pl which is having a function called
get().

I am including this perl file inside a cgi script, and also i am
calling this function inside this script. Now this function residing
inside the perl file abc.pl should now look into the URL of the
calling CGI script and it should return the URL for the cgi script.

Can any of you help me to solve this?

Thanks,
Deepan
 
Reply With Quote
 
 
 
 
david
Guest
Posts: n/a
 
      03-06-2008
Hi,

You need to make a package
something like this

abc.pm
package abc;
use strict;
use warnings;

sub get {
}

and then in your script;

use abc;
..
..
..
..
abc::get(blablabla);

I did not really understand what you want to make but maybe the module
CGI has s function which performs what you need.

Best regards,
David
On Mar 6, 3:31 pm, "Deepan - M.Sc(SE) - 03MW06" <(E-Mail Removed)>
wrote:
> Hi all,
> I am using a file abc.pl which is having a function called
> get().
>
> I am including this perl file inside a cgi script, and also i am
> calling this function inside this script. Now this function residing
> inside the perl file abc.pl should now look into the URL of the
> calling CGI script and it should return the URL for the cgi script.
>
> Can any of you help me to solve this?
>
> Thanks,
> Deepan


 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      03-06-2008
"Deepan - M.Sc(SE) - 03MW06" <(E-Mail Removed)> wrote:
> Hi all,
> I am using a file abc.pl which is having a function called
> get().
>
> I am including this perl file inside a cgi script, and also i am
> calling this function inside this script.


What method are you using for doing the including? Shouldn't this be
abc.pm rather than abc.pl?

> Now this function residing
> inside the perl file abc.pl should now look into the URL of the
> calling CGI script


Why? Your CGI script is "in charge". Shouldn't it send abc.pl what it
needs, rather than expecting abc.pl to dig up what it needs on its own? It
seems that you are aiming for the worst of both worlds--you want code
scattered over multiple files, but without having modular designs that
makes the files loosely coupled.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 02-27-2011 11:00 PM
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 02-03-2011 11:00 AM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 01-23-2011 05:00 AM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments