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
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 02-09-2005, 01:06 PM   #1
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
Help with perl please

I've built a script that does a bunch of stuff but more importantly overwrites a .pl file.
It gets overwritten properly online and when i download it, i see all the contents as they are supposed to be. So that is not the problem.

My problem is after it has been overwritten, i need to download it and reupload it so it can be run from another script that rebuilds.

It seems to me that the problem is that it gets overwritten in another mode than ascii because only reuploading as ascii fixes it.

If you have any ideas, it would be much appreciated. Perhaps a piece of code to add to my script so it overwrites as ascii and can be run right away.

Thanks
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2005, 01:10 PM   #2
sexdwarf
Confirmed User
 
Join Date: Jan 2005
Posts: 196
hrmmm that doesn't really make any sence, are you always opening the file after the download? if if so with what program?
__________________
ICQ me for any programming projects - Agency quality work for non-agency prices
ICQ 337 028 441
sexdwarf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2005, 01:21 PM   #3
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
nope, only 1 i opened, the other 3 i used for testing, i just downloaded and reuploaded. While doing so, i rebuilt in between to see if it worked and its only after upload that it does..
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2005, 10:16 PM   #4
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
bump..
really need help with this if anyone knows anything.

Thanks
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2005, 11:02 PM   #5
colpanic
Confirmed User
 
Join Date: May 2004
Location: San Diego, CA
Posts: 1,007
Is this on a unix box?

How are you downloading/uploading it?
__________________
I like ducks.
colpanic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-09-2005, 11:07 PM   #6
MrJackMeHoff
Confirmed User
 
Join Date: Mar 2004
Location: LOLLIPOP ISLAND =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-= =-=-=-=-=-=-=-=-=-=-=
Posts: 4,569
it could be your file extention.. Many shitty ftp progs will auto dl in binary based on the extention. Have you tried forcing the ascii dl? Does it look ok if you do?
__________________
MrJackMeHoff is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 02:01 AM   #7
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
Basically, the problem seems to be that a script cannot be run with `` signs if it was last edited by another script. The method of upload is correct because reuploading does solve the problem, all permissions also stay okay so thats no the problem either. Im starting to think if it might be a method of protection on the server itself. Not let a script run if last edited by another script...
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 02:09 AM   #8
Odie
Confirmed User
 
Odie's Avatar
 
Join Date: Apr 2003
Location: The WATER BABY!
Posts: 7,040
promote soucash and u won't have any problems!!
Odie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 05:44 AM   #9
mht
Confirmed User
 
Industry Role:
Join Date: Mar 2003
Posts: 194
More likely to be a permissions problem...

Also is it a script that does anything? If not consider making it a .txt file

Last edited by mht; 02-10-2005 at 05:45 AM..
mht is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 10:20 AM   #10
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
all the .pl's are separate perl codes to retrieve mysql info to display galleries since i have a bunch of categories. My build.cgi script is supposed to open and run that code then put the retrieved galleries themselves into an array, not just the original code. Which is why i use ``. All permissions stay at 777 even after the code has been edited. I've spoken to dozens of people up to now and everyone is as puzzled as me. There just doesn't seem to be any explanation to this. It's not like i can have errors log point me in the right direction, there are no errors. Just that something prevents the sql retrieval scripts to run if last edited by another script.
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 10:38 AM   #11
Fuckin Bill
Confirmed User
 
Join Date: Feb 2003
Posts: 1,020
It's impossible to say anything without seeing the code. You could be escaping characters incorrectly, could be opening files in binary mode rather than in a text mode. Could just have missed a ";" somewhere.

Or it could just plainly be that you're trying to do something that can't be done in perl. Nobody is going to be able to guess at what's wrong without being able to see the actual code.
Fuckin Bill is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 10:48 AM   #12
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
$count = 1;
find(\&edits, $dir);
sub edits() {
if ( $File::Find::name =~ /\.pl$/ ){
@$count = `$path/core/perl/categories/$_`;
$newfile = $_;
$newfile =~ s/\.pl$/\.html/;
$template2 = $template;
$template2 =~ s/$galleries/@$count/;
open(PAGE,">$path2/search/$newfile");
print PAGE $template2;
close(PAGE);
print "<div align=center><font face=verdana size=1>$newfile has been rebuilt ($count/227)</font></div>";
$count++;
}
}

That is the part of the code that is important. There is no syntax error. But i thought binary and ascii were only upload methods. If you have any other clues on that to open file in non binary mode(which is what i think is already happening) please let me know.
archael is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 11:00 AM   #13
Fuckin Bill
Confirmed User
 
Join Date: Feb 2003
Posts: 1,020
$template2 = $template;
$template2 =~ s/$galleries/@$count/;
open(PAGE,">$path2/search/$newfile");

I think your problem is in there. Not positive because I don't know what's happening in the code around it. Try this... Run the script and let it break, then download the new file that's created instead of uploading your new one like you're doing. What's in the file that the server is creating when you download it?
Fuckin Bill is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 11:08 AM   #14
Tom_PM
Porn Meister
 
Industry Role:
Join Date: Feb 2005
Posts: 16,443
open(PAGE,">$path2/search/$newfile") or die "Error: $!";

See what the error is maybe?
__________________
43-922-863 Shut up and play your guitar.
Tom_PM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 11:10 AM   #15
Tom_PM
Porn Meister
 
Industry Role:
Join Date: Feb 2005
Posts: 16,443
And yeah, if it's Unix flavor you shouldnt have to fiddle with binmode.
__________________
43-922-863 Shut up and play your guitar.
Tom_PM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 11:15 AM   #16
Tom_PM
Porn Meister
 
Industry Role:
Join Date: Feb 2005
Posts: 16,443
Maybe it's a permissions issue and you just dont know it.

$oldumask=umask(000);
open(PAGE,">$path2/search/$newfile");
print PAGE $template2;
close(PAGE);
umask($oldumask);
__________________
43-922-863 Shut up and play your guitar.
Tom_PM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-10-2005, 01:57 PM   #17
archael
Registered User
 
Join Date: Jun 2003
Posts: 51
no errors happen in the script, even using die. Also tested chmod'ing it and fails to work as well.
archael 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



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.