Musar Information Network wrote:
>
> Hello World,
>
> I've got something happening I never experienced before. I've given the
> entire section of code in question so that you can see what's going on, but
> the real line of code in question begins "print RECORD".
>
> For some unknown reason, I am ending up with one or two extra carriage
> returns at the end of each record (or maybe an extra one BEFORE the
> record?). Every other place I'm using code like this, everything works as
> expected--a line of data and a single carriage return.
>
> Anyone know what's happening here?
>
> Thank you.
>
> Tim
>
> use Time::Local;
> ($sec,$min,$hour,$day,$month,$year,$j1,$j2,$j3) = localtime(time());
> $month += 1;
> $year = substr($year,-2,2);
> $username = $in{'username'};
> $username =~ tr/+/ /;
> $password1 = $in{'password1'};
> $email = $in{'email'};
>
> open (RECORD, "+>>c:/inetpub/wwwroot/domain.com/upload_activity.dbf");
> print RECORD "$month/$day/$year $available_credit $username
>$password1
> $email\n";
> close (RECORD);
>
> open (ORIGINAL,"<c:/inetpub/wwwroot/domain.com/upload_activity.dbf");
> @data = reverse (<ORIGINAL>);
>
> open (DATABASE,">c:/inetpub/wwwroot/domain.com/upload_activity.txt");
> print DATABASE @data;
> close (DATABASE);
> close (ORIGINAL);
Dump the content of all of your variables and find out where it's coming
from - are there any textareas ? That would be my first guess. Here's
a dump routine you can use/modify:
# dump a variable in hex/ASCII
sub dumpit { # &dumpit (<var>[, *FH]);
my $buf = shift;
my $fh = *STDERR; # default to STDERR
$fh = shift if @_;
for (my $ii = 0; $ii < length ($buf); $ii += 16) {
printf $fh "%04x ", $ii;
my $len = length ($buf) - $ii;
$len = 16 if $len > 16;
my $buffer = substr ($buf, $ii, 16);
print $fh map { sprintf "%02x ", $_; } unpack 'C8', $buffer;
print $fh ' ';
print $fh map { sprintf "%02x ", $_; } unpack 'C*',
substr ($buffer, 8, 8) if length $buffer > 8;
print $fh ' ' . ' ' x (16 - $len);
for (my $jj = 0; $jj < $len; $jj++) {
my $ch = substr $buffer, $jj, 1;
if ((ord $ch) >= 32 && (ord $ch) < 0x7f) {
print $fh $ch;
} else {
print $fh '.';
}
}
print $fh "\n";
}
}
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles http://www.todbe.com/
/ ) /--< o // // Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_</_</_ http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web