Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 09-19-2004, 06:40 PM   #1
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
Perl include HELP!

Hey,
I'm running a script that gets a header, a body, and a footer and outputs it in a html file. The header and footer is the same for all but the body changes for each.

Each body is a perl search script and is different for all categories.
What I need is to know the code how to call and RUN a perl script from inside the other perl script and output that in the output file.

Can anyone help me out?

Thanks,
Jon
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-19-2004, 06:56 PM   #2
DimeStoreNovel
Registered User
 
Join Date: Sep 2004
Posts: 151
i have no clue

bump

help this guy will ya !!!!!!!!!!!!!!!!!!!!!!
DimeStoreNovel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-19-2004, 07:01 PM   #3
TDJ
Confirmed User
 
Join Date: Nov 2003
Location: Ontario, CA
Posts: 146
You can do this either of two ways. First way is to make the search program a package. Or, since you're talking about the search program just being a program unto itself, assuming it outputs via PRINT commands to STDOUT, you do:

my $searchresults = `/path/to/searchprogram.pl`;

print $header;
print $searchresults;
print $footer;

Anyways, that's the idea. I'd explain the package thing, but its a bit more complicated.

TDJ
TDJ is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-19-2004, 07:14 PM   #4
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
tried that but all it's doing is printing the path, it doesnt actually open the file. And the main part of my problem is not the fact that the file doesnt open.

I can open the file no problem but that is whats wrong. It is only outputting the code of the cgi script into the new html page.

What i need is for it to open while running the script so only the results are outputted to the final html file, not the code.

Anyone have any idea?

Thanks,
Jon
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-19-2004, 07:17 PM   #5
TDJ
Confirmed User
 
Join Date: Nov 2003
Location: Ontario, CA
Posts: 146
you're using the wrong sign. One means system execute, the other means string of characters.

You want ` not ' - there is a big distinction. Its the one with the tilde on it.

Also, make sure the search script is executable:

chmod +x searchscript.pl
TDJ is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-19-2004, 07:35 PM   #6
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
ok got it to work, only problem now is that my counter doesnt seem to work well.

I need to have a </tr><tr> at the end of every 6 results.

When I ask to print $count, all the numbers come out correctly but when i do this:

if (int($thecount/6))

everything over 6 will have the </tr><tr>.

Any idea on this one?

Thanks,
Jon
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-19-2004, 08:54 PM   #7
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
Well I was able to get it to work perfectly for one but I have 227 pages to get done. So now it looks like the script is timing out or something and its not creating anything. Heres what I have:

$body1 = `$pathof/search1.pl`;

$body2 = `$pathof/search2.pl`;

$body3 = `$pathof/search3.pl`;

down to 227, then I have this:

open(PAGE,">$pathoff/search1.html") or die "Writing Failed\n";
print PAGE "$html $body1 $htmlll\n";
close(PAGE);

open(PAGE,">$pathoff/search2.html") or die "Writing Failed\n";
print PAGE "$html $body2 $htmlll\n";
close(PAGE);

open(PAGE,">$pathoff/search3.html") or die "Writing Failed\n";
print PAGE "$html $body3 $htmlll\n";
close(PAGE);

Any faster way of getting this done so I dont have to put them all in different scripts?

Thanks,
Jon

By the way, $html and $htmlll are the header and footer but those work properly.
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2004, 05:25 AM   #8
TDJ
Confirmed User
 
Join Date: Nov 2003
Location: Ontario, CA
Posts: 146
Holy shit, you need some help with your programming I think You wasted a lot of time on that one. Watch this instead:

foreach my $num ( 1 .. 227 ) {
my $bodylink = "$pathof/search$num.pl";
my $body = `$bodylink`;
open(PAGE,">$pathoff/search$num.html") or die "blah";
print PAGE "$html $body $htmlll\n";
close(PAGE);
}

This will handle all 227 of them in just a few lines.

note replace haha123 with a left curly bracket.

TDJ is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-20-2004, 07:07 AM   #9
Pornweaver
Confirmed User
 
Join Date: Aug 2004
Posts: 855
What is "Perl"?

Pornweaver is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.