[9370] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2963 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 24 15:17:22 1998

Date: Wed, 24 Jun 98 12:01:10 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 24 Jun 1998     Volume: 8 Number: 2963

Today's topics:
        "truncate" heilp needed! <galbmill@21st-century-comm.com>
    Re: "truncate" heilp needed! (Larry Rosler)
        AnyDBM_File doesn't define an EXISTS method at... Grehom@my-dejanews.com
        Building Perl on Dynix/Ptx 4.4.2 (Donald Howard)
        Detect "file system is full", etc from Perl? (doug a blaisdell)
    Re: Detect "file system is full", etc from Perl? <tchrist@mox.perl.com>
    Re: Detect "file system is full", etc from Perl? (Larry Rosler)
    Re: first language - last language birgitt@my-dejanews.com
    Re: first language - last language (Larry Rosler)
    Re: Flames.... (I R A Aggie)
    Re: Flames.... (John Moreno)
    Re: Flames.... (Matt Knecht)
    Re: Matching problem. Empty variable not matching. <tchrist@mox.perl.com>
    Re: NEED HELP !!!!!! <maierc@chesco.com>
        Newbie question: object inheritance in perl/Tk <lovell@fc.hp.com>
    Re: system() and security again <tchrist@mox.perl.com>
    Re: system() and security again (Larry Rosler)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 24 Jun 1998 14:22:14 -0400
From: Mikhail Galbmillion <galbmill@21st-century-comm.com>
Subject: "truncate" heilp needed!
Message-Id: <359143D6.4F5A@21st-century-comm.com>

Hello,
I have a problem using truncate function. What do I do wrong:

   if (length($string)>2000){
     open (LIMIT,">/tmp/limit") || die "\nCould not open /tmp/limit ";
     print LIMIT $string;
     close LIMIT;	
     chmod (0777, "/tmp/limit");
     truncate("tmp/limit",2000);
     $string="";
     if(open (LIMIT, "/tmp/limit")){
       while(<LIMIT>){
	 $string="$string $_";
       }
     } 
     else {
	die "\nFail to open file \"/tmp/limit\" for tracing";
     }
After executing this code the file size stays unchanged.
Is there anyway to trim a string to required size without saving it in
file?

Appreciate your help.
Mikhail


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

Date: Wed, 24 Jun 1998 11:46:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: "truncate" heilp needed!
Message-Id: <MPG.ffae96eea22dcfe9896c1@nntp.hpl.hp.com>

In article <359143D6.4F5A@21st-century-comm.com>, Mikhail Galbmillion 
<galbmill@21st-century-comm.com> says...
> Hello,
> I have a problem using truncate function. What do I do wrong:
 ...
>      open (LIMIT,">/tmp/limit") || die "\nCould not open /tmp/limit ";
 ...
>      truncate("tmp/limit",2000);

Maybe 'truncate' isn't implemented on your system (see `perldoc -f 
truncate`).  You should error-check this function, like "all" other 
functions that invoke operating-system functions.

In addition, you might try spelling the name of the file correctly.  What 
happened to the leading slash?  Or you might truncate the file using its 
handle LIMIT before closing it.  Then you won't have to spell its name 
correctly twice :-).
 
-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 24 Jun 1998 17:51:25 GMT
From: Grehom@my-dejanews.com
Subject: AnyDBM_File doesn't define an EXISTS method at...
Message-Id: <6mreat$vgm$1@nnrp1.dejanews.com>

Perl Newbie here - but I have sought answer in comp.lang.perl.misc and
Pro.Perl and I get the same error on both Win95 version and Linux. I'm
inputing data to a hash and using a line like  if (exists $myhash{$mkey}) { 
print "duplicate key value: ", $mkey, ":", $mvalue, "\n";  } else { 
$myhash{$mkey} = $mvalue;  } Now this worked fine - until I decided to 'tie'
the array using the DBMOPEN command.  dbmopen %myhash, 'MYHASH', 0777; when I
get the error message in subject field above - why would an 'exists' method
not be defined for a lookup table?  Am I missing something obvious - any help
gratefully received!

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 24 Jun 1998 10:46:04 GMT
From: donh@etcscan.com (Donald Howard)
Subject: Building Perl on Dynix/Ptx 4.4.2
Message-Id: <3590d781.170852382@news.etcscan.com>

Hello folks -

        I am trying to build perl 5.004_04 on Dynix/Ptx 4.4.2.  The
build seems to go fine, but I get an error from the dynamic linker:


[DYNIX/ptx]/work/donh/src/perl5.004_04> ./perl -pe 's/a/b/g
        dynamic linker: ./perl: relocation error: symbol not found:
_mcount


This symbol is not in the perl distribution.  I found references to it
in /lib/crt0.o /lib/crt1.o and /lib/libc.a (using nm).  If I am
interpreting nm correctly, _mcount is a function, but it is not
defined anywhere that I can see.  I'm stumped.
 

[DYNIX/ptx]/work/donh/src/perl5.004_04> nm -A ./perl /lib/crt*
/lib/libc.a 
lib/libc.so  | grep _mcount
[180]   | 134518717|       0|FUNC |GLOB |T   |10     |./perl:_mcount
[11]    |        58|       0|NOTY |GLOB |N   |2
|/lib/crt0.o:_mcount
[16]    |       125|       0|FUNC |GLOB |T   |2
|/lib/crt1.o:_mcount
[5]     |         0|       0|FUNC |GLOB |T   |2      |mcount.o:_mcount


I tryed posting this to comp.sys.sequent, but that is one _quiet_
group.  I've attached perl's config.sh below.  

-Don

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Don Howard
 donh@etcscan.com                                       Online Group
 (425) 483-2500 ext 2296                                SCAN/DPPS Inc.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=




#!/bin/sh
#
# This file was produced by running the Configure script.  It holds
all
# the definitions figured out by Configure.  Should you modify any of
# these values, do not forget to propagate your changes by running
# "Configure -S"; or, equivalently, you may run each .SH file
yourself.
#

# Configuration time: Tue Jun 23 11:42:05 PDT 1998
# Configured by: donh
# Target system: dynixptx obiwan 4.0 v4.4.2 i386 

Author=''
Date='$Date'
Header=''
Id='$Id'
Locker=''
Log='$Log'
Mcc='Mcc'
RCSfile='$RCSfile'
Revision='$Revision'
Source=''
State=''
afs='false'
alignbytes='4'
aphostname=''
ar='ar'
archlib='/work/donh/public/lib/perl5/i386-dynixptx/5.00404'
archlibexp='/work/donh/public/lib/perl5/i386-dynixptx/5.00404'
archname='i386-dynixptx'
archobjs=''
awk='awk'
baserev='5.0'
bash=''
bin='/work/donh/public/bin'
bincompat3='n'
binexp='/work/donh/public/bin'
bison=''
byacc='byacc'
byteorder='1234'
c='\c'
castflags='0'
cat='cat'
cc='cc'
cccdlflags=' '
ccdlflags=' '
ccflags='-I/usr/local/include'
cf_by='donh'
cf_email='donh@obiwan.etcscan.com'
cf_time='Tue Jun 23 11:42:05 PDT 1998'
chgrp=''
chmod=''
chown=''
clocktype='clock_t'
comm='comm'
compress=''
contains='grep'
cp='cp'
cpio=''
cpp='cpp'
cpp_stuff='42'
cppflags='-I/usr/local/include'
cpplast='-'
cppminus='-'
cpprun='cc -E'
cppstdin='cc -E'
cryptlib=''
csh='csh'
d_Gconvert='gcvt((x),(n),(b))'
d_access='define'
d_alarm='define'
d_archlib='define'
d_attribut='undef'
d_bcmp='define'
d_bcopy='define'
d_bincompat3='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
d_bsdpgrp='undef'
d_bsdsetpgrp='undef'
d_bzero='define'
d_casti32='define'
d_castneg='define'
d_charvspr='undef'
d_chown='define'
d_chroot='define'
d_chsize='undef'
d_closedir='define'
d_const='define'
d_crypt='define'
d_csh='define'
d_cuserid='define'
d_dbl_dig='define'
d_difftime='define'
d_dirnamlen='undef'
d_dlerror='define'
d_dlopen='define'
d_dlsymun='undef'
d_dosuid='undef'
d_dup2='define'
d_eofnblk='define'
d_eunice='undef'
d_fchmod='define'
d_fchown='define'
d_fcntl='define'
d_fd_macros='define'
d_fd_set='define'
d_fds_bits='define'
d_fgetpos='define'
d_flexfnam='define'
d_flock='undef'
d_fork='define'
d_fpathconf='define'
d_fsetpos='define'
d_ftime='undef'
d_getgrps='define'
d_setgrps='define'
d_gethent='define'
d_gethname='undef'
d_getlogin='define'
d_getpgid='define'
d_getpgrp2='undef'
d_getpgrp='define'
d_getppid='define'
d_getprior='define'
d_gettimeod='define'
d_gnulibc='undef'
d_htonl='define'
d_index='undef'
d_inetaton='define'
d_isascii='define'
d_killpg='define'
d_link='define'
d_locconv='define'
d_lockf='define'
d_lstat='define'
d_mblen='define'
d_mbstowcs='define'
d_mbtowc='define'
d_memcmp='define'
d_memcpy='define'
d_memmove='define'
d_memset='define'
d_mkdir='define'
d_mkfifo='define'
d_mktime='define'
d_msg='define'
d_msgctl='define'
d_msgget='define'
d_msgrcv='define'
d_msgsnd='define'
d_mymalloc='define'
d_nice='define'
d_oldarchlib='undef'
d_oldsock='undef'
d_open3='define'
d_pathconf='define'
d_pause='define'
d_phostname='undef'
d_pipe='define'
d_poll='define'
d_portable='define'
d_pwage='define'
d_pwchange='undef'
d_pwclass='undef'
d_pwcomment='define'
d_pwexpire='undef'
d_pwquota='undef'
d_readdir='define'
d_readlink='define'
d_rename='define'
d_rewinddir='define'
d_rmdir='define'
d_safebcpy='undef'
d_safemcpy='undef'
d_sanemcmp='define'
d_seekdir='define'
d_select='define'
d_sem='define'
d_semctl='define'
d_semget='define'
d_semop='define'
d_setegid='undef'
d_seteuid='undef'
d_setlinebuf='undef'
d_setlocale='define'
d_setpgid='define'
d_setpgrp2='undef'
d_setpgrp='define'
d_setprior='define'
d_setregid='define'
d_setresgid='undef'
d_setresuid='undef'
d_setreuid='define'
d_setrgid='undef'
d_setruid='undef'
d_setsid='define'
d_sfio='undef'
d_shm='define'
d_shmat='define'
d_shmatprototype='define'
d_shmctl='define'
d_shmdt='define'
d_shmget='define'
d_sigaction='define'
d_sigsetjmp='define'
d_socket='undef'
d_sockpair='undef'
d_statblks='define'
d_stdio_cnt_lval='define'
d_stdio_ptr_lval='define'
d_stdiobase='define'
d_stdstdio='define'
d_strchr='define'
d_strcoll='define'
d_strctcpy='define'
d_strerrm='strerror(e)'
d_strerror='define'
d_strtod='define'
d_strtol='define'
d_strtoul='define'
d_strxfrm='define'
d_suidsafe='undef'
d_symlink='define'
d_syscall='define'
d_sysconf='define'
d_sysernlst=''
d_syserrlst='define'
d_system='define'
d_tcgetpgrp='define'
d_tcsetpgrp='define'
d_telldir='define'
d_time='define'
d_times='define'
d_truncate='define'
d_tzname='define'
d_umask='define'
d_uname='define'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
d_voidtty=''
d_volatile='define'
d_vprintf='define'
d_wait4='undef'
d_waitpid='define'
d_wcstombs='define'
d_wctomb='define'
d_xenix='undef'
date='date'
db_hashtype='u_int32_t'
db_prefixtype='size_t'
defvoidused='15'
direntrytype='struct dirent'
dlext='so'
dlsrc='dl_dlopen.xs'
dynamic_ext='Fcntl IO NDBM_File Opcode POSIX SDBM_File'
eagain='EAGAIN'
echo='echo'
egrep='egrep'
emacs=''
eunicefix=':'
exe_ext=''
expr='expr'
extensions='Fcntl IO NDBM_File Opcode POSIX SDBM_File'
find='find'
firstmakefile='makefile'
flex=''
fpostype='int'
freetype='void'
full_csh='/bin/csh'
full_sed='/bin/sed'
gcc=''
gccversion=''
gidtype='gid_t'
glibpth='/usr/shlib  /shlib /usr/lib/pa1.1 /usr/lib/large /lib
/usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small
/usr/ccs/lib /usr/ucblib /usr/local/lib '
grep='grep'
groupcat=''
groupstype='gid_t'
gzip='gzip'
h_fcntl='true'
h_sysfile='true'
hint='recommended'
hostcat=''
huge=''
i_bsdioctl=''
i_db='undef'
i_dbm='undef'
i_dirent='define'
i_dld='undef'
i_dlfcn='define'
i_fcntl='define'
i_float='define'
i_gdbm='undef'
i_grp='define'
i_limits='define'
i_locale='define'
i_malloc='define'
i_math='define'
i_memory='undef'
i_ndbm='define'
i_neterrno='undef'
i_niin='define'
i_pwd='define'
i_rpcsvcdbm='undef'
i_sfio='undef'
i_sgtty='undef'
i_stdarg='define'
i_stddef='define'
i_stdlib='define'
i_string='define'
i_sysdir='define'
i_sysfile='define'
i_sysfilio='undef'
i_sysin='undef'
i_sysioctl='define'
i_sysndir='undef'
i_sysparam='define'
i_sysresrc='define'
i_sysselct='define'
i_syssockio=''
i_sysstat='define'
i_systime='define'
i_systimek='undef'
i_systimes='define'
i_systypes='define'
i_sysun='define'
i_syswait='define'
i_termio='undef'
i_termios='define'
i_time='define'
i_unistd='define'
i_utime='define'
i_values='define'
i_varargs='undef'
i_varhdr='stdarg.h'
i_vfork='undef'
incpath=''
inews=''
installarchlib='/work/donh/public/lib/perl5/i386-dynixptx/5.00404'
installbin='/work/donh/public/bin'
installman1dir='/work/donh/public/man/man1'
installman3dir='/work/donh/public/lib/perl5/man/man3'
installprivlib='/work/donh/public/lib/perl5'
installscript='/work/donh/public/bin'
installsitearch='/work/donh/public/lib/perl5/site_perl/i386-dynixptx'
installsitelib='/work/donh/public/lib/perl5/site_perl'
intsize='4'
known_extensions='DB_File Fcntl GDBM_File IO NDBM_File ODBM_File
Opcode POSIX SDBM_File Socket'
ksh=''
large=''
ld='cc'
lddlflags='-G -L/usr/local/lib'
ldflags=' -L/usr/local/lib'
less='less'
lib_ext='.a'
libc=''
libperl='libperl.so'
libpth='/usr/local/lib /lib /usr/lib'
libs='-lsocket -lnsl -ldl -lld -lm -lc -lcrypt -lPW'
libswanted='sfio net socket nsl nm ndbm gdbm dbm db malloc dl dld ld
sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
line='line'
lint=''
lkflags=''
ln='ln'
lns='/bin/ln -s'
locincpth='/usr/local/include /opt/local/include /usr/gnu/include
/opt/gnu/include /usr/GNU/include /opt/GNU/include'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib
/usr/GNU/lib /opt/GNU/lib'
longsize='4'
lp=''
lpr=''
ls='ls'
lseektype='off_t'
mail=''
mailx=''
make='/bin/make'
make_set_make='#'
mallocobj='malloc.o'
mallocsrc='malloc.c'
malloctype='void *'
man1dir='/work/donh/public/man/man1'
man1direxp='/work/donh/public/man/man1'
man1ext='1'
man3dir='/work/donh/public/lib/perl5/man/man3'
man3direxp='/work/donh/public/lib/perl5/man/man3'
man3ext='3'
medium=''
mips=''
mips_type=''
mkdir='mkdir'
models='none'
modetype='mode_t'
more='more'
mv=''
myarchname='i386-dynixptx'
mydomain='.etcscan.com'
myhostname='obiwan'
myuname='dynixptx obiwan 4.0 v4.4.2 i386 '
n=''
nm_opt=''
nm_so_opt=''
nroff='nroff'
o_nonblock='FNDELAY'
obj_ext='.o'
oldarchlib=''
oldarchlibexp=''
optimize='-O'
orderlib='false'
osname='dynixptx'
osvers='4.0'
package='perl5'
pager='/local/less'
passcat=''
patchlevel='4'
path_sep=':'
perl='perl'
perladmin='donh@obiwan.etcscan.com'
perlpath='/work/donh/public/bin/perl'
pg='pg'
phostname='hostname'
plibpth=''
pmake=''
pr=''
prefix='/work/donh/public'
prefixexp='/work/donh/public'
privlib='/work/donh/public/lib/perl5'
privlibexp='/work/donh/public/lib/perl5'
prototype='define'
randbits='15'
ranlib=':'
rd_nodata=''
rm='rm'
rmail=''
runnm='false'
scriptdir='/work/donh/public/bin'
scriptdirexp='/work/donh/public/bin'
sed='sed'
selecttype='fd_set *'
sendmail='sendmail'
sh='/bin/sh'
shar=''
sharpbang='#!'
shmattype='void *'
shortsize='2'
shrpenv='env
LD_RUN_PATH=/work/donh/public/lib/perl5/i386-dynixptx/5.00404/CORE'
shsharp='true'
sig_name='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS
PIPE ALRM TERM USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN
TTOU VTALRM PROF XCPU XFSZ IOT CLD POLL '
sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31 6 18 22 '
signal_t='void'
sitearch='/work/donh/public/lib/perl5/site_perl/i386-dynixptx'
sitearchexp='/work/donh/public/lib/perl5/site_perl/i386-dynixptx'
sitelib='/work/donh/public/lib/perl5/site_perl'
sitelibexp='/work/donh/public/lib/perl5/site_perl'
sizetype='size_t'
sleep=''
smail=''
small=''
so='so'
sockethdr=''
socketlib=''
sort='sort'
spackage='Perl5'
spitshell='cat'
split=''
ssizetype='ssize_t'
startperl='#!/work/donh/public/bin/perl'
startsh='#!/bin/sh'
static_ext=' '
stdchar='unsigned char'
stdio_base='((fp)->_base)'
stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)'
stdio_cnt='((fp)->_cnt)'
stdio_ptr='((fp)->_ptr)'
strings='/usr/include/string.h'
submit=''
subversion='4'
sysman='/usr/local/man/man1'
tail=''
tar=''
tbl=''
test='test'
timeincl='/usr/include/sys/time.h /usr/include/time.h '
timetype='time_t'
touch='touch'
tr='tr'
troff=''
uidtype='uid_t'
uname='uname'
uniq='uniq'
usedl='define'
usemymalloc='y'
usenm='false'
useopcode='true'
useperlio='undef'
useposix='true'
usesfio='false'
useshrplib='true'
usevfork='false'
usrinc='/usr/include'
uuname=''
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
zcat=''
zip='zip'
PATCHLEVEL=4
SUBVERSION=4
CONFIG=true




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

Date: Wed, 24 Jun 1998 18:01:23 GMT
From: dougb@world.std.com (doug a blaisdell)
Subject: Detect "file system is full", etc from Perl?
Message-Id: <Ev2I2B.LMH@world.std.com>

Hi everbuddy!
Does anyone know how to detect system type errors that aren't
the result of system(), backticks, exec() etc, eg:

	open( OUT, ">junk" );
	while( 1) {
		print OUT "Fill up the disk\n";
	}

will eventually fill up the disk. How do you detect this within Perl,
so you can abort/recover, etc? "$?" doesn't seem to get set in such 
cases, and "print OUT "blah" || die "out of space"; didn't work either.

thanks,
doug




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

Date: 24 Jun 1998 18:12:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Detect "file system is full", etc from Perl?
Message-Id: <6mrfic$ol8$4@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    dougb@world.std.com (doug a blaisdell) writes:
"print OUT "blah" || die "out of space"; didn't work either.

Precedence.

    (print OUT "blah") 		|| die "can't write: $!";
     print OUT "blah" 		or die "can't write: $!";

--tom
-- 
If you take Fred Cohen's definition of virus, then Unix itself is
one of the most successful viruses ever written, since it tends to
result in the creation of modified versions of itself on other
computer systems!  -- Gene Spafford


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

Date: Wed, 24 Jun 1998 11:40:32 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Detect "file system is full", etc from Perl?
Message-Id: <MPG.ffae7f9fbb9bae99896c0@nntp.hpl.hp.com>

In article <Ev2I2B.LMH@world.std.com>, doug a blaisdell 
<dougb@world.std.com> says...
> Hi everbuddy!
> Does anyone know how to detect system type errors that aren't
> the result of system(), backticks, exec() etc, eg:
> 
> 	open( OUT, ">junk" );
> 	while( 1) {
> 		print OUT "Fill up the disk\n";
> 	}
> 
> will eventually fill up the disk. How do you detect this within Perl,
> so you can abort/recover, etc? "$?" doesn't seem to get set in such 
> cases, and "print OUT "blah" || die "out of space"; didn't work either.

Modulo Tom C's correction of the syntax of your error check, a recent 
thread points out that in a real program (not an infinite loop!), you 
could dispense with the checks on every print (as apparently almost 
everyone does), and check the close instead.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 24 Jun 1998 18:19:15 GMT
From: birgitt@my-dejanews.com
Subject: Re: first language - last language
Message-Id: <6mrfv3$2p7$1@nnrp1.dejanews.com>

In article <3588E674.50B81564@nortel.co.uk>,
  "F.Quednau" <quednauf@nortel.co.uk> wrote:


> Perl is the first laguage that I am trying to explore in depth. And that is
> because Perl is what it is, and  Fortran, Delphi and VBasic failed to do the
> same, that is, gripping my imagination. I perceive Perl as a kind of freestyle
> language, where you have so many ways to do something that people tend to say
> 'this is no good for a beginner'. But hey, you can grow with the language, and
> you can use Perl on a very basic level (I know what I am talking about). And,
> not to forget, Perl is FREE. It's availability is excellent, Documentation is
> good, and you get to speak to nice people :). So if you like coolness, and a
> bit of weirdness , go for Perl! I luvvit!
>

And I 'luvve' this thread - very luvvly statements from ol' realist
programming moms and dads. So I can't resist:

  What is the *last* language all you experts would ever want to
  deal with ? Don't say there isn't one.

Who bets with me ? Will the thread be as long from here on
as it was for *first* language ?

:-)

Birgitt Funk

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Wed, 24 Jun 1998 11:50:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: first language - last language
Message-Id: <MPG.ffaea668cbbc81d9896c2@nntp.hpl.hp.com>

In article <6mrfv3$2p7$1@nnrp1.dejanews.com>, birgitt@my-dejanews.com 
<birgitt@my-dejanews.com> says...

>   What is the *last* language all you experts would ever want to
>   deal with ? Don't say there isn't one.

There are so many!  Cobol because it is too wordy; APL because it is too 
terse; Pascal because it is uselss; Ada because it is overblown; ...

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 24 Jun 1998 14:16:20 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Flames....
Message-Id: <fl_aggie-2406981416210001@aggie.coaps.fsu.edu>

In article <6mj4st$941$1@rushlight.kf8nh.apk.net>, allbery@kf8nh.apk.net wrote:

+ Not to mention the overworked (print) graphic designers who get websites
+ dumped in their lap by order of the management.  (I've seen this happen.)
+ They might learn about Perl by seeing books on display at the local bookstore,
+ or the boss may have said "oh, I hear there's this thing called Perl used for
+ web programming:  learn it".

And they still have to become programmers. I believe the correct
response is "I'm not a programmer, but you want me to do this. I need
training. Will you send me to City X for N Days so I can learn?"

Whether or not the cost will scare the Pointy-Haired Fool into cancelling
the project is left to one's fevered imagination.

James


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

Date: Wed, 24 Jun 1998 18:42:51 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Flames....
Message-Id: <1db4sun.wkb97yzeww41N@roxboro0-044.dyn.interpath.net>

T. Ames <ames0009@tc.umn.edu> wrote:

Not quoting any of a previous article is either rude or the result of
ignorance (and occasionally both).  Which was it in this case?

> Part of the problem here is that there are a group of Perl experts who
> read this NG with no intention of ever asking questions of the group.

That's probably because this isn't a help desk or even a simulation of
it.

> Now, of course, this can be seen as solely a positive -- but some of
> the time it has a down side.  Rather than coming to the group in the
> spirit of mutual aid, they (some of them, not all) come here in the
> guise of an oracle.

And maybe it's because they like discussing the fine points of perl, but
don't generally need help.

> An oracle that will only deign to answer questions if they are posed in
> just the right manner -- otherwise "hellfire and brimstone."

The "right" manner is fairly broad, and those who ask outside the
boundaries of "right' deserver hellfire and brimstone.

> The arrogance of this attitude has really created a hostile atmosphere
> in this group.  This is not to say that there are none to blame on the
> other "side" (the newbies).  But what the newbies do they usually do
> out of ignorance -- and what some of the experts do is done out of
> malice.  Going out of one's way to insult someone is childish....
> 
> (Now tell me that posting stupid questions is childish, etc,
> etc.....and it never ends).

No, it's not childish - it simply shows that you aren't serious and so
don't deserve a serious answer.

-- 
John Moreno


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

Date: Wed, 24 Jun 1998 18:43:09 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Flames....
Message-Id: <1Nbk1.33$t32.537201@news2.voicenet.com>

T. Ames <ames0009@tc.umn.edu> wrote:
>Part of the problem here is that there are a group of Perl experts who
>read this NG with no intention of ever asking questions of the group.

And I'm extremely glad they do!

>Now, of course, this can be seen as solely a positive -- but some of
>the time it has a down side.  Rather than coming to the group in the
>spirit of mutual aid, they (some of them, not all) come here in the
>guise of an oracle.  An oracle that will only deign to answer
>questions if they are posed in just the right manner -- otherwise
>"hellfire and brimstone."  

And Perl will only run your program if it is posed in just the right
manner.  Having to follow the syntax of programming or the rules the 
'oracles' impose is a good thing.  The oracles have something I want.
Information.  If they choose to make me think about what I ask, and how
I ask it, then I will.  Their guidelines aren't random.  Their
guidelines make this group better for everyone.

>The arrogance of this attitude has really created a hostile atmosphere
>in this group.

I don't find this to be true at all.  I see dozens of questions, from the
inane to the esoteric, answered here every day.

>This is not to say that there are none to blame on the
>other "side" (the newbies).  But what the newbies do they usually do
>out of ignorance --

Is ignorance an excuse then?

>and what some of the experts do is done out of
>malice.  Going out of one's way to insult someone is childish....

I don't think _anybody_ here posts out of malice.  If that were so, they
could easily be killfiled and ignored since you would have nothing to
learn from them.  Sometimes the only correct answer is "You are a
bonehead.  Go consult the docs."  How else would you answer the question
"How do I compare two strings for equality?"  Making sure the person
realizes that this is a moronic question is _very_ important.  Gentle
suggestions that this isn't an appropriate question to ask here just
don't work.  More force is required.

>(Now tell me that posting stupid questions is childish, etc,
>etc.....and it never ends).

I don't think anybody doesn't realize that posting stupid questions is
childish.  The question is how to handle these questions, because they
aren't going to stop.  Does a gentle message get the idea across?  I
don't think so.

You are right, though.  It never ends.

-- 
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"


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

Date: 24 Jun 1998 18:06:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Matching problem. Empty variable not matching.
Message-Id: <6mrf6l$ol8$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Laurence Brockman <laurence@vhealth.vegnet.com> writes:
:    foreach $entry (@line) {
:        $_ = $entry;
:        if (/$args[$i]/i) {

That's superterrible.  Very very bad.  So slow.
See the faq for how to fix this horror.

:All the arguments passed to this function currently are "" except for
:the first line (Which is a line from a database - fields being seperated
:by ";;"). Now with all the the other arguments being null they should
:math no matter what the comparison is, correct? 

Certainly not.  A null regex doesn't do what you think it
does.  It matches the last match.  Consider:

    # inspired by :1,$g/fred/s//WILMA/
    while (<>) {
        ?(fred)?    && s//WILMA $1 WILMA/;
        ?(barney)?  && s//BETTY $1 BETTY/;
        ?(homer)?   && s//MARGE $1 MARGE/;
    } continue {
        print "$ARGV $.: $_";
        close ARGV  if eof();           # reset $.
        reset       if eof();           # reset ?pat?
    }

Yes, Larry Rosler, this is coming soon to a manpage near you.

--tom
-- 
    The only disadvantage I see is that it would force everyone to get Perl.
    Horrors.  :-)
                    --Larry Wall in  <8854@jpl-devvax.JPL.NASA.GOV>


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

Date: Wed, 24 Jun 1998 17:59:33 GMT
From: Charles Maier <maierc@chesco.com>
Subject: Re: NEED HELP !!!!!!
Message-Id: <35913F6D.180D@chesco.com>

Ok.. I am bored..Your question and the way you posed (2X) your problem
makes me wonder why you are asking?? You are printing directly from an
associative array. 

Do the keys themselves exist?? You are calling them out by "hard coding
them" so I assume the key is there. 
Where does the data come from?? Can you not insure no BLANK data comes
in?? And all the keys you use to print have data?? If you can say yes to
both.. you don't need to test it at print time... and you would get no
blank lines... ;o)

Perl uses 2 functions... 

'exists' is used to see if the KEY exists
'defined' is used to see if the DATA has been defined

These can be used along with a test of the appropriate lines of your
code. 

I honestly can not understand your problem as posed... but doubt
seriously posting it TWICE is the way to get an answer or make friends
on this NG. ;O(

Hope this helps..
Sorry to hear about your FIC
Chuck 


delta wrote:
> 
> How could I avoid to get a "space line" type:
> ----------------------------------
> ---------------------------------
> ---------------------------------
> when nothing is drop in a FIC value
> Look at the PRINT FIC script
> and if nothing have been write in the titre3 field (or other field) , I get
> blank line in my FIC
> print FIC "$in{'lieu2'}\n";
>  print FIC "$in{'titre1'}\n";
>  print FIC "--------------------------\n";
>  print FIC "$in{'texte1'}\n";
>  print FIC "--------------------------\n";
>  print FIC "$in{'titre2'}\n";
>  print FIC "--------------------------\n";
>  print FIC "$in{'texte2'}\n";
>  print FIC "--------------------------\n";
>  print FIC "$in{'titre3'}\n";
>  print FIC "--------------------------\n";
> Thanks for your help


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

Date: Wed, 24 Jun 1998 12:44:54 -0600
From: Matthew Lovell <lovell@fc.hp.com>
Subject: Newbie question: object inheritance in perl/Tk
Message-Id: <35914926.32D28048@fc.hp.com>

Hi,

I'm writing a perlTk script which uses a Tk::Tree widget with a couple
of very minor subroutines for filling in and manipulating the
hierarchical list.  I'd like to make an object out of this new widget,
having it inherit all the methods from Tk::Tree.

My attempt at coding this is below.  The constructor for my object makes
a new Tk::Tree object, then blesses it into class hierarchy (
@hierarchy::ISA = qw(Tk::Tree) ), packs it, and then attempts to ->add()
one entry to it.

When I run, I get the following error message:

bad option "add": must be cget or configure at
/home/lovell/misc/perl/tree.pl line 563, <F> chunk 31.

Stepping through with the debugger hasn't given me much insight into
what I'm doing wrong.  Is there something special about Tk objects?  Is
everything I'm attempting just all wrong?

If there is a FAQ relevant to this, I will gladly go read it and leave
you all in peace.  I didn't see where I was disobeying anything in the
Perl or Perl/Tk FAQs (on a very quick inspection).


Thanks,
  Matt



use strict; no strict 'vars';
use Tk;
use Tk::Widget;
use Tk::Tree;

use lib qw(/home/lovell/smerced/tools/generic/perl_lib);
use RVP;
use Message;

 ...

go_gui(%options, vdb => $vdb);


sub go_gui {
  my %param = @_;

  # Make main window
  my $top = new MainWindow( -title => "Tk Connect" );
  $top->optionAdd( '*Scrollbar.width' => '2.5m' );

  # Make hierarchy widget
  my $tree = new hierarchy ($top, %param);

  # Add button
  my $ok = $top->Button( qw/-text Exit -underline 0 -width 6/,
			 -command => sub { exit } );
  $ok->pack(qw/-side left  -padx 10 -pady 10/ );
  
  # Activate interface
  MainLoop();    

} # go_gui



package hierarchy;

# Construct the module hierarchy widget
#
#  Arguments: 
#
#    class             Passed implicitly
#    top               Reference to widget for main window
#
#    remainder taken as named
#
#    NAME              DESCRIPTION                              DEFAULT
#    -------------------------------------------------------------------
#  Required
#    vdb               Reference to RVP object
#    module            Module at which to root hierarchy
#
sub new {
  @ISA = qw(Tk::Tree);
  my $class = shift;
  my $top   = shift;
  my %param = @_;

 
  my $tree = $top->Scrolled("Tree",
			    -separator => '.',
			    -exportselection => 1,
			    -scrollbars => "osoe",
			    -width => 40,
			    -height => 30
			   );
  bless $tree, $class;
    
  $tree->pack(-expand => 'yes',
	      -fill   => 'both',
	      -padx   => 10,
	      -pady   => 10,
	      -side   => 'top' );

  $tree->add("test",
	     -text => "Howdy There"
             );

  return $tree;
} # tree


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

Date: 24 Jun 1998 18:02:04 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: system() and security again
Message-Id: <6mreus$ol8$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    lr@hpl.hp.com (Larry Rosler) writes:
:I have been trying to cool down for an hour, waiting for someone else to 
:intervene in this "discussion".  Now, *you* have defined your 
:participation here as "fun".  It is clear that "fun" for you includes 
:supercilious sarcastic SADISM.

Oh, Larry, be at peace.  

:> As is documented in perlfunc; at least, in my version. :-)
:> The manpage?
:
:Where is the smiley on *that* response???

It was it the previous line, of course.

:FOR SHAME!!!

No, for irony.  I did document it.  And I admitted
that it wasn't generally publicly available.  
Do I have to perform hyperlinear interpolation on
every possible ramification? 

I was being humorous and ironic.  It isn't undocumented --
anymore.  I fixed it, gosh, days ago. :-)

The number of things that I know about Perl that I haven't 
gotten documented yet is diminishing, but not non-zero.  I
am trying.  Hopefully the Perl Cookbook should fix a lot of that.
As the companion book to Programming Perl, it does close many
gaps we didn't cover last time around.

--tom
-- 
    "Text processing has made it possible to right-justify any idea, even
    one which cannot be justified on any other grounds."
		    --J. Finnegan, USC.


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

Date: Wed, 24 Jun 1998 11:34:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: system() and security again
Message-Id: <MPG.ffae671bb7baa269896bf@nntp.hpl.hp.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <6mreus$ol8$1@csnews.cs.colorado.edu>, Tom Christiansen 
<tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, 
>     lr@hpl.hp.com (Larry Rosler) writes:
> :I have been trying to cool down for an hour, waiting for someone else to 
> :intervene in this "discussion".  Now, *you* have defined your 
> :participation here as "fun".  It is clear that "fun" for you includes 
> :supercilious sarcastic SADISM.
> 
> Oh, Larry, be at peace.  

My time and adrenalin are too valuable to be f***ed around with so 
glibly.

> :> As is documented in perlfunc; at least, in my version. :-)
> :> The manpage?
> :
> :Where is the smiley on *that* response???
> 
> It was it the previous line, of course.

Which was in a separate response.  No smiley for Mark Haber.

> :FOR SHAME!!!
> 
> No, for irony.  I did document it.  And I admitted
> that it wasn't generally publicly available.  
> Do I have to perform hyperlinear interpolation on
> every possible ramification? 
> 
> I was being humorous and ironic.  It isn't undocumented --
> anymore.  I fixed it, gosh, days ago. :-)

Which immediately makes it subject to RTFM.  :-(

> The number of things that I know about Perl that I haven't 
> gotten documented yet is diminishing, but not non-zero.  I
> am trying.  Hopefully the Perl Cookbook should fix a lot of that.
> As the companion book to Programming Perl, it does close many
> gaps we didn't cover last time around.
> 
> --tom

On the generous assumption that you have chosen this line of response 
because at Usenix you don't have ready access to the new documentation, I 
will presume to enlighten those readers who may actually be interested in 
the technical aspects of 'system BLOCK LIST' by sharing the documentation 
I was sent by Guy Decoux (thanks again, Guy; nous vous remercions 
beaucoup!):

             If you don't really want to execute the first
             argument, but want to lie to the program you are
             executing about its own name, you can specify the
             program you actually want to run as an "indirect
             object" (without a comma) in front of the LIST.
             (This always forces interpretation of the LIST as a
             multivalued list, even if there is only a single
             scalar in the list.)  Example:
 
                 $shell = '/bin/csh';
                 exec $shell '-sh';          # pretend it's a login shell
 
             or, more directly,
 
                 exec {'/bin/csh'} '-sh';    # pretend it's a login shell
 
             When the arguments get executed via the system
             shell, results will be subject to its quirks and
             capabilities.  See the section on `STRING` in the
             perlop manpage for details.

             Using an indirect object with exec or system is also
             more secure.  This usage forces interpretation of
             the arguments as a multivalued list, even if the
             list had just one argument.  That way you're safe
             from the shell expanding wildcards or splitting up
             words with whitespace in them.
 
                 @args = ( "echo surprise" );
 
                 system @args; # subject to shell escapes if @args == 1
                 system { $args[0] } @args; # safe even with one-arg list
 
             The first version, the one without the indirect
             object, ran the echo program, passing it "surprise"
             an argument.  The second version didn't--it tried to
             run a program literally called "echo surprise",
             didn't find it, and set $? to a non-zero value
             indicating failure.

-- 
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

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

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