![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
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..
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Registered User
Join Date: Jun 2003
Posts: 51
|
bump..
really need help with this if anyone knows anything. Thanks |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
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?
__________________
![]() ![]() ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
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...
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Apr 2003
Location: The WATER BABY!
Posts: 7,040
|
promote soucash and u won't have any problems!!
__________________
Odie [email protected] Are you Mobile???? MMACanada ICQ # 166208354 See Who I Am At AdultWhosWho.com! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
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? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
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. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
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. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
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. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |