OK here's my code so far....
#!/usr/bin/perl -w print "Content-type: text/html\n\n"; #Here I am getting the values from #the GET form. foreach $pair (split('&', $form)) { if ($pair =~ /(.*)=(.*)/) { # found key=value; ($key,$value) = ($1,$2); # get key, value. $value =~ s/\+/ /g; # substitute spaces for + signs. $value =~ s/%(..)/pack('c',hex($1))/eg; $inputs{$key} = $value; # Create Associative Array. } } #This next assigns assigns the values to variables $nombre = $inputs{'nombre'}; $encabezado = $inputs{'encabezado'}; $cat = $inputs{'cat'}; #Now I created this rudimentary statements that by seeing #which categ +ory I chose, select which file I am going to #move the link to. if($cat == t){ $catfile = "notitec.html"; } if($cat == a){ $catfile = "notiagro.html"; } if($cat == d){ $catfile = "notideportes.html"; } if($cat == h){ $catfile = "notihogar.html"; } if($cat == r){ $catfile = "notirecrea.html"; } if($cat == s){ $catfile = "notisociales.html"; } #Now I open the current headline and read it to an array #but changing + locally the separator character so I don't #get a straight line of h +tml code { $current = "/var/www/html/notidia.html"; open(DIA, "< $current") or die("Couldn't open $current\n"); local $/ = >; @file_data = <DIA>; close DIA; } #now open the category file and insert the previous data $catnoticia = "/var/www/html/$catfile"; open(NOT, "> $catnews") or die("Couldn't open $catnews\n"); foreach $line (@file_data) { print "$line"; } close NOT; #that's what I got so far. I think I got the idea right but #didn't ex +press it correctly on the code (duh) #If I have some variable names wrong its because I changed #the names +to english or something understandable to you so #you can get a bette +r idea.

In reply to Re: Re: My vacation depends on it by aletz
in thread My vacation depends on it by aletz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.