[10527] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4119 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 31 10:07:17 1998

Date: Sat, 31 Oct 98 07:01:29 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 31 Oct 1998     Volume: 8 Number: 4119

Today's topics:
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
        Why is junk being appended to my saved data file? <harris@gc.maricopa.edu>
    Re: Why is junk being appended to my saved data file? (David Alan Black)
    Re: Why is junk being appended to my saved data file? (Sam Holden)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71cdru$55$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71clmr$br$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71cf62$6o$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71c9sn$1a$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71ckuj$bo$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71cfr2$6q$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71cb6p$1d$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71clt6$bs$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71cd6v$3b$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71cm7s$df$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71ceh1$56$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71cbro$32$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71ccht$3a$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71ckiv$bm$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71ckgd$bj$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: Fri, 30 Oct 1998 12:03:55 -0800
From: "IFN" <harris@gc.maricopa.edu>
Subject: Why is junk being appended to my saved data file?
Message-Id: <71cahp$1c$1@news.internet-frontier.net>

Hi all,
Whenever I write a data file back, it appends a bunch of junk to the end of
the file.  Below I've listed the small amount of code it takes to duplicate
the problem along with it's input file and output file.


The file before running the program looks like this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


The output of this program is this;

Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
 Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
 = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


Why are all these characters being appended to the file?  And more
importantly, how do I get rid of it?  I'm up against the wall now. I finally
boiled it down to its simplest form.  This small length of code creates the
bad saved file;

#!/usr/local/bin/perl
require "./Library/cgi-lib.pl";
$file = "./Lists/test.list.txt";
print &PrintHeader;
print &HtmlTop ("Done");
print &HtmlBot;
open (INFILE, $file) || &CgiDie ("Cannot open $file");
 @names = <INFILE>;
close (<INFILE>);
open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
 print OUTFILE "@names";
close (<OUTFILE>); #close file...

Any help would be greatly appreciated.

Thanks
Mark Harris





------------------------------

Date: 31 Oct 1998 09:40:53 -0500
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: Why is junk being appended to my saved data file?
Message-Id: <71f7hl$dqk$1@pilot.njin.net>

Hello -


"IFN" <harris@gc.maricopa.edu> writes:

and writes, and writes...

g.IFN                              44  Why is junk being appended [...]
h IFN                              44  -
i IFN                              44  -
j IFN                              44  -
k IFN                              44  -
l IFN                              44  -
m IFN                              44  -
n IFN                              44  -
o IFN                              44  -
p IFN                              44  -
q IFN                              44  -
r IFN                              44  -


A dozen postings, if anything, will probably get *less* attention than one.


>The file before running the program looks like this;

>Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
>Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55


>The output of this program is this;

>Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
> Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
> = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);


>Why are all these characters being appended to the file?  And more
>importantly, how do I get rid of it?  I'm up against the wall now. I finally
>boiled it down to its simplest form.  This small length of code creates the
>bad saved file;

>#!/usr/local/bin/perl

That should be perl -w

>require "./Library/cgi-lib.pl";

I'd strongly recommend using CGI.pm rather than cgi-lib.pl.

>$file = "./Lists/test.list.txt";
>print &PrintHeader;
>print &HtmlTop ("Done");
>print &HtmlBot;


You shouldn't need to bother with all that to test what you're trying to
test.

>open (INFILE, $file) || &CgiDie ("Cannot open $file");
> @names = <INFILE>;
>close (<INFILE>);
>open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
> print OUTFILE "@names";
>close (<OUTFILE>); #close file...


You're not closing filehandles - you're closing reads on 
filehandles (which are at EOF, and one of which is write-only,
and that's not what you should be doing anyway).  I don't know
exactly where that line of code is coming from, but it doesn't
even really matter.  Lose the <> around the filehandles:

close INFILE;
close OUTFILE;

Also, I wonder whether 'print OUTFILE "@names"' is what you want.  Are you sure
you want each line after the first to begin with a space?  If not, take away
the quotation marks around @names.


David Black
dblack@pilot.njin.net


------------------------------

Date: 31 Oct 1998 14:49:04 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Why is junk being appended to my saved data file?
Message-Id: <slrn73m8r0.t1e.sholden@pgrad.cs.usyd.edu.au>

On Fri, 30 Oct 1998 12:03:55 -0800, IFN <harris@gc.maricopa.edu> wrote:
>Hi all,
>Whenever I write a data file back, it appends a bunch of junk to the end of
>the file.  Below I've listed the small amount of code it takes to duplicate
>the problem along with it's input file and output file.
>
>
>The file before running the program looks like this;
>
>Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
>Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
>
>
>The output of this program is this;
>
>Mark Harris|harris@gc.maricopa.edu|Thursday, October 22, -198 at 11:40:55
> Ben Wilhelm|benwilhelm@hotmail.com|Thursday, October 22, -198 at 11:40:55
> = ($left > $bufsize ? $bufsize : $left); #$maxbound==length($buf);
>
>
>Why are all these characters being appended to the file?  And more
>importantly, how do I get rid of it?  I'm up against the wall now. I finally
>boiled it down to its simplest form.  This small length of code creates the
>bad saved file;
>
>#!/usr/local/bin/perl

No -w which would have told you about the problem with your closes...

>require "./Library/cgi-lib.pl";
>$file = "./Lists/test.list.txt";
>print &PrintHeader;
>print &HtmlTop ("Done");
>print &HtmlBot;

Since you claim this is the simplest for, does that mean that the error
doesn't occur if you don't do the CGI stuff???

>open (INFILE, $file) || &CgiDie ("Cannot open $file");
> @names = <INFILE>;
>close (<INFILE>);

This does not do what you think...
close(INFILE); is what you want...
Of course -w would have generated a warning...

perldoc perlfunc

>open (OUTFILE, ">$file") || &CgiDie ("Cannot open $file");
> print OUTFILE "@names";

This is why that space gets added to the front of all but the first line...
Lose the "s unless you wnat this...

>close (<OUTFILE>); #close file...
>
>Any help would be greatly appreciated.

As for the extra crap that gets appended... the posted code doesn't do that,
of course you have left a file handle open for writing, so maybe later on you
write to it???

Then again I didn't test it with the CGI stuff.

Is there a reason for the multiple posts???

-- 
Sam

Remember that the P in Perl stands for Practical.  The P in Python
doesn't seem to stand for anything.
	--Randal Schwartz in <8cemsabtef.fsf@gadget.cscaper.com>



------------------------------

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4119
**************************************

home help back first fref pref prev next nref lref last post