[7482] in Perl-Users-Digest
Perl-Users Digest, Issue: 1108 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 1 05:17:08 1997
Date: Wed, 1 Oct 97 02:00:41 -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, 1 Oct 1997 Volume: 8 Number: 1108
Today's topics:
Re: Answer Found Sort of (Testing for non existance) <seay@absyss.fr>
Re: any faith in me? (Tad McClellan)
Re: any faith in me? <jgostin@shell2.ba.best.com>
Re: chopping second to last char? <bholzman@mail.earthlink.net>
Re: chopping second to last char? <seay@absyss.fr>
Re: Die and the Web <merlyn@stonehenge.com>
Re: Die and the Web (Abigail)
Re: Die and the Web <cs@zip.com.au>
Is it EBCDIC ? <k3dk@maristb.marist.edu>
Re: Many CGI/PERL forms don't work with Lynx? (Patrick Kellum)
Meta-Regexp-Q (tricky?) (Helmut Jarausch)
Re: Newbie ques: How to concatenate two strings? (Tad McClellan)
Re: Newbie ques: How to concatenate two strings? <seay@absyss.fr>
Re: NEWBIE: How do you check for Non existance of a fi <seay@absyss.fr>
Re: PERL and serial port <guenter@arithmos.com>
PERL FAQ -where is it? (Rimon E. Huque)
Re: PERL FAQ -where is it? (brian d foy)
Re: PERL FAQ -where is it? <seay@absyss.fr>
Re: Perl Sockets Chris-Thorp@rocketmail.com
Perl to C convertor <Eric_Hwang@hp.com>
Re: Perl to C convertor (brian d foy)
Re: regex for one "two three" four (Tad McClellan)
Re: Script can't find module! (Martien Verbruggen)
Re: splitting a tab delimited line (Tad McClellan)
Re: Unix -> NT conversion <garygda@bga.com>
Re: XS: sv_2mortal (when is it necessary?) (Charles DeRykus)
Re: XS: sv_2mortal (when is it necessary?) <Chris_Hill@mentorg.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 01 Oct 1997 10:05:20 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Answer Found Sort of (Testing for non existance)
Message-Id: <34320440.3BE6D714@absyss.fr>
[posted, but not mailed due to a munged address]
Grey Cloak wrote:
>
> #File exist test
>
> open(FILE1, $whatfile) || die
> "[WARN] $whatfile from $who not found\n";
> close;
Please say it isn't so. There is no need to go through the extra
overhead of opening a file just to find out if it exists. Read the
follow ups to your last posting to find out about the file test
operators.
Also, you call close() with no parameters. What do you think that you
are closing? What sort of error messages did you get? You are using
"-w" and "use strict;" aren't you?
- doug
------------------------------
Date: Tue, 30 Sep 1997 21:51:23 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: any faith in me?
Message-Id: <brds06.cp3.ln@localhost>
BrAnCh (branchms@foto.infi.net) wrote:
: Hi,
: I learned HTML form Laura Lemay's Teach yourself web publishing with
: HTML 3.2 in a week.
: and now i'm working on Teach yourself CGI programming with perl5 in a
: week (Eric Herrmann)
: is this enough for me to learn with, or would you suggest I read
: something else first??
If you are already a programmer,
then the docs included with the
perl distribution should be enough. Though buying O'Reilly books
(www.ora.com) is high on my list when I have money to spend...
Else
then you should learn to program. ;-)
I would think you'll need more books (though a Community College
course would be even better).
: with aspirations of being a web site developer in the next 3 months.
Good luck.
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 1 Oct 1997 07:21:31 GMT
From: Jeff Gostin <jgostin@shell2.ba.best.com>
Subject: Re: any faith in me?
Message-Id: <60stlr$3it$1@nntp1.ba.best.com>
Tad McClellan <tadmc@flash.net> wrote:
: then the docs included with the perl distribution should be enough.
: Though buying O'Reilly books (www.ora.com) is high on my list when I
: have money to spend...
I can't agree enough. I own "Learning" and "Programming". Both are
well-written, and provide good detail. There's a nice command / function /
builtin-thingy index included in the middle or so of the book that describes
each "thingy"'s usage. It's VERY nice to have. :) The only "warning" I'll
give you is that there's some... bizarre (but amusing) humor in various
portions of the books, particularly in some of the footnotes. This, coming
from a relative newbie, should be an adequate endorsement (*holds out hand
for the bribe money*). :)
--Jeff
------------------------------
Date: Tue, 30 Sep 1997 21:20:09 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: Tom Grydeland <Tom.Grydeland@phys.uit.no>
Subject: Re: chopping second to last char?
Message-Id: <3431A549.46E01061@mail.earthlink.net>
> > #!/usr/local/bin/perl -np
>
> Ehem: (quoting perlrun)
>
> To suppress printing use the -n switch. A -p overrides a -n
> switch.
oops. I thought it looked funny... Thanks!
>
> > cat _dosfile_ | perl dos2unix.pl > _unixfile_
>
> Useless use of cat #1 this week.
Yeah.. it's just a bad UNIX habit. Sometimes, if I'm building a long
pipline, I just put the 'cat <filename> |' at the beginning while I
think out the rest of the commands.
>
------------------------------
Date: Wed, 01 Oct 1997 09:50:18 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: chopping second to last char?
Message-Id: <343200BA.12458306@absyss.fr>
Brandon S. Allbery KF8NH; to reply, change void to kf8nh wrote:
>
> In <34305876.414F9593@students.wisc.edu>, on 09/29/97 at 08,
> Joshua Udall <jaudall@students.wisc.edu> said:
> +-----
> | In other words, DOS has (^J) and (^M) at the end of each line?
> +--->8
>
> Other way around, actually, as you noticed. "s/\015\012/\012/" will do it,
> although in practice "s/\015//" is good enough for most purposes (i.e.
> non-badly-formed lines).
IMHO that is hard to read. Look into the \cX type characters instead of
octal values. \cM matches ^M, which is what you want to remove from a
DOS file when converting to Unix.
- doug
------------------------------
Date: 30 Sep 1997 19:06:52 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: jhedley@mustangpcs.com (Jon Hedley)
Subject: Re: Die and the Web
Message-Id: <8cen6644oz.fsf@gadget.cscaper.com>
>>>>> "Jon" == Jon Hedley <jhedley@REMOVEmustangpcs.com> writes:
Jon> Greetings
Jon> All of the programming I do in Perl is for output to Web Browsers. I
Jon> cannot access error logs for my server. Therefore, die is of little
Jon> help, and I have been getting around this by making my own sub for
Jon> each program that prints the contents of $! and shuts down the
Jon> program. Is there a way that I can set die to output to STDOUT rather
Jon> than the error log?
This question would have been better answered in
comp.infosystems.www.authoring.cgi. Remember, most of the web is
Perl, but most of Perl is *not* about the Web. Perl has been around
for twice as long as the web, and has *many* more uses.
Having said that, see my Web Techniques columns at
http://www.stonehenge.com/merlyn/WebTechniques/
and notice that nearly all of them have "die" but none of them write
to the error log. :-)
I illustrate two major ways... using an eval block, and using a
$SIG{__DIE__} handler.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 335 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 1 Oct 1997 02:33:24 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Die and the Web
Message-Id: <slrn633dnm.565.abigail@betelgeuse.rel.fnx.com>
Randal Schwartz (merlyn@stonehenge.com) wrote on 1492 September 1993 in
<URL: news:8cen6644oz.fsf@gadget.cscaper.com>:
++ >>>>> "Jon" == Jon Hedley <jhedley@REMOVEmustangpcs.com> writes:
++
++ Jon> Greetings
++ Jon> All of the programming I do in Perl is for output to Web Browsers. I
++ Jon> cannot access error logs for my server. Therefore, die is of little
++ Jon> help, and I have been getting around this by making my own sub for
++ Jon> each program that prints the contents of $! and shuts down the
++ Jon> program. Is there a way that I can set die to output to STDOUT rather
++ Jon> than the error log?
++
++ This question would have been better answered in
++ comp.infosystems.www.authoring.cgi. Remember, most of the web is
++ Perl, but most of Perl is *not* about the Web. Perl has been around
++ for twice as long as the web, and has *many* more uses.
++
++ Having said that, see my Web Techniques columns at
++
++ http://www.stonehenge.com/merlyn/WebTechniques/
++
++ and notice that nearly all of them have "die" but none of them write
++ to the error log. :-)
++
++ I illustrate two major ways... using an eval block, and using a
++ $SIG{__DIE__} handler.
The simplest method would be:
#!/usr/local/bin/perl -wT;
use CGI;
use CGI::Carp qw (fatalsToBrowser);
For details, see the manual page.
CGI and CGI::Carp come with perl.
Abigail
------------------------------
Date: 1 Oct 1997 04:36:53 GMT
From: Cameron Simpson <cs@zip.com.au>
To: jhedley@mustangpcs.com (Jon Hedley)
Subject: Re: Die and the Web
Message-Id: <19971001151833-cameron-1-01289@sid.research.canon.com.au>
jhedley@REMOVEmustangpcs.com (Jon Hedley) writes:
| All of the programming I do in Perl is for output to Web Browsers. I
| cannot access error logs for my server. Therefore, die is of little
| help, and I have been getting around this by making my own sub for
| each program that prints the contents of $! and shuts down the
| program. Is there a way that I can set die to output to STDOUT rather
| than the error log?
My Favourite CGI Debug Trick:
BEGIN { $|=1;
open(STDERR,"|/usr/local/script/mailif -s cgi-script-name.cgi-err cameron");
unshift(@INC,'/u/cameron/etc/pl');
}
where "mailif" is a script (appended) which sends email only when its input
is non-empty. That unshift is to hook the script into my live version of
the supporting modules - leave out of installed CGIs.
This way:
- it shuts up when things work
- it mails you when things break
- die and other errors land in you inbox for inspection
This is tres tres useful to me.
--
Cameron Simpson, DoD#743 cs@zip.com.au http://www.zip.com.au/~cs/
I think you're confusing "recognizing" and "understanding" with "caring".
The net is cruel, sometimes, but always fair.
- Rick Gordon <rickg@crl.com>
#!/bin/sh
#
# Send mail only if input is not empty.
# - Cameron Simpson <cs@zip.com.au>
#
# Usage: mailif [-s subject] addresses...
#
subject=
case "$#,$1" in
0,*|1,*) ;;
*,-s) subject="Subject: $2"; shift; shift ;;
esac
[ $# = 0 ] && { echo "Usage: $0 [-s subject] addresses..." >&2; exit 2; }
them=$1; shift
while :
do
case $# in 0) break ;; esac
them="$them, $1"
shift
done
trap 'rm -f "$tmp"; exit 1' 1 15
tmp=/tmp/mailif.$$
sed -n -e '/^[ ]*$/d
:again
p
n
b again' >"$tmp"
if [ -s "$tmp" ]
then
( echo "To: $them"
[ -n "$subject" ] && echo "$subject"
echo
cat "$tmp"
) | /usr/lib/sendmail -oi -t
xit=$?
else
xit=0
fi
rm "$tmp"
exit $xit
------------------------------
Date: Mon, 29 Sep 1997 20:30:08 -0400
From: Vasanth Shenoy <k3dk@maristb.marist.edu>
Subject: Is it EBCDIC ?
Message-Id: <34304810.13B0@maristb.marist.edu>
Hi all,
I have script that gets some input from a form and does something
with the input(sends a mail). The script runs perfectly in Linux.
But when I try to use it in MVS/OS-390, it just does not work.
I know why it does not work! it does not work because we have to
interpret the escape sequenced letters properly. eg: : / , ~ ( ) etc.
I get a ^3A for a : ^2C for a , ...
I guess its not a EBSIC character becuase, even from a ASCII machine,
I get the same codes for these characters. So, what is the problem ?
Can someone help please ?
------------------------------
Date: 1 Oct 1997 08:11:41 GMT
From: patrick@syix.com (Patrick Kellum)
Subject: Re: Many CGI/PERL forms don't work with Lynx?
Message-Id: <60t0jt$tl$1@neko.syix.com>
For some reason, Tom Phoenix was chatting and out came these words of greatness:
>Maybe it's misinstalled on your system. To check, set up your favorite
>form (or a copy of it) to use this script as its action, and see what you
>get. Try it with any browser you wish, of course.
I tried it and it seemed to work fine with both GET and POST. I didn't
put much text in the textarea field, I'll try that next. I'm going to try
a few other ideas and see what happins.
Thanks for the info, the script was very interesting to read through as
well.
Patrick
---
A Title For This Page -- http://www.syix.com/patrick/
Bow Wow Wow Fan Page -- http://www.syix.com/patrick/bowwowwow/
"Pity there are no Martians to witness the spectacle of a kind of 15-foot
beach ball suddenly falling out of the sky and bouncing all about."
- Description of the Mars Pathfinder landing on Mars.
From a New York Times News Service story by John Noble Wilford
------------------------------
Date: 1 Oct 1997 07:57:16 GMT
From: jarausch@numa1.igpm.rwth-aachen.de (Helmut Jarausch)
Subject: Meta-Regexp-Q (tricky?)
Message-Id: <60svos$ahb$1@news.rwth-aachen.de>
Hi,
influenced by an atricle about 'infinite data structures' in the recent
TPJ (The Perl Journal) I came up with the following problem for which I
couldn't find a (good) solution. So, here it is
Given an anchored(^) regexp at runtime, I want to apply it to a very long
string of which I have (only) the first N bytes at hand.
Is there a (simple) technique to decide which of the following 3 cases applies?
i) the regexp matches and the matched string is the same as if the regexp
would have been applied to the full string
ii) the regexp fails and would fail on the full string also
iii) one cannot decide without knowing more of the string, hence one has to
get more of it.
This would be easy if the regexp machine would tell the last character it
has looked at.
Thanks for your ideas,
Helmut.
--
Helmut Jarausch
Lehrstuhl f. Numerische Mathematik
Institute of Technology, RWTH Aachen
D 52056 Aachen, Germany
------------------------------
Date: Tue, 30 Sep 1997 20:12:15 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <f18s06.uf3.ln@localhost>
Joseph (jglosz@san.rr.com) wrote:
: On Tue, 30 Sep 1997 12:25:18 +0200, Doug Seay <seay@absyss.fr> wrote:
: >Actually, she wasn't all that nasty. I've seen worse. And since it was
: >fairly funny, it was better than most flames on USENET. Try to
: >appreciate the situation and roll with the punches.
: I've seen worse too. Far, far worse. I guess I overreacted. Maybe it
: was a bad day, I don't know. Everyone else here seems to think I
: overreacted, so maybe I did.
: It was just her un-helpful post and attitude I guess....
Her post was **extremely** helpful. It told you exactly where to get
the definitive answer to your question. In the docs that come with
perl.
Her attitude was likely a direct consequence of asking a question on
Usenet that could have been answered in *seconds* by a simple word
search in the documentation that is *included with the perl distribution*
Consider for a few moments the difference in your (her's and your's)
experience. I don't really know her, so I'll use my experience as
an example.
I spend about an hour a day reading Usenet news. I have done this for
over two years. I have made about 2000 postings to c.l.p.m. I respond
to less than 10% of the articles that I read. I read about 20% of
articles posted (a good Subject line really does increase your
chances of getting your question answered).
So, going with the 1:10 response ratio (which is too high, I'm sure),
I have read about 20,000 c.l.p.m articles. I expect there were 20-50
of them that asked 'how do I concatenate two strings'.
Do you see how folks might get annoyed to see it yet again?
The man pages and FAQs were developed to avoid this frustration
(such frustration has lead to many good folks abandoning this
newsgroup altogether. They are no longer here to answer our
questions. We drove them away).
Only so that people can refuse (I don't know that you refuse, but
that is how I read your response to Abigail) to read them!
That would (and often does ;-) make me get huffy...
: >It was wrong of her to assume that you are using Unix. Did you
: >understand that she used "Unix-ese" to says
: >
: > look in "perlop" for "concatenate"
: >
: >If you prefer to fire up some sort GUI application for this, knock
: >yourself out. Most of us prefer the speed and versitility of the
: >commandline, but to each his own.
: Yes, I understood. But I didn't mean to say I'm running X windows or
: some other GUI on a unix box. I'm not running unix at all! My ISP has
: a unix server, so it runs perl-based CGIs. But I'm on Win95 and WinNT
: machines.
I figured that you understood and that you had some objection to
doing a word search in the docs (hence my email to you).
When you made the choice of an "OS" oriented toward consumers rather
than toward programmers, you should expect to have to translate a lot
when talking to programmers.
: >But also please remember that starting things off with "I know this has
: >GOT to be the ultimate newbie question, but I don't
: >know perl" leaves the impression that not only do you not know Perl, you
: >don't don't even feel like learning it.
: That may have been the impression, but it's not true. In fact, I did
: (and have) started to learn it. But I couldn't find this answer in the
: mishmash of online docs and the one book I have. Basically, I just
^^^^^^^^^^^^^^^^^^^^^^^
Bill's stuff does not provide a way to easily do a word search on
multiple files?
Abigail's suggested word to search for was taken from your very own
Subject line...
If Windoze doesn't give you an easy way, then write one (in perl, of course)
perl -ne 'print "$ARGV: $_" if /concatenate/' *.pod
: didn't have the right docs.
The right docs *come with* the perl distribution.
You do have perl, right?
Or do MS ports not include the Plain Old Documentation files?
: In fact, I found the "join" function on my own, but another poster
: here pointed out the dot operator, which works quite well.
: >If you want to learn Perl, we'll all be glad to help you. We'll point
: >you in the right direction and help you over the bumpy parts, but you
: >have to be the one to do the work. We aren't paid to do your job.
: >Hell, I don't know any of us who are paid to answer questions on USENET
: >(if so, are there any openings there :-).
: >
: Agreed. Sorry if I offended anyone. (That goes to you too, Abigail)
OK. I'll go remove that 'special' file entry that I had down for you ;-)
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 01 Oct 1997 09:48:08 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <34320038.BA9F39A@absyss.fr>
Joseph wrote:
>
> On Tue, 30 Sep 1997 12:25:18 +0200, Doug Seay <seay@absyss.fr> wrote:
> >It was wrong of her to assume that you are using Unix. Did you
> >understand that she used "Unix-ese" to says
> >
> > look in "perlop" for "concatenate"
> >
> >If you prefer to fire up some sort GUI application for this, knock
> >yourself out. Most of us prefer the speed and versitility of the
> >commandline, but to each his own.
>
> Yes, I understood. But I didn't mean to say I'm running X windows or
> some other GUI on a unix box. I'm not running unix at all! My ISP has
> a unix server, so it runs perl-based CGIs. But I'm on Win95 and WinNT
> machines.
I didn't think you were using Unix because no Unix user would complain
about "man | grep", even if using some all inclusive GUI. Dunno 'bout
Win95, but WinNT comes with an ugly DOS box that supports "find" which
allows you to look in files for strings so you can do the same sort of
thing. The flexiblity of the command line for doing things like this is
why most of us don't switch to all GUI systems.
> >But also please remember that starting things off with "I know this has
> >GOT to be the ultimate newbie question, but I don't
> >know perl" leaves the impression that not only do you not know Perl, you
> >don't don't even feel like learning it.
>
> That may have been the impression, but it's not true. In fact, I did
> (and have) started to learn it. But I couldn't find this answer in the
> mishmash of online docs and the one book I have. Basically, I just
> didn't have the right docs.
As Tad has already pointed out, the docs come with the standard
distribution. You just need to get into the habbit of looking there.
Since I've never seen any set of freeware docs as good as Perl's, it is
unlikely that you've had this luxuary before.
> In fact, I found the "join" function on my own, but another poster
> here pointed out the dot operator, which works quite well.
I'd guess that the dot would be faster than join. Since join is more
general purpose (it handles lists, not two scalars) it should be a bit
slower. You can use the Benchmark.pm module (standard distribution) to
time the code blocks if you want to verify this.
> Agreed. Sorry if I offended anyone. (That goes to you too, Abigail)
Wait a minute. You are not allowed to forgive and forget. That would
make me a peace maker, so my reputation as a rude read-the-FAQer would
suffer.
- doug
------------------------------
Date: Wed, 01 Oct 1997 09:56:57 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: NEWBIE: How do you check for Non existance of a file.
Message-Id: <34320249.67800ADC@absyss.fr>
Martien Verbruggen wrote:
>
> In article <slrn632nsb.l5o.spamtrap@greycloak.access.one.net>,
> spamtrap@greycloak.access.one.net (Grey Cloak) writes:
>
> > #if exist $whatfile ;
>
> if (-f $whatfile)
^^^
-f returns true if $whatfile is a normal file, false otherwise. This
"otherwise" includes it being a pipe, a socket, a directory, not
existing at all or whatever. For simple existance, use "-e".
In the case of ensuring that a .wav file is present (the original
problem), -f should usually work, but it isn't correct for the more
general problem.
- doug
------------------------------
Date: Tue, 30 Sep 1997 22:38:18 -0700
From: Guenter Steinbach <guenter@arithmos.com>
Subject: Re: PERL and serial port
Message-Id: <3431E1CA.15291DBA@arithmos.com>
Tom Phoenix wrote:
>
> On Tue, 30 Sep 1997, Vincent RABAH wrote:
>
> > Does anybody knows how to get data from a serail port ?
>
> Well, the people who have read section 8 of the Perl FAQ have more
> information than those who haven't. :-)
I am one who did, and I still couldn't get it to work. I want to
control a test instrument (logic analyzer) from a PC running NT4.0, and
I ended up using hyperterminal to send commands and capturing the data
from the instrument into a file. Horrible to use and horribly slow!
But from perl I could never get anything to come out the other end.
I'd be very interested in hearing from people who have actually used
serial ports on PCs under NT.
-
Guenter Steinbach Arithmos, Inc. guenter@arithmos.com
------------------------------
Date: 1 Oct 1997 04:00:33 GMT
From: rimon@sas.upenn.edu (Rimon E. Huque)
Subject: PERL FAQ -where is it?
Message-Id: <60sht1$kou$2@netnews.upenn.edu>
--
****************************************************************************
* *
* Rimon Huque *
* *
****************************************************************************
------------------------------
Date: Wed, 01 Oct 1997 01:28:39 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: PERL FAQ -where is it?
Message-Id: <comdog-ya02408000R0110970128390001@news.panix.com>
In article <60sht1$kou$2@netnews.upenn.edu>, rimon@sas.upenn.edu (Rimon E. Huque) wrote:
[snip 387 bytes - all of it in the signature]
to find the Perl FAQ, just type 'perl' [1] (without the quotes) in the
location bar of Netscape. you are magically wisked away to the
Programming Republic of Perl using one mouse click and four keystrokes.
there you will find, besides the requested FAQ, everything else you
might need. call it an oasis if you will. :)
[1]
<URL:http://www.perl.com/> is really where you will be going.
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 01 Oct 1997 10:13:23 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: PERL FAQ -where is it?
Message-Id: <34320623.7201FAA3@absyss.fr>
Rimon E. Huque wrote:
absolutely nothing
answering the question in the subject: the mini-FAQ is posted here
(comp.lang.perl.misc) twice a week. It has the URL of the webified
version. Of course there is already a complete copy of the FAQ that
comes with every perl installation. You can try the command
perldoc perlfaq
to read it. Of course, this won't work if your copy of Perl wasn't
properly installed.
- doug
------------------------------
Date: Tue, 30 Sep 1997 22:35:06 -0600
From: Chris-Thorp@rocketmail.com
Subject: Re: Perl Sockets
Message-Id: <875676314.22560@dejanews.com>
In article <341E6C88.61F7A836@acay.com.au>,
Dexter Plameras <dexterp@acay.com.au> wrote:
>
> HI
>
> I'm trying to write a network socket that will all for two way
> communication between programs. I have used the example in the O'Relliy
> Camel book
> to write one way communication sockets but I don't know how to write two
> way communications sockets.
>
> Please note I want to learn to write it from scratch so any reference
> material on the inernet or books that can be recommended
> would be appreciatted as well as perl codes.
>
> Dexter Plameras
Sorry, can't help you! I don't know a thing about Perl Sockets!!!!
Please forgive my ignorance, I'm more along the lines of Geography
and the French language! you guessed it, it's me, Haja! I just
happened to be surfing the newsgroups and came across your posting.
Anyhow, what do you think of the wave at www.wave.ca ? do u think it will
revolutionize the computer world in the near future? Dexter man, so
what's up? u can still email me at chris-thorp@rocketmail.com, it's a
permanent address. By the way, I got in touch with Paul Hughes, Marlies
Brown, anna metzdorf, michelle eyrich, and rob crothers! Anyhow, I should
be saying this in an email rather than spouting it out on this newsgroup.
Hope to hear from ya buddy!!
Haja
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Mon, 29 Sep 1997 14:24:30 -0700
From: "Eric Hwang" <Eric_Hwang@hp.com>
Subject: Perl to C convertor
Message-Id: <60p5v0$abp$1@ocean.cup.hp.com>
Is there a Perl to C convertor available on the net?
Eric_Hwang@hp.com
------------------------------
Date: Wed, 01 Oct 1997 01:22:28 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl to C convertor
Message-Id: <comdog-ya02408000R0110970122280001@news.panix.com>
In article <60p5v0$abp$1@ocean.cup.hp.com>, "Eric Hwang" <Eric_Hwang@hp.com> wrote:
> Is there a Perl to C convertor available on the net?
check out the Perl Language Home Page [1] for all of your Perl needs.
if you must, use your browser's Find feature to locate "compiler" on the
page.
good luck :)
[1]
<URL:http://www.perl.com/>
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 30 Sep 1997 22:02:32 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: regex for one "two three" four
Message-Id: <8ges06.kq3.ln@localhost>
Mark Haskamp (haskamp@lexis-nexis.com) wrote:
: I need a regular expression for a string that may or may not have
: quotes. For example:
: one two three
: "one" "two" "three"
: "one" two three
: .... you get the picture
: should be parsed as 'one', 'two', 'three'
: one "two three" four
: "one" "two three" four
: "one" "two three" "four"
: ....
: should be parsed as 'one', 'two three', 'four'
start with
Perl FAQ, part 4:
"How can I split a [character] delimited string except
when inside [character]?"
and modify it for your [character]s
: Thanks for the help.
Uh huh.
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 1 Oct 1997 06:58:22 GMT
From: mgjv@mali.comdyn.com.au (Martien Verbruggen)
Subject: Re: Script can't find module!
Message-Id: <60ssae$8cv$1@comdyn.comdyn.com.au>
In article <343e7f24.103045927@nntp.ix.netcom.com>,
simberg@interglobal.org (Rand Simberg) writes:
> push(@INC,'/usr/contrib/lib/perl5/i386-bsdos');
try:
use lib '/usr/contrib/lib/perl5/i386-bsdos';
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: Tue, 30 Sep 1997 22:12:34 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: splitting a tab delimited line
Message-Id: <23fs06.nt3.ln@localhost>
Ernie Johnson (tcm@tcmd.com) wrote:
: Anyone have some thoughts on what I need to do to be able to split a tab
: delimited text file?
Sure.
Let's turn to the very first weapon in our arsenal of professional
programmer's tricks (the docs that come with perl):
cd /dir/where/the/pod/files/are
perl -ne 'print if /tab/' *pod
Ackkk!
305 hits. Too much...
perl -ne 'print if /tab /' *pod
Ahhhh.
Much better only these ten lines:
-------------------------
my $stem_symtab = *{$stem}{HASH};
a laser printer, you can take a stab at this using
Whoops! You just put a tab and a formfeed into that filename!
print "\t" x ($tab/8), ' ' x ($tab%8); # tab over
\t tab (HT, TAB)
\t tab (HT, TAB)
matches a word followed by a tab, without including the tab in C<$&>.
here. Note that the C type is separated from the XS type with a tab and
(or one normal tab stop).
(Note: Most makes will require that there be a tab character that indents
-------------------------
Embedded in there is your answer.
Total elapsed time: 95 seconds (I'm a slow typer).
Usenet can take hours, days, or forever ;-)
That's what I would call a productivity boost.
Work smart. Use the docs.
: I'd have no problem using split( ) but don't know what to tell split() to
: split on.
Tell it to split on tabs.
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 30 Sep 1997 22:04:01 -0500
From: Gary Anderson <garygda@bga.com>
Subject: Re: Unix -> NT conversion
Message-Id: <3431BDA1.F947B6A9@bga.com>
Go to http://www.perl.hip.com/
Aaron wrote:
> Hi all
>
> I know this has been beaten to death
>
> but I have some Perl scripts on Unix
> they use CGI.pm
>
> I want to move them over to NT
> because the people with the web server didn't ask me what I thought
>
> Has anyone else out here attempted such a feat? What kind of problems did
> you find?
>
> I know there are some crazy differences, but I am going to work a lot of
> this out on a 95 machine and then move it over to NT.
>
> Any advice is appreciated.
------------------------------
Date: Wed, 1 Oct 1997 00:59:04 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: XS: sv_2mortal (when is it necessary?)
Message-Id: <EHCLEH.598@bcstec.ca.boeing.com>
In article <343144bd.0@cfanews.harvard.edu>,
Pete Ratzlaff <rpete@ascda3.harvard.edu> wrote:
> Just wrote my first real XS. Fantastic!
>
> The routine involved creating C strings and passing them
> back to Perl as scalars. Something like...
>
> >void
> >my_1st_xs(...)
> >
> > PPCODE:
> > char *str1="Perl scalar 1";
> > char *str2="Perl scalar 2";
> >
> > EXTEND(sp,2);
> > PUSHs(sv_2mortal(newSVpv(str1,length(str1))));
> > PUSHs(sv_2mortal(newSVpv(str2,length(str2))));
> >
> (No, this is not my XS routine, but just an example of how
> I passed the C strings back to Perl)
>
> The question:
>
> Is 'sv_2mortal' really necessary here? If so, then why?
>
> -------------
> Peter Ratzlaff Harvard-Smithsonian Center for Astrophysics
> Office B102 60 Garden St, MS 21, Cambridge MA 02138 USA
> <pratzlaff@cfa.harvard.edu> phone: 617 496 7714
Take a look at pg 331 of "Advanced Perl Programming" by
Sriram Srinivasan for an explanation of the "mortal" calls.
I concluded from reading Sriram that function arguments
passed on the stack need to be mortalized since they
live and die in the scope of that one-liner when they're
thrown on the stack. That way, neither the caller nor the
called function needs to be bothered with this garbage :)
But, best read the book. Many great explanations of Perl
internals.
HTH,
--
Charles DeRykus
------------------------------
Date: Wed, 01 Oct 1997 08:28:34 +0100
From: Chris Hill <Chris_Hill@mentorg.com>
Subject: Re: XS: sv_2mortal (when is it necessary?)
Message-Id: <3431FBA2.E1251A48@mentorg.com>
Pete Ratzlaff wrote:
> >void
> >my_1st_xs(...)
> >
> > PPCODE:
> > char *str1="Perl scalar 1";
> > char *str2="Perl scalar 2";
> >
> > EXTEND(sp,2);
> > PUSHs(sv_2mortal(newSVpv(str1,length(str1))));
> > PUSHs(sv_2mortal(newSVpv(str2,length(str2))));
> >
> Is 'sv_2mortal' really necessary here? If so, then why?
>
My understanding is yes. If you are are pushing things onto Perl's
stack then the they must be mortal. If they are not then you will
end up with a resource leak - when they get popped off the stack
and discarded they will persist in limbo.
The perlguts documentation talks about mortality in more detail.
:) Chris.
------------------------------
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 1108
**************************************