Calling Perl from another file

Discussion in 'Programming' started by Tom_e_rock, Jul 11, 2006.

  1. #1
    I've never used perl and am wickedly confused.

    I have this file called

    function.pl

    I put it in CGI bin

    this function automatically creates an RSS feed

    how do i call it?

    I makea new file called feed.xml and what do i type into it?

    thanks
     
    Tom_e_rock, Jul 11, 2006 IP
  2. euphers

    euphers Peon

    Messages:
    56
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It all depends...

    Is it a cgi script? Or is it a stand alone perl script? If it's a cgi script, you need to place the script in your cgi-bin directory, and call it like this, http://www.domain.com/cgi-bin/function.pl.

    However, if it's a perl script that you want to call from a cgi script, then you want to include it in your cgi script, something like this...

    include function.pl;
    Code (markup):
    This is assuming you are calling a function / method within function.pl.

    If function.pl is a script you want to run, then you would need to put a system call in your cgi script, like this...

    system( "perl function.pl" );
    Code (markup):
    Please clarify a little more, and I can provide more details.
     
    euphers, Jul 11, 2006 IP