Still problems with my scripts. The only one which is not working is the readit.pl. Here u are the scripts
--THIS IS THE POSTIT.PL---- my $q = new CGI; my $dat = $q->param('data'); my $nom = $q->param('Nom'); my $cog = $q->param('Cognoms'); my $tel = $q->param('Telfix'); my $mob = $q->param('Telmov'); my $ciu = $q->param('Ciutat'); my $pro = $q->param('Provincia'); my $url = $q->param('url'); my $ema = $q->param('Email'); my $hor = $q->param('Horari'); my $art = $q->param('Article'); my $com = $q->param('Comentaris'); my $pvp = $q->param('Preu'); my $string = join('|',$data, $nom, $cog, $ciu, $pro, $art, $pvp, $tel, + $mob, $ema, $url, $com); open (LOG, ">>anuncis.txt") || Error ('open', 'file'); flock (LOG, 2) || Error ('lock', 'file'); print LOG $string, "\n"; close LOG;
======== This one is apparently working, the next one causes me much troubles! It reads all the lines, but aren't print the way I want! How do I manage it??? ======== READIT.PL
use strict; print "Content-type: text/html\n\n"; open LOG, "anuncis.txt" || die "$!"; while (<LOG>) { chomp; my @attributes = split /\|/; for my $attribute (@attributes) { print "Anunci: $attribute, \n"; } } close LOG;

Edit kudra, 2002-06-13 Changed title


In reply to Printing a log file in a CGI script by Kuntent
in thread Reading data from a document.txt by Kuntent

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.