OK, here are some general pointers:
our own Ovid has written a CGI tutorial guide, check his homenode for the link (follow the link in this paragraph)
Now, some specifics:
What your ifs are doing is done more maintainably with a hash. I like to do this at the top of complex scripts:
my %actions = ( option1 => \&process_option1, option2=>\&processoption2 ); my $option = param('option'); $action{$option}->() or default_action(); exit;
And so forth. That nasty-looking \& thing creates references to subroutines, which are called by the $action{$option} line. Here, what you should do is create a hash whose keys are as you have them, and whose values are the files that each kind of action works on:
my %file_hash = ( a=>'notiagro.html', d=>'notideportes.html' # and so on ); my $catfile = $file_hash{$cat} || 'default value';
I know that doesn't get you everything you need. You have a start on the harder parts, but get this part working first and then come back to those.
For finding the link to extract and replace, you need to think about how your file looks. I can't help you with that with the information I have now, but I've gone on long enough so far. Hope this gets you over a hurdle or two.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In reply to Re: Re: Re: My vacation depends on it
by arturo
in thread My vacation depends on it
by aletz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |