The code adds the delimiter to the file between all parameters but to remove and display it on the browser is another story cant do it making a silly mistake somewhere
#!/usr/bin/perl -w use strict; use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser); my $query= new CGI; my $filename= "testfile.txt"; my $value; my $fname; my $lname; my $textarea; $'="|"; sub Writing_to_file { my @input_to_file=@_; open (DAT, ">>$filename") || die ("no file exists"); print DAT join($', @input_to_file), "\n"; close(DAT); } sub display_on_browser { open (DAT, $filename) || die ("no file exists"); my @data_in_the_file=<DAT>; close(DAT); my $data_to_read; print "Content-type:text/html\n\n"; print"<html><head><title>Guestbook</title></head><body>"; foreach $data_to_read(@data_in_the_file) { my @delimiter_to_remove=$data_to_read; @delimiter_to_remove=~s/\$'/\n/g; print "<table border=1><tr><td>@delimiter_to_remove\n< +br></td></tr></table>"; } print "<a href=http://guestbook.ds5403.dedicated.turbo +dns.co.uk/index.html><h1>Back to guestbook</a>"; print "</body></html>"; } $fname=$query->param('name'); $lname=$query->param('name1'); $textarea=$query->param('comments'); Writing_to_file($fname,$lname,$textarea); display_on_browser();
Please advise thanks jinnks

In reply to special variable? by jinnks

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.