CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
How to use a sub from another file

 



supaafly
stranger

Jul 21, 2001, 8:04 PM

Post #1 of 2 (485 views)
How to use a sub from another file Can't Post

Is there any way to be able to call a sub from another cgi script? Right now i have this (this is just a summary):

#!/usr/bin/perl
print "Content-type: text/html\n\n";
require "test.cgi";
&call_sub;

Here is what the other file has:

#!/usr/bin/perl
print "Content-type; text/html\n\n";
sub call_sub {
print "test!\n";
}

When i have that, the script works, but since there are 2 content headers, it prints one of them out so the user can see it, if i take one out of one of the files it gives me an error 500. Please help. I would appreciate a fast answer, thanks.

----------
Supaafly```


supaafly
stranger

Jul 21, 2001, 10:53 PM

Post #2 of 2 (482 views)
Re: How to use a sub from another file [In reply to] Can't Post

Actually nevermind, i found my problem...

----------
Supaafly```

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives