Perl functions

Discussion in 'Perl Misc' started by Deepan - M.Sc(SE) - 03MW06, Mar 6, 2008.

  1. 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
    Deepan - M.Sc(SE) - 03MW06, Mar 6, 2008
    #1
    1. Advertising

  2. Deepan - M.Sc(SE) - 03MW06

    david Guest

    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" <>
    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
    david, Mar 6, 2008
    #2
    1. Advertising

  3. Deepan - M.Sc(SE) - 03MW06

    Guest

    "Deepan - M.Sc(SE) - 03MW06" <> 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.
    , Mar 6, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,766
  2. Xiangliang Meng
    Replies:
    1
    Views:
    1,576
    Victor Bazarov
    Jun 21, 2004
  3. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Jan 23, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    286
    PerlFAQ Server
    Jan 23, 2011
  4. PerlFAQ Server
    Replies:
    0
    Views:
    652
    PerlFAQ Server
    Feb 3, 2011
  5. PerlFAQ Server

    FAQ 1.4 What are Perl 4, Perl 5, or Perl 6?

    PerlFAQ Server, Feb 27, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    276
    PerlFAQ Server
    Feb 27, 2011
Loading...

Share This Page