[8028] in Perl-Users-Digest
Perl-Users Digest, Issue: 1653 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 16 10:07:29 1998
Date: Fri, 16 Jan 98 07:00:33 -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 Fri, 16 Jan 1998 Volume: 8 Number: 1653
Today's topics:
"Real World" perl comparisons? (Lynchqvctc)
Book review wanted (Brad McFarlane)
CC from a perl (mail script) <w.vaarwerk@dp.dpfinance.nl>
Re: CC from a perl (mail script) <dangross@frii.com>
CGI.pm <jim39@interworldnet.net>
Re: CGI.pm (Clay Irving)
Re: Command Line Arguments in MacPerl (Chris Nandor)
Re: Cost of a 3 day Perl training course <joseph@5sigma.com>
Re: counting entries in a file <joseph@5sigma.com>
Re: Debugger?? <david.x.corcoran@boeing.com>
Re: Efficiency: for high number indicies, use array or <joseph@5sigma.com>
Re: Efficiency: for high number indicies, use array or (Jeffrey R. Drumm)
Getting the first two chars of a string - URGENT! <bholness@nortel.ca>
Re: Getting the first two chars of a string - URGENT! <wd@uebemc.siemens.de>
globs passed from command line (Ben Glazer)
Re: globs passed from command line <tchrist@mox.perl.com>
help - errors installing libwww-perl on FreeBSD (Ken Gaugler)
Helpful people <brett@moggy.com>
How to read A:\ from web site (Spur Electron Ltd)
Re: How to read A:\ from web site <ebohlman@netcom.com>
Re: IIS on NT and perl32 <mcol@ictlux.com>
Re: Pattern match of no character, any character, or sp (Bart Lateur)
Re: Perl appears VERY slow <jim39@interworldnet.net>
Perl dies with segmentation fault and leaves a core <rwp@omni.ac.uk>
queueing system <eeparrad@swansea.ac.uk>
Reg Expression, Case change of memory variables <lach@lach.net>
Re: Searching in directories? (Don)
Re: source into binary code (Bart Lateur)
Re: source into binary code <tchrist@mox.perl.com>
Re: source into binary code <dformosa@st.nepean.uws.edu.au>
Re: Temporary or Internal Files or Dummy Filehandles <ebohlman@netcom.com>
Re: Win95: can I associate file type with perl script? <jwilson@ic.ac.uk>
WWWBoard Help <jonsa@mindless.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Jan 1998 13:56:19 GMT
From: lynchqvctc@aol.com (Lynchqvctc)
Subject: "Real World" perl comparisons?
Message-Id: <19980116135600.IAA09156@ladder01.news.aol.com>
Am learning perl on a Win95 setup (Hey! I have to use what I've got! :) )
And have been finding-- by trial and error, as well as by searching FAQ's,
reading different books etc.--the similarities and differences between perl/OS
setups (eg. what you can and can't do on a Win95 that you can/can't do on
NT/Unix etc.). One BIG area I seem to be stuck in, as an example, is the
effective use of databases....
What I am wondering is whether anyone doing the development of perl (or anyone
who is using it in depth) has a detailed understanding of the problems and
limits of the specific non-unix systems, with current versions of perl? In my
reading of FAQ's etc. I am gathering that a new version of perl might eliminate
many of the problems found in some of the latest Win32 versions, but this
sounds like a "fuzzy" promise (hard to get a focus on, not clear on the
specific "fixes" it might bring etc.)
Sorry for the length of this-- please bear with me: I am finding perl to be
very promising in some of the very practical things it can do (I don't need to
tell most readers here)... What amazes me most is what I've been able to do
with it, with NO technical background, on a puny Pentium with Win95. It seems
to have so much potential that it would be a shame to neglect tapping even the
power of these puny desktops. (Puny today-- was a "powerhouse" yesterday!)
I don't mean this as a rhetorical question, but as a practical one-- are there
folks who are giving such concerns serious attention?
------------------------------
Date: Fri, 16 Jan 1998 08:39:39 +0500
From: Brad_McFarlane@qmail.newbridge.com (Brad McFarlane)
Subject: Book review wanted
Message-Id: <Brad_McFarlane-ya023180001601980839390001@newshost>
A local remaindered book sale has:
Teach Yourself CGI Programming with Perl 5 in a week, 2nd Ed.
by Eric Herrmann (publisher SAMS) for CDN$20, with a CD-ROM included. I know
a bit of Perl, and have used the CGI module to do some CGI programming;
with my appetite whetted, I want to get a bit futher into it, and this
looks like a good book to help me. I checked various Perl web pages, and
couldn't find a review of it. Has anybody got it or read it? If so, how is
it? I figure for $20 it won't be a big loss, but if it's as bad as some of
the books mentioned in the "Camel Critiques", I want to steer clear.
Any info would be appreciated.
Thanks,
Brad
--
Brad McFarlane
Newbridge Networks Corp.
Kanata, Ont. CANADA
------------------------------
Date: Fri, 16 Jan 1998 15:17:59 +0100
From: Werner <w.vaarwerk@dp.dpfinance.nl>
Subject: CC from a perl (mail script)
Message-Id: <34BF6C13.93F02B02@dp.dpfinance.nl>
Hi all,
I'm trying to send a carbon copy from my mailscript. Underneeth I'll
show you my working code now:
print MAIL "Subject: $mailsub\n";
print MAIL "From: $mailsender\n";
?????print MAIL "CC: me@myaddress.com\r\n";????????
print MAIL "To: $c{mailto}\n";
print MAIL "X-mailer-disclaimer: Any part of these mail headers may not
be accurate\n";
print MAIL "X-URL: ",$ENV{'REFERER_URL'},"\n" if $ENV{'REFERER_URL'};
Can anyone tell me what I'm doing wrong?
TIA,
Werner Vaarwerk
------------------------------
Date: Fri, 16 Jan 1998 07:39:15 -0700
From: Dan Gross <dangross@frii.com>
To: w.vaarwerk@dp.dpfinance.nl
Subject: Re: CC from a perl (mail script)
Message-Id: <34BF7113.565904CB@frii.com>
You probably need to escape your '@' so it doesn't look like an array
('\@'). Just a guess.
Werner wrote:
> Hi all,
>
> I'm trying to send a carbon copy from my mailscript. Underneeth I'll
> show you my working code now:
>
> print MAIL "Subject: $mailsub\n";
> print MAIL "From: $mailsender\n";
> ?????print MAIL "CC: me@myaddress.com\r\n";????????
> print MAIL "To: $c{mailto}\n";
> print MAIL "X-mailer-disclaimer: Any part of these mail headers may not
> be accurate\n";
> print MAIL "X-URL: ",$ENV{'REFERER_URL'},"\n" if $ENV{'REFERER_URL'};
>
> Can anyone tell me what I'm doing wrong?
>
> TIA,
> Werner Vaarwerk
------------------------------
Date: Fri, 16 Jan 1998 05:01:09 -0700
From: Builders Connection <jim39@interworldnet.net>
Subject: CGI.pm
Message-Id: <34BF4C05.1AF7@interworldnet.net>
Where can you get CGI.pm and can it be used to run a script thru
without put it on your server?
--
=================================================
Hope you like your e-mail!
This is from Jim's wonderful box of replies!
Remember to write back: <Jim39@interworldnet.net>
=================================================
Or visit my site at:
<http://www.builders-connection.com>
------------------------------
Date: 16 Jan 1998 09:05:24 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: CGI.pm
Message-Id: <69npf4$okn@panix.com>
In <34BF4C05.1AF7@interworldnet.net> Builders Connection <jim39@interworldnet.net> writes:
>Where can you get CGI.pm
http://www.perl.com/CPAN/modules/by-module/CGI/
For additional information:
http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html
>and can it be used to run a script thru without put it on your server?
Sure.
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: Fri, 16 Jan 1998 08:02:47 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Command Line Arguments in MacPerl
Message-Id: <pudge-1601980802470001@ppp-2.ts-1.kin.idt.net>
In article <garts-ya023080001501982112040001@news.direct.ca>,
garts@direct.ca (D. Graham Arts) wrote:
# So here I am, sitting at my Mac, typing in some source code in MacPerl. All
# of the code in the book has, so far, worked like a charm. I have no reason
# to expect that the code requiring command line arguments would pose any
# significant problems in MacPerl. Unfortunately, I don't know how to start
# up a script that accepts command line arguments in MacPerl. I suspect that
# it has something to do with the 'one liner' menu command, but I haven't
# gotten it to work yet. So...
#
# Can anybody tell me how to get a script running with command line arguments
# in MacPerl?
Depends on what you mean. You can pass -w and -l and most others on the
#!perl line. If you mean the stuff that goes into @ARGV, then there are
innumerable ways to do it. Yes, sometimes the One Liner command will
work; you can just feed it any perl one-liner, like:
perl -MLWP::Simple -e 'getprint(q"http://www.perl.com/")'
But if you really want to do command-line stuff with MacPerl, your best
bet is MPW, a (now) freely available Mac programming environment from
Apple. MacPerl was originally, and still is, available as an MPW tool.
So the above command is just typed into the worksheet window, you hit
ENTER, and off it runs.
--
Chris Nandor pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
#== MacPerl: Power and Ease ==#
#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
------------------------------
Date: Fri, 16 Jan 1998 02:01:38 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Cost of a 3 day Perl training course
Message-Id: <34BF21A3.8E0AE3B2@5sigma.com>
I highly recommend you hire one of us (I work with Randal) or
else make *very* sure you get someone of good quality. While
web instructors are everywhere, good Perl instructors are hard
to find (I hear this from customers all the time). It's no different
hiring a Perl instructor than it is hiring an OO guru for
a seminar -- the good ones cost $2k+ per day and when you amortize
that over a room full of students, it's worth it. If you ask
potential students, you will obviously find that they want the
best instructor they can get. Otherwise, what's the point?
-joseph
http://www.effectiveperl.com
http://www.perltraining.com
Bradley M. Kuhn wrote:
>
> What is the reasonable cost (per day) if a company wants to bring in a Perl
> trainer (to teach the language basics) to a group of 20-30 people for 3 days
> or so?
>
> I realize that it depends on the experience of the trainer. Obviously,
> getting tchrist@mox.perl.com or merlyn@Stonehenge.com is not so cheap, but
> what would someone with good Perl skills and reasonable training skills (as
> opposed both excellent training and Perl skills) cost per day?
------------------------------
Date: Fri, 16 Jan 1998 01:55:48 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: counting entries in a file
Message-Id: <34BF2045.4F0FC97F@5sigma.com>
When you hear "counting occurrences" the natural response in
Perl is "use a hash." The keys are whatever you're counting and
the values are the counts.
-joseph
root wrote:
>
> I'm writing a custom web analysis tool in perl to count up the total number of
> searches on my site -- that's the easy part. The part I'm having some
> difficulty with is I want to list the top 10 entries for the file. The
> file looks something like this:
> t
------------------------------
Date: Fri, 16 Jan 1998 14:09:30 GMT
From: David Corcoran <david.x.corcoran@boeing.com>
Subject: Re: Debugger??
Message-Id: <34BF6A1A.6CA2@boeing.com>
Scott Norris wrote:
>
> 1> Is there a perl debugger program?? for Windows??
have you tried:
perl -d script.pl
?
------------------------------
Date: Fri, 16 Jan 1998 01:54:34 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Efficiency: for high number indicies, use array or hash?
Message-Id: <34BF1FFB.6F59F2D3@5sigma.com>
Since Perl arrays are NOT sparse, yeah, this could have some
memory and efficiency implications. :-)
-joseph
http://www.effectiveperl.com
David Adler wrote:
>
> I'm working on a project that will involve indexing information by
> invoice number. Since they're numbered, I figured, hey, why not just
> use an array? Then I thought about it and realized that the lowest
> number would be around 100000, which set me to wondering if I'd be
> taking an efficiency hit by doing this.
------------------------------
Date: Fri, 16 Jan 1998 13:25:20 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: Efficiency: for high number indicies, use array or hash?
Message-Id: <34c05bbe.3001135865@news.mmc.org>
On 15 Jan 1998 15:31:49 -0500, David Adler <dha@panix.com> wrote:
>I'm working on a project that will involve indexing information by
>invoice number. Since they're numbered, I figured, hey, why not just
>use an array? Then I thought about it and realized that the lowest
>number would be around 100000, which set me to wondering if I'd be
>taking an efficiency hit by doing this. This comes straight from the
>hindbrain, so it may have no relation to reality, but I have this
>niggling feeling that a whole bunch of memory might get allocated that
>I'm never going to use (i. e. for all those lower numbered pieces of
>array). Am I losing it, or is this the case? Are there any other
>efficiency issues I'm glossing over? Would a hash be a better way to
>go?
>
>Any ideas on this would be greatly appreciated.
>
>Thanks.
I've got to be missing something here, knowing how far down the "Perl
perfection" scale I am, but it seems to me you don't have to waste any space at
all, assuming your invoice numbers are otherwise consecutive and your starting
invoice number is 100000. Why not:
$index = $invoice_num - 100000;
$invoice_data = $invoices[$index];
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: Fri, 16 Jan 1998 09:29:02 +0000
From: Ben Holness <bholness@nortel.ca>
Subject: Getting the first two chars of a string - URGENT!
Message-Id: <34BF285E.7E7E@nortel.ca>
Hi all,
If anyone knows how to return the first two chars of a string, please
could you let me know as soon as possible.
The situation is as follows:
I have a variable ($temp) which holds a string similar to "4R65" or
"Q6E2" etc.
I would like to be able to get just the first two chars of the string,
ie "4R" or "Q6" (as in the examples above).
Does anyone know how to do this?
Cheers
Ben
--
_____________________________________
/ \
| *-=Ben Holness=-* |
| |
| Dept. 7e24 % bholness@nortel.ca |
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
| ESN: 590-4957 % PSTN: (01628) 434957 |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
------------------------------
Date: 16 Jan 1998 09:47:12 GMT
From: Wolfgang Denk <wd@uebemc.siemens.de>
Subject: Re: Getting the first two chars of a string - URGENT!
Message-Id: <69nab0$abp$1@galaxy.mchh.siemens.de>
Ben Holness <bholness@nortel.ca> writes:
>If anyone knows how to return the first two chars of a string, please
>could you let me know as soon as possible.
RTFM.
For instance "man perlfunc": substr EXPR,OFFSET,LEN
Wolfgang Denk
Office: (+49)-89-722-27328, Fax -36703 wd@uebemc.siemens.de
Private: (+49)-89-95720-110, Fax -112 wd@denx.muc.de
At the source of every error which is blamed on the computer you will
find at least two human errors, including the error of blaming it on
the computer.
------------------------------
Date: Fri, 16 Jan 1998 13:53:22 GMT
From: ben.glazer@mail.utexas.edu (Ben Glazer)
Subject: globs passed from command line
Message-Id: <34bf6565.16054485@newshost.cc.utexas.edu>
I'm trying to pass a possibly-wildcarded filename from the command
line, so I start off like this:
@files = glob $ARGV[0]; # glob filenames from command line
But if I don't pass in the wildcard in double quote marks, perl
apparently resolves it into a single filename which it then passes to
$ARGV[0]. How can I avoid this restriction? I want to be able to say
perl mew.pl *.txt
tia,
Ben
------------------------------
Date: 16 Jan 1998 14:45:54 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: globs passed from command line
Message-Id: <69nrr2$t15$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, ben.glazer@mail.utexas.edu (Ben Glazer) writes:
:But if I don't pass in the wildcard in double quote marks, perl
:apparently resolves it into a single filename which it then passes to
:$ARGV[0]. How can I avoid this restriction? I want to be able to say
: perl mew.pl *.txt
It's not Perl. It's your shell. The general answer is:
Don't do that.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Remember though that
THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR.
--Larry Wall in the perl man page
------------------------------
Date: Wed, 14 Jan 1998 21:15:17 GMT
From: keng@hybrid.com (Ken Gaugler)
Subject: help - errors installing libwww-perl on FreeBSD
Message-Id: <34bd291e.102634212@news.hybrid.com>
Hello people.
Well I've gotten stuck again, installing and configuring all of the
perl stuff I think I will need. Trying to run the "torture.pl" script
from Issue 8 of The Perl Journal gave me error messages stating that
libwww-perl could not be found. OK, so the README for libwww-perl
says I needed to install MIME-Base64, libnet, and MD5 before trying to
install libwww-perl. No problem installing those; the tests all
succeeded. But when I get to the "make test" step, I get a bunch of
error messages like:
...
robot/rules.........dubious
Test returned status 1 (wstat 256, 0x100)
robot/ua............dubious
Test returned status 1 (wstat 256, 0x100)
local/autoload......dubious
Test returned status 1 (wstat 256, 0x100)
local/get...........dubious
Test returned status 1 (wstat 256, 0x100)
local/http..........dubious
Test returned status 1 (wstat 256, 0x100)
local/protosub......dubious
Test returned status 1 (wstat 256, 0x100)
FAILED--29 test scripts could be run, alas--no output ever seen
*** Error code 2
Stop.
The error messages suggest that MD5 is not installed, but I did
install it successfully in the /usr/src/perl5.004_04/ext/MD5-1.7
directory. Does it need to be somewhere else? What did I do wrong?
Thanks in advance!
-Ken
------------------------------
Date: Fri, 16 Jan 1998 22:44:22 +1100
From: "Brett" <brett@moggy.com>
Subject: Helpful people
Message-Id: <69nhda$dn5$1@droppa.tpgi.com.au>
I'm at the earliest stages of learning Perl (and finding it hard to get
motivated). Eventually I want to be able to write Perl scripts myself for
the net, and to use that knowledge to help others learn (as I do with my
Graphic Arts skills and Webdesigning).
The problem is, when I am trying to figure stuff out, I can't find anyone to
help me. Australia is a dumb place to be if you want to learn something.
You guys (northern hemispherians) are always offline and in bed when I am
trying to find helpful people on IRC or wherever.
Can anyone here help me solve a problem that is too difficult to explain in
one posting?
I'd like to hear from you guys - talk to me...
regards,
Brett Phillips
http://www.moggy.com
------------------------------
Date: Fri, 16 Jan 1998 09:10:08 GMT
From: dmitchell@spurelec.demon.co.uk (Spur Electron Ltd)
Subject: How to read A:\ from web site
Message-Id: <884941864.14579.1.nnrp-11.c1ed1262@news.demon.co.uk>
I'm using the following code to check for a file on the A:\ drive
$FileLocation = 'a:/newisin.dat';
if (!-e "$FileLocation") {
print "<br><br><br><font size=2 face=Arial>";
print "Cannot find the file for uploading !<br><br>";
exit;}
This works fine when run on my local system but when called from my
web site, the drive isn't checked and so the file is never found.
What do I have to do to check the client's drive ?
If possible please reply via email to dmitchell@spurelec.demon.co.uk
and david@pafc.demon.co.uk
Thanks
Dave.
dmitchell@spurelec.demon.co.uk
------------------------------
Date: Fri, 16 Jan 1998 12:09:17 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: How to read A:\ from web site
Message-Id: <ebohlmanEMvLrH.E75@netcom.com>
Spur Electron Ltd <dmitchell@spurelec.demon.co.uk> wrote:
: I'm using the following code to check for a file on the A:\ drive
: $FileLocation = 'a:/newisin.dat';
: if (!-e "$FileLocation") {
: print "<br><br><br><font size=2 face=Arial>";
: print "Cannot find the file for uploading !<br><br>";
: exit;}
: This works fine when run on my local system but when called from my
: web site, the drive isn't checked and so the file is never found.
: What do I have to do to check the client's drive ?
You can't. Period. At least not via a CGI script running on an HTTP
server. Your -e test is looking for a file on the *server's* A: drive,
if it even has one (not likely if it's a Unix server!). I suggest you
get a good tutorial on CGI and HTTP, as you seem to have some serious
misconceptions about how they work.
------------------------------
Date: 15 Jan 1998 20:40:41 +0100
From: Marc Colling <mcol@ictlux.com>
Subject: Re: IIS on NT and perl32
Message-Id: <lvsoqpa5l2.fsf@sonyx.ictlux.com>
Bob Trieger <bob.trieger@fmr.com> writes:
hi,
you should print out a HTML header before any other output:
print "Content-type: text/html\n\n";
> 1. ------------------------------------------
> $search_directory = "C:\\ps";
> chdir ($search_directory);
> @files = `dir *.htm* /B /S|`;
> print "@files\n";
> foreach $file (@files) {
> chop($file);
--
von allen gedanken schaetz ich doch am meisten die interessanten
die sterne - http://www.sonymusic.de/Music/Progressive/DieSterne/
------------------------------
Date: Fri, 16 Jan 1998 10:02:53 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Pattern match of no character, any character, or space (word boundary)
Message-Id: <34c227cc.2107746@news.tornado.be>
cotal@delphi.com wrote:
>I need a SIMPLE way to match all 3 of the following;
>
>as/400 as 400 as400
Of course there's alway the brute force:
/as400|as\/400|as 400/
But, as other people have said: use a character class.
/as[\/ ]?400/
If you want to allow more ways of wrtining it, like
as-400
then you might think of using
/^as\W?400/
with \W representing tha character class of all non-word characters
(anything that is not a letter, a digit, or an underscore).
HTH,
Bart.
------------------------------
Date: Fri, 16 Jan 1998 05:14:39 -0700
From: Builders Connection <jim39@interworldnet.net>
To: Brian Wheeler <bdwheele@indiana.edu>
Subject: Re: Perl appears VERY slow
Message-Id: <34BF4F2F.EAF@interworldnet.net>
Jim Barber
I like your reply do you if there is some average time on a perl
program.
and can you compare this to the time given to you if you ping the
server, you know to see if it is the server.
Brian Wheeler wrote:
> Try this:
> add this to the beginning of the script:
> open(LOG,">>/tmp/timelog");
> print LOG "Start: ",time,"\n";
>
> at the end of the script:
> print LOG "Finish: ",time,"\n";
> close(LOG);
>
> This'll tell you how long the perl script ran. If its a really long time, then
> it could be two things:
> 1) its an OS problem:
> not enough memory?
> really busy process wise?
> mucho disk activity?
> 2) its a perl script problem:
> review your code and see if there's something you're doing
> that's slow :)
>
> If it didn't run slow, then its the webserver that's slow :)
>
> Brian
--
=================================================
Hope you like your e-mail!
This is from Jim's wonderful box of replies!
Remember to write back: <Jim39@interworldnet.net>
=================================================
Or visit my site at:
<http://www.builders-connection.com>
------------------------------
Date: Fri, 16 Jan 1998 09:13:32 +0000
From: Bob <rwp@omni.ac.uk>
Subject: Perl dies with segmentation fault and leaves a core
Message-Id: <34BF24BC.F1FC7103@omni.ac.uk>
Is there anything that a user script can do to cause a Segmentation
fault and core dump, or is it a perl bug?
Thanks,
Bob
root> dbx /usr/local/bin/perl core
dbx version 3.11.8
Type 'help' for help.
Core file created by program "wppd.pl"
signal Segmentation fault at >*[., 0x3ffbff9efb0] ldl r27,
4(r1)
(dbx) q
root> perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
Platform:
osname=dec_osf, osvers=3.2, archname=alpha-dec_osf
uname='osf1 omni.nott.ac.uk v3.2 214 alpha '
hint=previous, useposix=true, d_sigaction=define
bincompat3=n useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O2 -Olimit 3200', gccversion=
cppflags='-std -D_INTRINSICS -I/usr/local/include -D__LANGUAGE_C__'
ccflags ='-std -D_INTRINSICS -I/usr/local/include -D__LANGUAGE_C__'
stdchar='unsigned char', d_stdstdio=define, usevfork=true
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/shlib /lib /usr/lib /usr/ccs/lib
libs=-ldbm -ldb -lm
libc=/usr/shlib/libc.so, so=so
useshrplib=true, libperl=libperl.so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='
-Wl,-rpath,/usr/local/lib/perl5/alpha-dec_osf/5.00404/CORE'
cccdlflags=' ', lddlflags='-shared -expect_unresolved "*" -O3 -s
-L/usr/local/lib'
Characteristics of this binary (from libperl):
Built under dec_osf
Compiled at Nov 13 1997 15:32:12
@INC:
/usr/local/lib/perl5/alpha-dec_osf/5.00404
/usr/local/lib/perl5
/usr/local/lib/perl5/site_perl/alpha-dec_osf
/usr/local/lib/perl5/site_perl
/usr/local/lib/perl5/alpha-dec_osf
------------------------------
Date: Fri, 16 Jan 1998 12:20:57 +0000
From: Dean Parratt <eeparrad@swansea.ac.uk>
Subject: queueing system
Message-Id: <34BF50A9.7705@swansea.ac.uk>
I would like to use perl CGI to allow only one person to visit my web
site at any one time (don't ask me why), e.g I wish to create a queueing
system that allows one person to view the web site freely but if other
people try to log on to the site while it is in use they will be put
into a queue until the web site is not in use.
Does anybody have any ideas or know how to do something like this.
Thanks
Dean.
------------------------------
Date: Fri, 16 Jan 1998 08:50:15 -0600
From: Lach Dunlop <lach@lach.net>
Subject: Reg Expression, Case change of memory variables
Message-Id: <34BF73A7.5D8F975A@lach.net>
Okay here goes:
I have some lovely 1980 basic code that needs to be brought forward
from an obscure operating system OASIS. I'm going to be hosting it on a
Linux box. I'm trying to do some preprocessing on the files with perl.
Things are going well!! But I am trying to convert some embedded stings
of file names to lower case (unix way).
string: "APP.DATA.EMPLOYEES"
reqexp s/(APP)(\.)(\w+)(\.)(\w+)/$1\/$3\/$5/gi
result: "APP/DATA/EMPLOYEES"
In the above regular expression is it possible to convert to lower case
at the same time? I tried this
reqexp s/(APP)(\.)(\w+)(\.)(\w+)/($1=~ tr/A-Z/a-z)\/$3\/$5/gi
But this didn't work :))))
Also while I have your attention, How about a regular expression that
will convert all text to lower case EXCEPT the text in double quotes.
Thanks for any input, I love perl!!
Lach
------------------------------
Date: Fri, 16 Jan 1998 14:11:02 GMT
From: defike@ilstu.edu..spam.not (Don)
Subject: Re: Searching in directories?
Message-Id: <34bf6873.144651@news.ice.net>
Try using;
use File::Find;
find (\&yourprocessing, "$startdir");
sub yourprocessing
{
if (/blah_blah_cover.txt/)
{ print "Cover Page Found at: $File::Find::name\n"; }
}
This may not be exactly what you are after but by using File::Find you
will be able to recurse your directories. $File::Find::name will
contain the directory path and file name. $_ will contain only the
file name. The way I wrote the above it will work in reverse of your
request, i.e. it will tell you if there is a cover page, you can then
determine which ones don't.
On Wed, 14 Jan 1998 12:35:41 -0600, skulk@glue.umd.edu wrote:
>I am new to Perl and am trying to figure out how to do this problem.
>I need to search through directories to find out which files do not have a
>cover page, basically a file with blah_blah_cover.txt for each .txt in
>the directory. how do i go about this?
>
>-------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Fri, 16 Jan 1998 11:23:23 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: source into binary code
Message-Id: <34c839e1.6719799@news.tornado.be>
fl_aggie@thepentagon.com (I R A Aggie) wrote:
>I suspect the originator of this thread simply wishes to prevent potential
>customers from stealing code. That's best prevented via copyright and
>contract law.
But then you'd have to prove that they stole your code. That would be a
lot of hassle, wouldn't it?
Bart.
------------------------------
Date: 16 Jan 1998 12:02:50 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: source into binary code
Message-Id: <69ni9a$js9$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:
:I believe in many cases the security that is sought is not to keep
:people from exploiting holes in the program, but to keep people
:from copying or modifying the code.
Call it a mental blindspot if you will, but I for one have never
managed to understand that.
You know, if you give your code away, they can't
steal it. :-)
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Perl programming is an *empirical* science!
--Larry Wall in <10226@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 16 Jan 1998 11:47:54 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: source into binary code
Message-Id: <884951251.605539@cabal>
In <34BEEFC7.11B0029F@coos.dartmouth.edu> Chipmunk <rjk@coos.dartmouth.edu> writes:
>brian d foy wrote:
[...]
>> >students. You know, "Run this program a bunch of times and figure out
>> >what it does. Then write a program in Perl that does the same thing."
>>
>> sounds like hacking to me.
>By the definition of hacker you laid claim to above?
I think the true defintion rather then the media one.
>The student may have seemingly unlimited curiosity, although this is a
>homework problem. How enthusiastic will he get?
There are some quite pervese students out there.
>The student will probably not have an unending devotion to the task -
>see above.
see above.
>The student will most likely not be a master of technical trivia.
>That's why he's a student.
I think that its the optisit. The sole perpose of teching comp. sci is to
turn masters of technical trivia into masters of abstract trivia. This is
done becuase abstract trivia has better long term validity.
>If the student was already capable of hacking the compiled code,
>he probably wouldn't be taking that class.
If a student is capable of hacking compiled code, he should be takeing
that class.
--
Please excuse my spelling as I suffer from agraphia see the url in my header.
Never trust a country with more peaple then sheep.
Support NoCeM http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: Fri, 16 Jan 1998 12:01:44 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Temporary or Internal Files or Dummy Filehandles
Message-Id: <ebohlmanEMvLEw.DzC@netcom.com>
David Stashower <rc0230@email.mot.com> wrote:
: I need to create either a temporary or, better yet, an "internal" file in
: perl. What I mean is, I want to associate a filehandle directly with an
: array (list), without having to actually create a file, such that other
: operations can read from the filehandle as if it were a file.
You can do this with a tied filehandle. See perltie for usage examples.
------------------------------
Date: 16 Jan 1998 10:38:23 GMT
From: "Jeff Wilson" <jwilson@ic.ac.uk>
Subject: Re: Win95: can I associate file type with perl script?
Message-Id: <01bd226a$d85b1ed0$d53ec69b@leicester>
You could make a shortcut to perl.exe and add the full command in
properties.
--
Jeff Wilson
London - UK
Don Silvia <lyanddon@peapod.com> wrote in article
<01bd2217$75e3d6a0$0100a8c0@djsilvia.ma.ultranet.com>...
> Hi,
> I have a perl script that reads a text file, strips out some garbage and
> sends the good stuff to another text file. I create the output file with
> the same root filename as the input file, but a different extension. To
do
> this I search and replace on the filename string:
> s/prt/edt/ or die("Substitution failed");
> I run the perl script from a batch file (prtconv.bat) so I can just type
> the command and pass the input file name:
> perl -w d:\perl\scripts\prtconv.pl %1
> This works fine when run from the command line in a DOS box, but when I
try
> to associate the batch file with the file extension via explorer, the
> s/prt/edt/ won't work. I would appreciate it if anyone could tell me why
> the search and replace fails, as well as if there's a better way to
> associate a perl script with a file extension. Us windows kids fear the
> command line.
> Thanks,
> Don Silvia
>
------------------------------
Date: Fri, 16 Jan 1998 15:13:05 +0100
From: "Jon A." <jonsa@mindless.com>
Subject: WWWBoard Help
Message-Id: <34BF6AEE.781277EC@mindless.com>
I am trying to get a WWWBoard running, but when i try to post i get the
error:
Method Not Allowed
The requested method POST is not allowed for the URL
/~anotherpunk/cgi-bin/wwwboard.pl.
What is wrong?
E-mail any help to me directly, not (only) the NG, please.
--JON A--
------------------------------
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 1653
**************************************