Kiko has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, i'm trying to add something to a Perl script written by someone else that is very hard to understand. Pretty much all i want to do to this script is: If someone doesn't check any of the check boxes then redirect them to the same page. Someone Please help ASAP Thanks, Kiko

Edit by tye to move huge script source

  • Comment on Need to return to same page if nothing is selected

Replies are listed 'Best First'.
Re: Need to return to same page if nothing is selected
by dragonchild (Archbishop) on Oct 12, 2001 at 21:34 UTC
    Just taking a quick glance through the script, it looks exceedingly well-written. The complexity, I think, comes from the fact that it's very long and it doesn't sound like you're very familiar with long-ish scripts. The one major thing I'd do with this script, if handed it, would be to put a bunch of stuff in modules, but that's not a biggie.

    As for redirecting back to the same page ... that's essentially just displaying the same page, right? So, create a function (or use one if already created) called something like &display_page_with_choices() and call it if you have nothing in %params. You make that check as soon as possible.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

(tye)Re: Need to return to same page if nothing is selected
by tye (Sage) on Oct 12, 2001 at 21:41 UTC

    I've moved the huge source listing to be below my signature. This is Kiko's code, but having it in the root node, even if after a <READMORE> tag, would make the thread difficult to read. I also replaced the (valid-looking) username and password at buckaduck's suggestion).

            - tye (but my friends call me "Tye")

    Update: Script removed as requested.

      Hi, I can't thank you and buckaduck enough for not displaying all the important info. I didn't even mean to put the entire script online. I just wanted to put a small section of it up. That's what happens when you do things in a rush and without thinking. If you can please remove the node, if not atleast you removed the important stuff. Thanks a lot dude. -Kiko