[comp.lang.perl] Perl 4.0 pl 3 bug on HP-UX 6.5

walt@bcarh133.uucp (Walt Sullivan) (06/20/91)

I'm running Perl 4.0, patchlevel 03 on HP-UX 6.5. I am using Perl's malloc
routines, not HP-UX's. The following perl script produces no output, grinds
for a few seconds, then dies with "Out of memory!". Any guesses?

Please post replies or mail them to "walt@bnr.ca", not the address in the 
"From" field.

------------------------- Cut here -------------------------
#!/disc1/other/bin/perl
#
require "getopt.pl";
&Getopt;
$debug = defined($opt_d);
#
$doing='node33';
$results{$doing}='CFT';
$systype='9000/360';
$memory='16M';
$swap='32M';
$hpux_ver='6.5';
$config='maxuprc=80, nproc=145, shmbrk=512';
if ($debug) {
    print "doing='$doing', results{$doing}='$results{$doing}', systype='$systype'\n";
    print "memory='$memory', swap='$swap', hpux_ver='$hpux_ver'\n";
    print "config='$config'\n";
}
$^ = "HEADING";
$~ = "OUTPUT";
#
write;

format HEADING =
Node     | PLS | Hardware | Mem | Swap | HP-UX | /etc/conf/dfile
---------+-----+----------+-----+------+-------+------------------------------
.
format OUTPUT =
@<<<<<<< | @<< | @<<<<<<< | @<< | @<<< | @<<<  | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<
$doing, $results{$doing}, $systype, $memory, $swap, $hpux_ver, $config
~~         |     |          |     |      |       | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                                     $config
---------+-----+----------+-----+------+-------+------------------------------
.       
------------------------- Cut here -------------------------

--
Walt Sullivan
BITNET: walt@bnr.ca (work)
UUCP: walt@orbit.amiga.ocunix.on.ca (home)

lwall@jpl-devvax.jpl.nasa.gov (Larry Wall) (06/21/91)

In article <WALT.91Jun20084840@bcarh133.uucp> walt@bcarh133.uucp (Walt Sullivan) writes:
: I'm running Perl 4.0, patchlevel 03 on HP-UX 6.5. I am using Perl's malloc
: routines, not HP-UX's. The following perl script produces no output, grinds
: for a few seconds, then dies with "Out of memory!". Any guesses?
: ...
: format OUTPUT =
: @<<<<<<< | @<< | @<<<<<<< | @<< | @<<< | @<<<  | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<
: $doing, $results{$doing}, $systype, $memory, $swap, $hpux_ver, $config
: ~~         |     |          |     |      |       | ^<<<<<<<<<<<<<<<<<<<<<<<<<<<
:                                                      $config
: ---------+-----+----------+-----+------+-------+------------------------------
: .       

That ~~ line is the culprit.  The ~~ says to keep on doing that line till it's
blank, and it'll never be blank.  I suppose it would be more general to
do it till none of the fields interpolate anything, but that never occurred
to me before this.  I'm stupider than you wish I was.

Larry