Perl frustrations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Rip
    Confirmed User
    • Jan 2001
    • 1456

    #1

    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

    I suppose it could be worse and nothing works even after you fix the semi colon

    ------------------
    Make dirty money from your surfers Dirty Gold
    Jack Thumbs TGP Search Engine Driven TGP - Pages LISTED INSTANTLY
    ...
  • Lane
    Will code for food...
    • Apr 2001
    • 8496

    #2
    go with php

    its similar to perl but much easier to catch your errors

    my 2 cents

    ------------------
    Best Free CJ script

    icq: 6757061

    Comment

    • Mark
      Confirmed User
      • Jul 2001
      • 600

      #3
      Yep!

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


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

      Comment

      • Phil21
        Confirmed User
        • May 2001
        • 993

        #4
        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?

        -Phil
        Quality affordable hosting.

        Comment

        • Rip
          Confirmed User
          • Jan 2001
          • 1456

          #5
          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?
          ...

          Comment

          • Phil21
            Confirmed User
            • May 2001
            • 993

            #6
            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
            Quality affordable hosting.

            Comment

            • TheFLY
              So Fucking Banned
              • Jan 2001
              • 11856

              #7
              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...

              Comment

              • TheFLY
                So Fucking Banned
                • Jan 2001
                • 11856

                #8
                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...

                Comment

                • Mark
                  Confirmed User
                  • Jul 2001
                  • 600

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

                  use CGI::Carp qw(fatalsToBrowser);

                  Comment

                  • Susan
                    Confirmed User
                    • Feb 2001
                    • 772

                    #10
                    Rip

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

                    Comment

                    • Rip
                      Confirmed User
                      • Jan 2001
                      • 1456

                      #11
                      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 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
                      ...

                      Comment

                      • Rod
                        Confirmed User
                        • Mar 2001
                        • 1243

                        #12
                        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
                        And not really hard to build decent scripts into it

                        Well, with my book hehe

                        woohoo!

                        Comment

                        Working...