[8228] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1846 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 10 13:15:01 1998

Date: Tue, 10 Feb 98 10:00:27 -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           Tue, 10 Feb 1998     Volume: 8 Number: 1846

Today's topics:
    Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's et <tchrist@mox.perl.com>
    Re: Binary Search Trees <tchrist@mox.perl.com>
        Building PERL message board <junk@spanky.tamu.edu>
    Re: Building PERL message board <tchrist@mox.perl.com>
        Can't configure Perl5.004_04 <95060667d@polyu.edu.hk>
    Re: Can't configure Perl5.004_04 <tchrist@mox.perl.com>
    Re: debugging perl script (Andrew M. Langmead)
    Re: garbage collection in perl <tchrist@mox.perl.com>
    Re: Happy with Perl? <tchrist@mox.perl.com>
    Re: Linux (Mike Stok)
    Re: Linux (Andrew M. Langmead)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 10 Feb 1998 16:50:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Being Nice 2 Nice Beings [Was: Reading The FAQ's etc.: a teacher's perspective...]
Message-Id: <6bq0g5$lr4$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Denis Goddard <dgoddard@us.oracle.com> writes:
:Even though Micro$oft would love you to believe that Visual basic is easier and
:better, we know it
:just ain't so. Keep in mind, please, that the number of users of Perl positively
:correlates to the
:long-term pervasiveness of Perl that Larry, Tom, and so many others have worked so
:hard to foster.

Yes, that's true.  But please: Mangling your line wraps with lame excuses
for newsreaders so severely detracts from your messages that you're
certainly going to be skipped by many readers, if not in fact killfiled
outright.

Repeat after me:

    Usenet is not a word processor; it's a medium where aesthetics count.
    Mozilla is not a newsreader; it's a web browser.
    Windows is not an operating system; it's a GUI on a program loader.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
And don't tell me there isn't one bit of difference between null and space,
because that's exactly how much difference there is.  :-)
        --Larry Wall in <10209@jpl-devvax.JPL.NASA.GOV>


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

Date: 10 Feb 1998 16:18:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Binary Search Trees
Message-Id: <6bpul1$ibb$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, rjk@coos.dartmouth.edu writes:
:How about, trees can keep their elements in sorted order.

True.  But how often is it more efficient to blow a whole hash 
per node instead of just extracting the keys first and running
an N*logN sort on those before your traversal?  I believe that 
for most applications don't need the heavy hit.

To test this, I've made several benchmarks.  All work on the 
same datafile containing 100000 random (but distinct) words
out of a very large version of /usr/dict/words.

		    |----TIMES----|   |----MEMORY---|
		    User    System     Size	 RSS
	reghash	      3.13    0.16    16240     13864
	simtree      34.66    0.31    27886     22909  
	trhash       47.38    0.28    27831     22909  
	dbhash1      21.57   13.81     2068      1456
	dbhash2	     22.71   12.83     2068      1460

reghash is a couple line of code using a regular old hash and then
sorting the keys.  Notice how very quick it is.

simtree is a simple, non-OO binary tree implementation of binary trees.
Notice how big it is.

trtree is the OO version.  Notice how much slower it is, almost 50%.
Don't you love objects?

I have avoided showing you the tied version of this.  It's not pretty.
Can you say slow?  Plus to be done right, you need a threaded tree
with predecessor and successor links so your inorder doesn't have to 
start from the root each time.

dbhash1 uses DB_File's BTREE bindings (which are all hand-coded in C) with
an in-core database, and dbhash2 does the same using a disk file instead.
I can understand why the disk file has a small imprint, but I'm totally
stumped about why the incore one doesn't take any more memory.  I checked
the output, and both are correct, and the second one really does make 
a file on disk.  Mysterious.

Anyway, I'd like you to think hard about how wonderful your trees
really are in the light of the timing above.

--tom

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1998-02-10 09:17 MST by <tchrist@jhereg.perl.com>.
# Source directory was `/home/tchrist'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
# This format requires very little intelligence at unshar time.
# "if test", "echo", "mkdir", and "sed" may be needed.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#    253 -rwxr-xr-x qrline
#     84 -rwxr-xr-x reghash
#    204 -rw-r--r-- dbhash1
#    259 -rw-r--r-- dbhash2
#    129 -rwxr-xr-x trhash
#   3020 -rw-r--r-- BinTree.pm
#
echo=echo
if mkdir _sh26595; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= qrline ==============
if test -f 'qrline' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'qrline' '(file already exists)'
else
  $echo 'x -' extracting 'qrline' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'qrline' &&
X#!/usr/bin/perl
X
Xmy $file  = shift;
Xmy $count = shift || 1;
X
Xopen(FH, $file) || die "can't open $file: $!";
X$size = -s FH;
X
Xwhile ($count --> 0) {
X    seek(FH, rand($size), 0);
X    <FH>;
X    $word = <FH>;
X    redo if $seen{$word}++;
X    print $word;
X} 
SHAR_EOF
  : || $echo 'restore of' 'qrline' 'failed'
fi
# ============= reghash ==============
if test -f 'reghash' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'reghash' '(file already exists)'
else
  $echo 'x -' extracting 'reghash' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'reghash' &&
Xwhile (<>) { ++$hash{$_} } 
Xfor (sort keys %hash) { print } 
Xsystem("ps l$$ 1>&2");
SHAR_EOF
  : || $echo 'restore of' 'reghash' 'failed'
fi
# ============= dbhash1 ==============
if test -f 'dbhash1' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'dbhash1' '(file already exists)'
else
  $echo 'x -' extracting 'dbhash1' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'dbhash1' &&
Xuse DB_File;
X
Xtie(%hash, 'DB_File', undef, O_RDWR|O_CREAT, 0666, $DB_BTREE)
X    || die "can't mem tie hash: $!";
X
Xwhile (<>) { ++$hash{$_} } 
Xwhile ( ($_) = each %hash ) { print }
Xsystem("ps l$$ 1>&2");
X
SHAR_EOF
  : || $echo 'restore of' 'dbhash1' 'failed'
fi
# ============= dbhash2 ==============
if test -f 'dbhash2' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'dbhash2' '(file already exists)'
else
  $echo 'x -' extracting 'dbhash2' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'dbhash2' &&
Xuse DB_File;
X
Xtie(%hash, 'DB_File', "/tmp/db.$$", O_CREAT|O_RDWR|O_CREAT, 0666, $DB_BTREE)
X    || die "can't mem tie hash: $!";
Xwhile (<>) { ++$hash{$_} } 
Xwhile ( ($_) = each %hash ) { print }
Xsystem("(ps l$$; ls -l /tmp/db.$$) 1>&2");
Xunlink("/tmp/db.$$");
SHAR_EOF
  : || $echo 'restore of' 'dbhash2' 'failed'
fi
# ============= trhash ==============
if test -f 'trhash' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'trhash' '(file already exists)'
else
  $echo 'x -' extracting 'trhash' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'trhash' &&
Xuse BinTree;
X$root = BinTree->new();
Xwhile (<>) { $root->insert($_) }
X$root->inorder( sub { print @_ } );
Xsystem("ps l$$ 1>&2");
SHAR_EOF
  : || $echo 'restore of' 'trhash' 'failed'
fi
# ============= BinTree.pm ==============
if test -f 'BinTree.pm' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'BinTree.pm' '(file already exists)'
else
  $echo 'x -' extracting 'BinTree.pm' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'BinTree.pm' &&
Xpackage BinTree;
Xuse strict;
X
X##########################################################
X# Public interface to class "BinTree":
X##########################################################
X
X# CONSTRUCTORS
Xsub new($);	    # basic constructor: $t = BinTree->new();
Xsub copy($);	    # copy constructor:  $t2 = $t1->copy();
X
X# DESTRUCTOR is unneeded: Perl does its own GC for the simple stuff
X
X# INSTANCE METHODS
Xsub insert($);	    # insert a node into a tree:  $t->insert($node);
Xsub remove($);	    # remove a node from a tree:  $t->remove($node);
Xsub search($);	    # find a node in a tree:      $n = $t->search($value)
X
Xsub inorder($);    # inorder traversal:           $t->inorder(\&func);
Xsub postorder($);  # postorder traversal:         $t->postorder(sub { });
Xsub preorder($);   # preorder traversal:          $t->preorder(\&whatever);
X
X##########################################################
X# Private implementation to class "BinTree":
X##########################################################
X
X###########################################################
X#   A tree node is represented by a structure (hash ref)  #
X#   consisting of three fields:				  #
X#       VALUE	Whatever the user inserted there	  #
X#       LEFT	The left child			          #
X#       RIGHT	The right child				  #
X###########################################################
X
Xuse Carp;
X
Xsub new($) {
X    my ($class, $value) = @_;
X    $class = ref $class if ref $class;
X    my $tree  = {
X	VALUE	=> $value,
X	LEFT	=> undef,
X	RIGHT	=> undef,
X    };
X    bless($tree, $class);
X    return $tree;
X}
X
Xsub insert($) {
X    my($tree, $value) = @_;
X
X    if (!defined $tree->{VALUE}) {
X	$tree->{VALUE} = $value;
X    } 
X    elsif ($tree->{VALUE} gt $value) {
X	if ($tree->{LEFT})  { $tree->{LEFT}->insert($value)      }
X	else 		    { $tree->{LEFT} = $tree->new($value) } 
X    } 
X    elsif ($tree->{VALUE} lt $value) {
X	if ($tree->{RIGHT}) { $tree->{RIGHT}->insert($value)      }
X	else 		    { $tree->{RIGHT} = $tree->new($value) } 
X    } 
X    else {
X	carp "Duplicate insertion of $value ignored";
X    } 
X} 
X
Xsub inorder($) {
X    my($tree, $coderef) = @_;
X    $tree->{LEFT}->inorder($coderef)   if $tree->{LEFT};
X    $coderef->($tree->{VALUE});
X    $tree->{RIGHT}->inorder($coderef)  if $tree->{RIGHT};
X} 
X
Xsub preorder($) {
X    my($tree, $coderef) = @_;
X    $tree->{LEFT}->preorder($coderef)   if $tree->{LEFT};
X    $tree->{RIGHT}->preorder($coderef)  if $tree->{RIGHT};
X    $coderef->($tree->{VALUE});
X} 
X
Xsub postorder($) {
X    my($tree, $coderef) = @_;
X    $tree->{RIGHT}->postorder($coderef) if $tree->{RIGHT};
X    $tree->{LEFT}->postorder($coderef)  if $tree->{LEFT};
X    $coderef->($tree->{VALUE});
X} 
X
Xsub search($) {
X    my($tree, $value) = @_;
X    return unless $tree;
X    if ($tree->{VALUE} eq $value) {
X	return $tree;
X    } 
X    my $branch = ($value lt $tree->{VALUE}) ? "LEFT" : "RIGHT";
X    return  $tree->{$branch}  && $tree->{$branch}->search($value);
X} 
X
Xsub remove($) { confess "UNIMPLEMENTED" }
Xsub copy($)   { confess "UNIMPLEMENTED" }
X
X1;
SHAR_EOF
  : || $echo 'restore of' 'BinTree.pm' 'failed'
fi
rm -fr _sh26595
exit 0
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    OOPS!  You naughty creature!  You didn't run Configure with sh!
    I will attempt to remedy the situation by running sh for you...
        --Larry Wall in Configure from the perl distribution


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

Date: Tue, 10 Feb 1998 11:29:31 -0800
From: Jerry <junk@spanky.tamu.edu>
Subject: Building PERL message board
Message-Id: <34E0AA9B.129D@spanky.tamu.edu>

I am creating a message board and I am looking for any help I can get on
the code.  If anyone has any suggestions or warnings any help would be
appreeciated.


Jerry


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

Date: 10 Feb 1998 17:43:39 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Building PERL message board
Message-Id: <6bq3kb$p1b$10@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, junk@spanky.tamu.edu writes:
:I am creating a message board and I am looking for any help I can get on
:the code.  If anyone has any suggestions or warnings any help would be
:appreeciated.

I suggest you install a newsserver, and keep a local spool.  Anything else
is too much work, and fairly silly.  The Internet has catupulted even
the Wintel victims past the days of BBS toys.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    str->str_pok |= SP_FBM;                     /* deep magic */
    s = (unsigned char*)(str->str_ptr);         /* deeper magic */
        --Larry Wall in util.c from the perl source code


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

Date: Wed, 11 Feb 1998 00:51:22 +0800
From: Jheri Chan <95060667d@polyu.edu.hk>
Subject: Can't configure Perl5.004_04
Message-Id: <34E08588.657DA3B4@polyu.edu.hk>

I'm a newbie in compiling programs in unix. Thanks in advance for your
help.

I couldn't configure the latest Perl sources in my Dec Unix (OSF1) with
the default cc compiler.
Why? Is there any compiled distribution?

-- Jheri Chan

Here is the captured log.
================================
Alpha2000:> sh configure
sh Configure -ds -e

First let's make sure your kit is complete.  Checking...
Looks good...
Would you like to see the instructions? [n]
Locating common programs...
Checking compatibility between /usr/bin/echo and builtin echo (if
any)...
Symbolic links are supported.
Good, your tr supports [:lower:] and [:upper:] to convert case.
3b1             dynixptx        isc             next_4
sunos_4_0
aix             epix            isc_2           opus
sunos_4_1
altos486        esix4           linux           os2             svr4
amigaos         fps             lynxos          os390           ti1500
apollo          freebsd         machten         powerux         titanos
aux_3           genix           machten_2       qnx             ultrix_4

bsdos           greenhills      mips            sco             umips
convexos        hpux            mpc             sco_2_3_0       unicos
cxux            i386            mpeix           sco_2_3_1       unicosmk

cygwin32        irix_4          ncr_tower       sco_2_3_2
unisysdynix
dcosx           irix_5          netbsd          sco_2_3_3       utekv
dec_osf         irix_6          newsos4         sco_2_3_4       uts
dgux            irix_6_0        next_3          solaris_2
dynix           irix_6_1        next_3_0        stellar
Which of these apply, if any? [dec_osf]
Operating system name? [dec_osf]
Operating system version? [4.0]
What is your architecture name [alpha-dec_osf]
AFS does not seem to be running...
Installation prefix to use? (~name ok) [/usr/local]
Pathname where the private library files will reside? (~name ok)
[/usr/local/lib/perl5]
Getting the current patchlevel...
Where do you want to put the public architecture-dependent libraries?
(~name ok)
[/usr/local/lib/perl5/alpha-dec_osf/5.00404]
Binary compatibility with Perl 5.003? [y]
I don't think setuid scripts are secure (no /dev/fd directory).
Do you want to do setuid/setgid emulation? [n]
Pathname for the site-specific library files? (~name ok)
[/usr/local/lib/perl5/site_perl]
Pathname for the site-specific architecture-dependent library files?
(~name ok)
[/usr/local/lib/perl5/site_perl/alpha-dec_osf]
Directory for your old 5.001 architecture-dependent libraries? (~name
ok)
[none]
Pathname where the public executables will reside? (~name ok)
[/usr/local/bin]
Directory /usr/local/bin doesn't exist.  Use that name anyway? [y]
System manual is in /usr/man/man1.
Which memory models are supported? [none]
Use which C compiler? [cc]
Checking for GNU cc in disguise and/or its version number...
Directories to use for library searches?
[/usr/shlib /shlib /lib /usr/lib /usr/ccs/lib]
What is the file extension used for shared libraries? [so]
Checking for optional libraries...
Any additional libraries? [-ldb -lm]
Now, how can we feed standard input to your C preprocessor...
What optimizer/debugger flag should be used? [-O4]
Any additional cc flags? [-std -D_INTRINSICS -D__LANGUAGE_C__]
Let me guess what the preprocessor flags are...
Any additional ld flags (NOT including libraries)? [none]
Checking your choice of C compiler, libs, and flags for coherency...
Checking for GNU C Library...
Shall I use nm to extract C symbols from the libraries? [y]
Where is your C library? [/usr/shlib/libc.so]
Extracting names from the following files for later perusal:
 /usr/shlib/libc.so
 /usr/shlib/libdb.so
 /usr/shlib/libm.so
This may take a while..........done
Computing filename position in cpp output for #include directives...
<dld.h> NOT found.
dlopen() found.
Do you wish to use dynamic loading? [y]
Source file to use for dynamic loading [ext/DynaLoader/dl_dlopen.xs]
Any special flags to pass to cc -c to compile shared library modules?
[none]
What command should be used to create dynamic libraries? [ld]
Any special flags to pass to ld to create a dynamically loaded library?
[-shared -expect_unresolved "*" -O4 -msym -s]
Any special flags to pass to cc to use dynamic loading? [none]
Build a shared libperl.so (y/n) [n]
Where do the main Perl5 manual pages (source) go? (~name ok)
[/usr/local/man/man1]
What suffix should be used for the main Perl5 man pages? [1]
You can have filenames longer than 14 characters.
Where do the Perl5 library man pages (source) go? (~name ok)
[/usr/local/lib/perl5/man/man3]
What suffix should be used for the Perl5 library man pages? [3]
Are you getting the hosts file via yellow pages? [n]
Figuring out host name...
Your host name appears to be "Alpha2000.polyu.edu.hk". Right? [y]
What is your domain name? [.polyu.edu.hk]
What is your e-mail address? [root@alpha2000.polyu.edu.hk]
Perl administrator e-mail address [root@alpha2000.polyu.edu.hk]
What shall I put after the #! to start up perl ("none" to not use #!)?
[/usr/local/bin/perl]
Where do you keep publicly executable scripts? (~name ok)
[/usr/local/bin]
Directory /usr/local/bin doesn't exist.  Use that name anyway? [y]
Use the experimental PerlIO abstraction layer? [n]
gconvert NOT found.
gcvt found.
I'll use gcvt to convert floats into a string.
access() found.
<sys/file.h> defines the *_OK access constants.
alarm() found.
Checking whether your compiler can handle __attribute__ ...
bcmp() found.
bcopy() found.
<unistd.h> found.
getpgrp() found.
You have to use getpgrp() instead of getpgrp(pid).
setpgrp() found.
You have to use setpgrp(pid,pgrp) instead of setpgrp().
bzero() found.
Checking to see how big your integers are...
You have void (*signal())() instead of int.
Checking whether your C compiler can cast large floats to int32.
Checking whether your C compiler can cast negative float to unsigned.
vprintf() found.
Your vsprintf() returns (int).
chown() found.
chroot() found.
chsize() NOT found.
Checking to see if your C compiler knows about "const"...
crypt() found.
cuserid() found.
<limits.h> found.
<float.h> found.
DBL_DIG found.
difftime() found.
<dirent.h> found.
Your directory entries are struct dirent.
Good, your directory entry keeps length information in d_namlen.
dlerror() found.
<dlfcn.h> found.
What is the extension of dynamically loaded modules [so]
Checking whether your dlsym() needs a leading underscore ...
dlsym doesn't need a leading underscore.
dup2() found.
<sys/file.h> defines the O_* constants...
and you have the 3 argument form of open().
Figuring out the flag used by open() for non-blocking I/O...
Let's see what value errno gets from read() on a O_NONBLOCK file...
fchmod() found.
fchown() found.
fcntl() found.
fgetpos() found.
flock() found.
fork() found.
pathconf() found.
fpathconf() found.
fsetpos() found.
gethostent() found.
getlogin() found.
getpgid() found.
getpgrp2() NOT found.
getppid() found.
getpriority() found.
gettimeofday() found.
<netinet/in.h> found.
htonl() found.
Using <string.h> instead of <strings.h>.
strchr() found.
inet_aton() found.
isascii() found.
killpg() found.
link() found.
localeconv() found.
lockf() found.
lstat() found.
mblen() found.
mbstowcs() found.
mbtowc() found.
memcmp() found.
memcpy() found.
memmove() found.
memset() found.
mkdir() found.
mkfifo() found.
mktime() found.
msgctl() found.
msgget() found.
msgsnd() found.
msgrcv() found.
You have the full msg*(2) library.
<malloc.h> found.
<stdlib.h> found.
Do you wish to attempt to use the malloc that comes with perl5? [y]
Your system wants malloc to return 'void *', it would seem.
Your system uses void free(), it would seem.
nice() found.
pause() found.
pipe() found.
poll() found.
<pwd.h> found.
readdir() found.
seekdir() found.
telldir() found.
rewinddir() found.
readlink() found.
rename() found.
rmdir() found.
<memory.h> found.
Checking to see if your bcopy() can do overlapping copies...
Checking to see if your memcpy() can do overlapping copies...
Checking to see if your memcmp() can compare relative magnitude...
select() found.
semctl() found.
semget() found.
semop() found.
You have the full sem*(2) library.
setegid() found.
seteuid() found.
setlinebuf() found.
setlocale() found.
setpgid() found.
setpgrp2() NOT found.
setpriority() found.
setregid() found.
setresgid() NOT found.
setreuid() found.
setresuid() NOT found.
setrgid() found.
setruid() found.
setsid() found.
<sfio.h> NOT found.
shmctl() found.
shmget() found.
shmat() found.
and it returns (void *).
shmdt() found.
You have the full shm*(2) library.
sigaction() found.
POSIX sigsetjmp found.
Hmm... Looks like you have Berkeley networking support.
socketpair() found.
Your stat() knows about block sizes.
Checking how std your stdio is...
strcoll() found.
Checking to see if your C compiler can copy structs...
strerror() found.
strtod() found.
strtol() found.
strtoul() found.
strxfrm() found.
symlink() found.
syscall() found.
sysconf() found.
system() found.
tcgetpgrp() found.
tcsetpgrp() found.
<sys/times.h> found.
times() found.
What type is returned by times() on this system? [clock_t]
truncate() found.
tzname[] found.
umask() found.
uname() found.
vfork() found.
Some systems have problems with vfork().  Do you want to use it? [n]
<sys/dir.h> found.
<sys/ndir.h> NOT found.
closedir() found.
Checking whether closedir() returns a status...
Checking to see if your C compiler knows about "volatile"...
wait4() found.
waitpid() found.
wcstombs() found.
wctomb() found.
Checking alignment constraints...
Doubles must be aligned on a how-many-byte boundary? [8]
Checking to see how your cpp does stuff like catenate tokens...
<db.h> found.
Checking Berkeley DB version ...
Looks OK.  (Perl supports up to version 1.86).
Checking return type needed for hash for Berkeley DB ...
Checking return type needed for prefix for Berkeley DB ...
Checking to see how well your C compiler groks the void type...
  Support flag bits are:
    1: basic void declarations.
    2: arrays of pointers to functions returning void.
    4: operations between pointers to and addresses of void functions.
    8: generic void pointers.
What is the type for file position used by fsetpos()? [fpos_t]
What is the type for group ids returned by getgid()? [gid_t]
getgroups() found.
setgroups() found.
What type is the second argument to getgroups() and setgroups()? [gid_t]

What type is lseek's offset on this system declared as? [off_t]
Checking if your /sbin/make program sets $(MAKE)... Yup, it does.
What type is used for file modes? [mode_t]
What pager is used on your system? [/usr/bin/more]
Checking out function prototypes...
Checking to see how many bits your rand function produces...
How many bits does your rand() function produce? [15]
Checking how to generate random libraries on your machine...
<sys/select.h> found.
Testing to see if we should include <time.h>, <sys/time.h> or both.
We'll include <sys/time.h>.
Well, your system knows about the normal fd_set typedef...
and you have the normal fd_set macros (just as I'd expect).
Your system uses fd_set * for the arguments to select.
Generating a list of signal names and numbers...
What type is used for the length parameter for string functions?
[size_t]
I'll be using ssize_t for functions returning a byte count.
Your stdio uses unsigned chars.
time() found.
What type is returned by time() on this system? [time_t]
What is the type for user ids returned by getuid()? [uid_t]
dbmclose() NOT found.
<sys/file.h> found.
We'll be including <sys/file.h>.
<fcntl.h> found.
We don't need to include <fcntl.h> if we include <sys/file.h>.
<grp.h> found.
<locale.h> found.
<math.h> found.
<ndbm.h> found.
dbm_open() found.
<net/errno.h> NOT found.
tcsetattr() found.
You have POSIX termios.h... good!
<stdarg.h> found.
<varargs.h> found.
We'll include <stdarg.h> to get va_dcl definition.
<stddef.h> found.
<sys/filio.h> NOT found.
<sys/ioctl.h> found.
<sys/param.h> found.
<sys/resource.h> found.
<sys/stat.h> found.
<sys/types.h> found.
<sys/un.h> found.
<sys/wait.h> found.
<utime.h> found.
<values.h> found.
<gdbm.h> NOT found.
Looking for extensions...
What extensions do you wish to load dynamically?
[DB_File Fcntl IO NDBM_File Opcode POSIX SDBM_File Socket]
What extensions do you wish to load statically? [none]
Stripping down executable paths...
Creating config.sh...
Doing variable substitutions on .SH files...
Extracting Makefile (with variable substitutions)
Extracting cflags (with variable substitutions)
Extracting config.h (with variable substitutions)
Extracting makeaperl (with variable substitutions)
Extracting makedepend (with variable substitutions)
Extracting makedir (with variable substitutions)
Extracting perl.exp
Extracting writemain (with variable substitutions)
Extracting x2p/Makefile (with variable substitutions)
Extracting x2p/cflags (with variable substitutions)
Run make depend now? [y]
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
swap space below 10 percent free
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
swap space below 10 percent free
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
swap space below 10 percent free
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
sh ./makedepend MAKE=make
/bin/sh Makefile.SH
Extracting Makefile (with variable substitutions)
sh ./makedepend.SH
Extracting makedepend (with variable substitutions)
make depend MAKEDEPEND=
sh ./makedepend.SH
Unable to obtain requested swap space
Unable to obtain requested swap space
Unable to obtain requested swap space
Unable to obtain requested swap space
Unable to obtain requested swap space

 ... [obmitted]
================================




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

Date: 10 Feb 1998 17:41:09 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can't configure Perl5.004_04
Message-Id: <6bq3fl$p1b$9@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, jheri@hkid.com writes:

:I'm a newbie in compiling programs in unix. Thanks in advance for your
:help.

[649 lines of crud omitted]

:Unable to obtain requested swap space

Simple problem: you don't have enough swap space. 
Solution?  Add more swap (virtual memory) or real
stuff (ram).

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    "Sometimes I wish I could put an expiration date on my quotes." --Larry Wall


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

Date: Tue, 10 Feb 1998 17:31:42 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: debugging perl script
Message-Id: <Eo6BCv.G5t@world.std.com>

"Ian Samson" <IDSamson@Beauty.HSRC.ac.za> writes:

>Hi. I have a rather long (271 lines) script to mail questionnaire results.
>Each time I test it in the browser, I get a message that says "The server
>returned an invalid or unrecognized response". How do I find out which line
>is causing the error?
>Thanks.

All of the warning and error messages that perl emits are documented
in the "perldiag" man page. Perl emits this to the standard error
error stream with the file in which the error was caused and the line
number. (give or take any miscounting with the recent line
misnumbering bugs)

If you are not seeing the messages on STDERR, it will be hard to
diagnose your problem. It sounds as if you are not executing the
scripts yourself, but you are causing some action to make another
piece of software (like maybe an HTTP server that implements the CGI
protocol for talking to other program? I'm not sure, since you don't
quite say so.) Does this other piece of software record what your
script emits to STDERR? You might want to check with this other piece
of software's documentation. (Does this other piece of software
document all of its possible diagnostic messages? If not, then its
documentation is definitely a step below perl's.) If you can't find an
answer in this other piece of softwares documentation, then you might
want to check in a newsgroup that discusses this type of software
(again, if this is an HTTP server, the proper newsgroup would be one
of the comp.infosystems.www.servers.* newsgroups, but since you didn't
say so, I can't be sure I'm directing you to the right place.)

Another option would be to take a more direct approach to running your
script. That is, from a command prompt. Most shells or command
interpreters (or whtever you want to call them) by default show the
messages that programs emit to standard error. Then you could read the
messages on standard error and discover if and where perl is having a
problem with your script. If perl runs your script, but the output is
wrong somehow, you could use the perl debugger to step through and
examine your script. (See the perldebug man page.)

-- 
Andrew Langmead


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

Date: 10 Feb 1998 17:33:49 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: garbage collection in perl
Message-Id: <6bq31t$p1b$8@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Michael Douglass <mikedoug@texas.net> writes:
:I've searched the web and I've searched the news groups... Does anyone
:have any information on the garbage collection under perl?  

Did you ever consider looking in the manpages?

    $ grep -ci 'garbage collect' /usr/src/perl/pod/*pod | grep -v '0$'
    /usr/src/perl/pod/perldiag.pod:1
    /usr/src/perl/pod/perlfaq3.pod:1
    /usr/src/perl/pod/perlguts.pod:1
    /usr/src/perl/pod/perlobj.pod:5
    /usr/src/perl/pod/perlref.pod:1
    /usr/src/perl/pod/perltie.pod:2
    /usr/src/perl/pod/perltoc.pod:1
    /usr/src/perl/pod/perltoot.pod:1

:I ask because I have a fairly
:busy program I wrote using perl that does quite a bit with hashes...
:The memory footprint grows to about 50MB with about half of that
:resident at all time.  I find it terribly hard to believe that my
:data is taking up that much space in reality; this doesn't say much
:about perl's memory management.

While Perl does indeed over-allocate all its structures to spare
frequent reallocs, it may be you are forgetting to use my variables
or some such.  

It's easy to make a program that explodes:

    push(@a, 3) while 1;

This is not a bug in Perl, but in the programmer.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


When the dinosaurs are mating, climb a tree.  --Steve Johnson


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

Date: 10 Feb 1998 14:50:06 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Happy with Perl?
Message-Id: <6bppeu$35k$4@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Eric Bohlman <ebohlman@netcom.com> writes:
:Of course, if you wrote your program in some other language, and a bug in 
:a commercial compiler caused it to fail, the company that sold the 
:compiler would undoubtedly point to language in its licensing agreement 
:to the effect that the company was not responsible for consequential 
:damages.  

Right.  See the standard licence at http://www.perl.com/perl/news/y2k.html

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    "111% of crap is everything." --Larry Wall


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

Date: 10 Feb 1998 11:27:16 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Linux
Message-Id: <6bpv54$14o$1@stok.co.uk>

In article <6bokv9$ll2$1@csnews.cs.colorado.edu>,
Tom Christiansen  <tchrist@mox.perl.com> wrote:

>In comp.lang.perl.misc, efflandt@xnet.com (David Efflandt) writes:
>:Linux is a free operating system for PC's that can do most anything
>:you can do in UNIX.  
>
>Um, Linux *is* Unix.  "walks like a duck".

Shouldn't that be "waddles like a penguin" or something?

Mike :-)
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Tue, 10 Feb 1998 17:13:41 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Linux
Message-Id: <Eo6AIt.M81@world.std.com>

Tom Christiansen <tchrist@mox.perl.com> writes:

> [courtesy cc of this posting sent to cited author via email]

>In comp.lang.perl.misc, cowboy@cnnw.net (James L. Taylor) writes:
>:I'm new to perl and I have been reading the news group here for a
>:couple weeks and I have been noticing that alot of people talk about
>:perl editors so they can do their work off line....

>What does "do work offline" mean?  If I get one more person 
>who asks me whether they can use "perl offline", I'm either
>going to hand them a pad of paper with a pencil, or else 
>terminate their AOL accounts.

I remember sitting in the school cafeteria with a printout of my code,
a notepad, and a pencil. I'm sure that many here have done the same
thing, stepping through the code using the notepad to record the
current value of each of the variables. It was a fairly informative
exercise. My guess is that it would be helpful for most who ask if
they can use "perl offline".
-- 
Andrew Langmead


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

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


Administrivia:

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 1846
**************************************

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