Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with perl in Flash

Status
Not open for further replies.

TulsaJeff

Programmer
Jan 29, 2001
870
US
If any of you know some perl could you look at this and see if you can offer any help. I posted at the perl forum as well but figured you guys might have something to offer as well:


I have the following in a file which writes the date to a .txt file.

#!/usr/local/bin/perl
$datetime = scalar(localtime(time));

print "Content-type: text/html\n\n";
print "1datetime=$datetime\n";

open(F,'>1datetime.txt');
print F "datetime=$datetime";
close(F);


the 1datetime.txt seems to be working and shows the datetime=Fri Mar 1 19:57:18 2002 in WS_FTP view ,however, it will not pull it up online... says server error. I have it chmodded correctly I think. Any ideas as to why it would be doing this or is my code totally wrong? The 1datetime.pl shows fine in both WS_FTP view and online. This is like my first attempt at perl... I know a little VB and just enough javascript and actionscript in Flash to be dangerous so I could be way off base.

I was given some code in the perl forum and I merely tweaked it a little and tried to run it...

I have 7 users, my flash loads the users .pl file when they log in and it writes the date to their .txt file. The man in charge has a user page set up which pulls all these 7 variables from their personal .txt files and is able to see when they logged on last.

There is most likely a better way of doing this with an array or such but this is the best I have come up with considering my limited knowledge of perl.

I took the die part off as well... what is that anyway and do I need to leave it in the code?

I am open for ideas and someone please look at my code and see if it could be causing the server error. Ya' Gotta Love It!
sleepyangelsBW.jpg
 
One thing that may be of help... Not sure.. I wrote a file upload program in PHP and when I chmodd'ed the folder that it was to copy to, I chmodd'ed it with WS_FTP.. For one reason or another WS_FTP chmod's things temporarily.. I would chmod 777 the directory and after I would close WS_FTP it would go back to 744? So try downloading a program like PuTTy and logging into a shell session and chmod'ing it for real.

One other thing.. Check with your ISP - /usr/local/bin/perl is the default directory for perl but my ISP's was different so i got internal server errors when i would try to do things and it pissed me off for a longgg time ;)

Okay I am drunk and going to go passout somewhere.. Hopfully this was of some help.

-Nukoi
 
Nevermind everyone... you can stop all the helpful posts now....;-)

As it turns out it was the server... apparently the cgi-bin was a bit picky and would not allow .txt files in the same folder. I have it working like a top now. Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top