GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Perl frustrations (https://gfy.com/showthread.php?t=35619)

Rip 07-16-2001 06:06 PM

Perl frustrations
 
I dunno how may people here write their own scripts, but if you do -
don't you just hate it when you think up this really great script, you get to work on a coding frenzy only to find the script isn't working
2 hours later after 4 diet cokes and two or three debugging headaches you go for a walk

come back, sratch your butt, look at the code, and a light bulb appears above your head... you scroll up the page, examine the variables thinking that you have mis-spelled something, only to find an erroneous missing semi colon, you add the semi colon and everything works http://bbs.gofuckyourself.com/board/wink.gif

I suppose it could be worse and nothing works even after you fix the semi colon http://bbs.gofuckyourself.com/board/wink.gif

------------------
Make dirty money from your surfers Dirty Gold
Jack Thumbs TGP Search Engine Driven TGP - Pages LISTED INSTANTLY

Lane 07-16-2001 06:12 PM

go with php

its similar to perl but much easier to catch your errors

my 2 cents http://bbs.gofuckyourself.com/board/wink.gif

------------------
Best Free CJ script
http://www.cjultra.com/ver.jpg
icq: 6757061

Mark 07-16-2001 06:53 PM

Yep!

But '-w' and 'use Diagnostics' etc. can help spot those little annoyances..


-------------------------------------------
Start Your Own Adult Search Engine - FREE http://www.pussify.com


Phil21 07-16-2001 07:21 PM

uh.. perl has one of the best error outputs I've ever seen. Try coding C!

A missing semicolon would have been caught by the interpreter and reported as such. You ARE running your non-working scripts on the command line right? http://bbs.gofuckyourself.com/board/wink.gif

-Phil

Rip 07-16-2001 07:30 PM

The problem I run into, is when I expand the script to "write" files to the server, then I run into problems, I have to "test" the script on my server and can't seem to run it on the desktop without a file folder renaming campain

maybe there is a better way to do this?

Phil21 07-16-2001 07:41 PM

Yes and no..

do you have ssh (or telnet) access to your host? If so, you can ssh in, and run the script there. All errors will be dumped to stdout, which is your terminal.

alternatively, print the HTTP header at the VERY top of the script right after your #!/usr/bin/perl line so *most* errors will be output to the web browser. Then comment out that print statement when the script is working.

-Phil

TheFLY 07-17-2001 04:24 AM

Phil!

Yeah man I upload all my Perl code right onto the server and test it there... Even when traffic is running through it! As soon as I upload it, I do a "perl -c file.cgi" -- never tried the -w switch -- maybe it's useful? ;)

Once you get used to coding in Perl (or programming in general) you will usually get your code all right the first time -- and if anything goes wrong, you can usually figure out the problem quickly because most programming errors are easily spotted just like you said -- missing semi-colon, unmatched {'s, and non-escaped HTML quotes and email addresses ;) \" and \@

Besides women, a good beer, or a juicy hamburger, there's nothing more satisfying than coding an entire program in Perl, uploading it, and having it pass the perl -c test the first time w/o errors ;)

hehe

PHP is very cool too but not nearly as powerful as Perl. Use both!

------------------
...from the nectar of the Bone flows all that clicks...

TheFLY 07-17-2001 04:37 AM

In the rare event that the script has no errors, yet it still does not work -- you can also add in code that will email you debug information... what is also fun is finding the email address of your cell phone and having info sent to you that way...

I used to get hourly hit reports to my cell phone before I got tired of watching the stats ;) For example if you are worried about your script crashing while you are away on a trip -- emailing errors to your cell phone could save your ass! (I think I got that idea from the hotmail programmers).

You can also output debug info to a file... Also let's say someone is trying to cheat your script -- you can set up some code to track an individual IP and log all of that person's activities w/o them knowing...

------------------
...from the nectar of the Bone flows all that clicks...

Mark 07-17-2001 05:31 AM

You could also try adding the following somewhere near the top of the script..

use CGI::Carp qw(fatalsToBrowser);


Susan 07-17-2001 06:56 AM

Rip

Build yourself a cheap Linux or FreeBSD box setup sql sendmail and all the stuff you need to develop your scripts offline.

Rip 07-17-2001 05:10 PM

That's a good idea Susan

But I am extremely happy today, since I have my script working, I am sure lots of other people have stuff like this already, but it will save me a great deal of work and time.

It updates, and writes 1,344 headers and footers over 24 domains in a minute or so. For me this means I can update all those little free sites are going to be a lot easier to change and update banners and stuff http://bbs.gofuckyourself.com/board/biggrin.gif I just have to load it on another server, but it works good so that will be no trouble

The biggest problem is that when I make free time, I usually think up something to waste it on pretty quickly

------------------
Make dirty money from your surfers Dirty Gold
Jack Thumbs TGP Search Engine Driven TGP - Pages LISTED INSTANTLY

Rod 07-18-2001 12:12 AM

I think that perl is the best way to make your own script, if there isn't a shitload of traffic running into it...

It's really easy to debug I must say http://bbs.gofuckyourself.com/board/smile.gif
And not really hard to build decent scripts into it http://bbs.gofuckyourself.com/board/smile.gif

Well, with my book hehe http://bbs.gofuckyourself.com/board/smile.gif



All times are GMT -7. The time now is 09:27 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123