[8680] in Perl-Users-Digest
Perl-Users Digest, Issue: 2297 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 11 04:07:12 1998
Date: Sat, 11 Apr 98 01:00:42 -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 Sat, 11 Apr 1998 Volume: 8 Number: 2297
Today's topics:
Re: Bill Gates should be invited to O'Reilly's "Free So <elflord@pegasus.rutgers.edu>
Re: Bill Gates should be invited to O'Reilly's "Free So (Chris Nandor)
Re: Floating Point Precision - Help please <lr@hpl.hp.com>
Re: Floating Point Precision - Help please (Abigail)
Re: General Rudeness, e.g. Re: Need a web login script (Tom Mornini)
Re: General Rudeness, e.g. Re: Need a web login script (Tom Mornini)
Re: General Rudeness, e.g. Re: Need a web login script (Tom Mornini)
Re: General Rudeness, e.g. Re: Need a web login script <ajohnson@gpu.srv.ualberta.ca>
Re: General Rudeness, e.g. Re: Need a web login script (Tom Mornini)
Re: How to call a function every 15 seconds or so ? <jhoglund@mirage.skypoint.net>
Re: I need latest perl for HPUX, AIX, Solaris (Wolfram Schmidt)
Re: Info Regarding Perl 5.005 (Gabor)
Re: Intermittent Perl problems (Abigail)
Re: Is it just me? (error/bug? with "my") -- Interesti <rjk@coos.dartmouth.edu>
Re: Is it the code or is it the server? <jdf@pobox.com>
Nonblocking pipe reads from perl? (Todd West)
Re: Numeric validation (Abigail)
Re: Numeric validation (Abigail)
Perl and Netscape Suitespot and NT 4,0 HELP <nathan@cyberservices.com>
Re: Perl Compiler for NT (Abigail)
Re: Perl Compiler for NT <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: Perl Puzzle: How Many Contexts? <jdf@pobox.com>
Perl scripts for EDI? conover@netcom.com
Perl/Cgi Problem <adam@pacific-artists.demon.co.uk>
Re: print (Mark Waterous)
Re: Problem with SRC attribute when writing HTML file <melkor@Cal040031.student.utwente.nl>
Re: Regular expression strangeness (Abigail)
Re: stdin/out/err redirection in system() ??? <jhoglund@mirage.skypoint.net>
Re: Week of Month (Robert F. Harrison)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 11 Apr 1998 01:43:07 +0000
From: Donovan Rebbechi <elflord@pegasus.rutgers.edu>
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <352ECAAB.1FFD3C64@pegasus.rutgers.edu>
ben@hayamasa.demon.co.uk wrote:
>
> books with the freedoms removed. Several other freely redistributable
> works have been turned into books and taken out of the free realm by
> O'Reilly.
Hmmmm... still no examples. Of course, they distribute the Linux network
administrators guide, which is an LDP doc, but they didn't take the
copyright, and it is still public domain.
Personally, I have no problems with O'Reilly publishing.
some questions :
Who publish the most comprehensive sendmail book available ? ( my
nomination: ORA, Sendmail )
The best guide on networking I've seen ? nag. Yes, this is an LDP doc.
And ORA, demonstrating their commitment to free software, allowed the
document to stay under the same copyright.
The most comprehensive book on GPL UNIX tools ?: ORA, Unix powertools
is a leading contender at the very least.
Leading titles in generic linux books ? "Running linux" comes to mind.
The most comprehensive book on awk and sed ? very easy question !
"awk and sed" from ORA is the only such book I've seen in Barnes and
noble. NOTHING in PD even comes close to the info on sed that this book
contains. If it wasn't for that book, Sed would be one of these UNIX
tools that is a secret passed on only by word of mouth, guru to junior
guru... and I would have no idea how to use sed.
Comprehensive references on Bash, Tcsh, and Csh are all available from
ORA.
I own several of these books and they are always open, spread around my
computer desk (and on the floor, since my computer desk can fit only so
many). As a free software user, I thank ORA's contribution to the free
software community.
-- Donovan Rebbechi
*************************************************
* Lord of the Elves *
* http://pegasus.rutgers.edu/~elflord/ *
* elflord@pegasus.rutgers.edu *
*************************************************
------------------------------
Date: Sat, 11 Apr 1998 03:22:06 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <pudge-1004982321540001@dynamic500.ply.adelphia.net>
In article <t_patl.892242676@gano>, t_patl@qualcomm.com (Pat Luther) wrote:
# 1. That camel was NOT public domain before. It did not EXIST before. It
# was created by Edie Freedman specifically for the book.
# 2. It was adapted from a 19th century engraving, which is STILL non-
# proprietary (to quote the Tuscany Trading Company, which publishes
# books with images from the Dover Pictorial Archive that these were
# taken from "You may use the designs and illustrations from
# these books for graphics and craft applications free and without special
# permission."
It seems to be fact that usage of even the original engraving in
conjuction with Perl is a violation of O'Reilly's trademarks. Or *any*
camel, in fact. If I put a cartoon camel on a Perl book without
O'Reilly's permission, I have probably broken the law.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
#== New Book: MacPerl: Power and Ease ==#
#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
------------------------------
Date: Fri, 10 Apr 1998 19:04:21 -0700
From: Larry Rosler <lr@hpl.hp.com>
To: "Wayne Smith <wayne@mmmix.com>" <wayne@rwcc.com>
Subject: Re: Floating Point Precision - Help please
Message-Id: <352ECFA5.36CF474A@hpl.hp.com>
Wayne Smith wrote:
>
> Could anyone give me the syntax so that
>
> $result = 22 / 7 ;
>
> gives me 3.14 in the variable instead of 3.1428571429 etc.
>
> Replies sent to wayne@rwcc.com especially appreciated :-)
>From perlfaq4:
Does perl have a round function? What about ceil() and floor()?
Trig functions?
For rounding to a certain number of digits, sprintf or printf is usually
the easiest route.
>From me:
$result = sprintf '%.2f', $result;
If you want truncation, not rounding, try
$result = int(100 * $result) / 100;
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: 11 Apr 1998 02:28:47 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Floating Point Precision - Help please
Message-Id: <6gmkgv$23d$1@client3.news.psi.net>
Wayne Smith (wayne@mmmix.com) wrote on MDCLXXXIV September MCMXCIII in
<URL: news:352eb47a.0@newsread1.dircon.co.uk>:
++ Could anyone give me the syntax so that
++
++ $result = 22 / 7 ;
++
++ gives me 3.14 in the variable instead of 3.1428571429 etc.
Either you rewrite your libc, or you do $result = "3.14".
22/7 cannot be represented exactly as a binary number with a fixed
precision. Hence, the computer needs a close approximation. 3.1428571429
is a close approximation. 3.14 isn't. (In fact, 3.14 can't even be
represented as a fixed precision binary number)
Now, it might be that you want to print the result in 2 decimals.
In that case, the faq and/or manual will tell you how.
Abigail
--
perl -pwle '$_ .= reverse'
------------------------------
Date: Sat, 11 Apr 1998 06:44:25 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <tmorniniEr8LE2.rx@netcom.com>
Michael J Gebis (gebis@albrecht.ecn.purdue.edu) wrote:
: }It does amaze me how some people, who understand everything technical,
: }understand so little socially.
: }In other words, I completely agree.
: }The "protectors of the group" need a crash course in leadership by example.
: I couldn't help but notice that both of you also failed to answer the
: question.
Check dejanews. I answer the questions that I can, and make no claims
otherwise.
I answer more than I ask. I learn more by reading everyone else's posts
and the GREAT responses and dialog that the "few" provide. The recent
thread on arrays in scalar context was wonderful! I'm fairly sure that
everyone would be happy if each thread was every bit as good.
However, I learn new things each day from much simpler code examples
produced to answer some newbies question.
I'm NOT suggesting that this group doesn't have problems
with postings that don't belong. The problem with the keepers of
the sandbox is that they seem to think that the people who make
the posts that they don't like will actually read their responses
and act appropriately.
The net and these groups in particular are quite anonymous. Why allow shame
to control your actions when nobody knows who you are? You can always just
get a new account and begin to act appropriately should the need arise... :-(
I'll just finish with one simple question: What would happen if someone
asked an inappropriate question and EVERYONE failed to respond.
-- Tom Mornini
-- InfoMania
------------------------------
Date: Sat, 11 Apr 1998 07:00:10 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <tmorniniEr8M4B.1Mo@netcom.com>
Alan J. Flavell (flavell@mail.cern.ch) wrote:
: > The "protectors of the group" need a crash course in leadership by example.
: Let's see yours.
Check dejanews. I answer more than I ask. I don't believe many have
complained about my posts on technical subjects.
My point is that complete silence on the off-topic posts will be easier
on bandwidth, will add no noise to the list, and perhaps be more effective.
-- Tom Mornini
-- InfoMania
------------------------------
Date: Sat, 11 Apr 1998 06:55:00 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <tmorniniEr8Lvo.17q@netcom.com>
I R A Aggie (fl_aggie@thepentagon.com) wrote:
: + : Do you think that being rude to people who post questions that you deem
: + : aren't worthy will deter others from doing so? All this invective just
: + : to the general noise. Ignore them, tell them to RTFM, or give'm an URL,
: + : this "its my playground" attitude is really childish.
:
: + It does amaze me how some people, who understand everything technical,
: + understand so little socially.
: Too bad this isn't a social group. It's a technical group that happens
: to have some social aspects. It is, however, a technical newsgroup.
But the problem isn't a technical one, is it? And your approach doesn't
*seem* to be working. Obviously, I could be wrong. Does it seem better
to you?
: + In other words, I completely agree.
: That's nice. That and a $1.07 will get you a cup o' tea at Barnes & Noble.
What in the hell does that mean? My turn to say something useless:
Fish ride bicycles on exceeding rare occasions.
: + The "protectors of the group" need a crash course in leadership by example.
: I think the example needs to be "come, join us in c.l.p.moderated if
: you want some real discussion" and assign the newbies to the purgatory
: of c.l.p.misc until they can figure out how to post to the moderated
: newsgroup successfully.
: Consider it a right-of-passage. In the mean time, why don't you boys
: help out them thar newbies and answer their questions instead of whining
: about someone else being rude?
That sounds completely appropriate and level-headed.
-- Tom Mornini
-- InfoMania
------------------------------
Date: Sat, 11 Apr 1998 02:21:33 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <352F19FD.7E0C422E@gpu.srv.ualberta.ca>
Tom Mornini wrote:
[big snip]
>
> I'll just finish with one simple question: What would happen if someone
> asked an inappropriate question and EVERYONE failed to respond.
in all likelihood they would assume some sort of news delivery
error and repost the question every two hours until someone finally
replied mentioning its inappropriateness and thus providing some
evidence that the news service is actually working, whereupon they
might either find their answer in a more appropriate manner or
simply reword the question and begin the process again.
regards
andrew
--
"They're not soaking...they're rusting"
--my wife, on my dishwashing habits.
------------------------------
Date: Sat, 11 Apr 1998 07:50:26 GMT
From: tmornini@netcom.com (Tom Mornini)
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <tmorniniEr8oG3.5K9@netcom.com>
Andrew Johnson (ajohnson@gpu.srv.ualberta.ca) wrote:
: > I'll just finish with one simple question: What would happen if someone
: > asked an inappropriate question and EVERYONE failed to respond.
: in all likelihood they would assume some sort of news delivery
: error and repost the question every two hours until someone finally
: replied mentioning its inappropriateness and thus providing some
: evidence that the news service is actually working, whereupon they
: might either find their answer in a more appropriate manner or
: simply reword the question and begin the process again.
Put that way, you might be right. :-( I still don't think that the
rudeness is the right way to handle it, but this is certainly my last
post in this thread.
-- Tom Mornini
-- InfoMania
------------------------------
Date: 11 Apr 1998 03:27:58 GMT
From: Jamie Hoglund <jhoglund@mirage.skypoint.net>
Subject: Re: How to call a function every 15 seconds or so ?
Message-Id: <6gmnvu$fsp$4@shadow.skypoint.net>
Michael Shavel <mshavel@erols.com> wrote:
: So my question is, am I missing something basic (some timer function or
: something similar) or am I looking at something advanced (do I need to
: make this script multi-threaded, if indeed this is even a possibility)
: As always, thanks for any help and suggestions.
As people have pointed out, there is waitpid, but there is also SIGALRM
and alarm() calls that might be useful to you. (I played around with
alarm() once to give me a running clock) it's kind of a hassle though.
Jamie
------------------------------
Date: 11 Apr 1998 01:57:42 GMT
From: wschmidt@ikos2.iao.fhg.de (Wolfram Schmidt)
Subject: Re: I need latest perl for HPUX, AIX, Solaris
Message-Id: <6gmimm$m3c$1@news.BelWue.DE>
for AIX go to www-frec.bull.com
--
Email: Wolfram.Schmidt@iao.fhg.de
Voice: +49 711 970 2431
Fax: +49 711 970 2401
Office: Fraunhofer IAO, Holzgartenstr. 17, 70174 Stuttgart, Germany
------------------------------
Date: 11 Apr 1998 04:23:24 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: Info Regarding Perl 5.005
Message-Id: <slrn6its9l.ibg.gabor@vnode.vmunix.com>
In comp.lang.perl.misc, Randal Schwartz <merlyn@stonehenge.com> wrote :
# >>>>> "Jason" == Jason Gloudon <jgloudon@manitoba.bbn.com> writes:
#
# Jason> Allen Choy <achoy@us.oracle.com> wrote:
# >> Anyone know what kind of features will be available in perl 5.005?
#
# Jason> Big new feature : Multi-Threading.
#
# ... but only on platforms that support it. And it slows down your
# perl (whether you're using it or not) by 30%.
I wonder if it's worth it, then?
# Unix users have already had threads for three decades now, though --
# It's called "fork".
#
# Just another guy not waiting for the new release...
Hmm, that's not encouraging. I take it that upgrading to 5.005 isn't
something that most of us should do?
gabor.
--
if (instr(buf,sys_errlist[errno])) /* you don't see this */
-- Larry Wall in eval.c from the perl source code
------------------------------
Date: 11 Apr 1998 02:32:03 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Intermittent Perl problems
Message-Id: <6gmkn3$23d$2@client3.news.psi.net>
Scott LeWarne (Scott_LeWarne@BigFoot.com) wrote on MDCLXXXIII September
MCMXCIII in <URL: news:6gm7qm$de5@news.or.intel.com>:
++ I'm having intermittent problems with several perl scripts on a server
++ running IIS 3.0. 90% of the time, they work fine. But sometimes, users get
++ an error message that says,
++
++ "CGI Error The specified CGI application misbehaved by not returning a
++ complete set of HTTP headers. The headers it did return are: "
++
++ It doesn't list anything for the headers that it did return. I have seen
++ this error in several places in the MS knowledge base, but they all
++ reference specific headers being returned rather than none at all.
++
++ Does anyone have any idea what might be causing this problem? I usually
++ have to reboot the server to correct the problem. I'm not a Perl expert,
++ but the scripts seem to be written ok and they work most of the time.
I think you have an error in line 17.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Sat, 11 Apr 1998 01:37:58 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: Frank Cortez <cortez@tfn.com>
Subject: Re: Is it just me? (error/bug? with "my") -- Interesting Twist
Message-Id: <352F01B7.E8BD0ECF@coos.dartmouth.edu>
[posted and mailed]
Frank Cortez wrote:
>
> my ($var) = @_;
>
> Now, if I step past this line (say two lines, just to be
> sure it's executed), I *should* be able to see the value in
> $var using 'X var'-- shouldn't I?
No, you shouldn't.
> Well, I can't. However,
> if I type '$tmp = $var', and then type 'X tmp', I can then
> see the value in $var. Am I doing something wrong?
Yes. You're not reading the documentation for the debugger commands.
X [vars] Same as "V currentpackage [vars]".
and
V [pkg [vars]] List some (default all) variables in package (default current).
X and V can only be used to list variables in a package. my() variables are
not in any package. Therefore, you cannot list my() variables with X or V.
Use 'x $var' instead.
P.S. An example:
$var = "main";
my $var = "my";
1;
main::(-:1): $var = "main";
DB<1> s
main::(-:2): my $var = "my";
DB<1> s
main::(-:3): 1;
DB<1> X var
$var = 'main'
DB<2> x $var
0 'my'
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J. Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 11 Apr 1998 02:07:51 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Is it the code or is it the server?
Message-Id: <pviodeew.fsf@mailhost.panix.com>
Aleksi Asikainen <sanct@dlc.fi> writes:
> But it does not work. Browser only says "transferring data from a.b.c.d"
> and does not go foward and print the data to the page.
I'd guess that you need to tell the server that your script is an NPH,
and that therefore its output should be sent directly to the browser
without processing by the server. Different servers have different
conventions for the naming (and the output) of nph scripts. You
should definitely consider using CGI.pm, regardless.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: 11 Apr 1998 07:04:50 GMT
From: SpamYourselFtwest@agora.rdrop.kom (Todd West)
Subject: Nonblocking pipe reads from perl?
Message-Id: <6gn4mi$pe7$1@hermes.rdrop.com>
Hey all,
I'm working on implementing a parallel data search project in perl, and
I can't figure out how to do a nonblocking read from a pipe. Can you do
this in perl 5.004? If so, how? I know it can be done from C (I've got
code that does it), so I'm guessing it's doable from perl too.
Here's the situation: periodically, I'd like to sort through several
gigantic plain text log files, extract lines that I'm interested in, and
collate the results. Needless to say, perl's one of the best languages
to do this in. Since very little of what's in the logs is of interest
to me, the collation process is trivial, but grepping through the logs
can consume a entire CPU for minutes (like I said, they're big). Since
I'm running on a multiprocessor box, I figured I'd exploit the obvious
parallelism here and fork a process to grep through each log file.
The most elegant implementation I can think of is to use perl's pipe
open() to do the fork and establish a uniquely identified pipe back to
the parent process. Then all of the child processes can grep merrily
through their mountains of data while the parent pulls in any data they
put in their pipes, thereby keeping any of the children from blocking on
a full pipe. Of course, the parent needs to do a non-blocking read on
each child's pipe in order to service all of the children fairly or at
least have some way of doing a wake-up when a child puts data in it's
pipe. The closest I can come to this is to do a zero-byte sysread from
each pipe, which is kind of useless since it doesn't actually read any
data or tell me how much data is in the pipe! If I do, say, a 150 byte
sysread(), that will block until the child sticks some data in the pipe
and then unblock... This is okay, but hardly ideal---the parent can
grab data line by line as the children cough it up, but it will only
work reliably if all of the children encounter interesting data at the
same rate. Yeah, right. A print <CHILD_PIPE> blocks until the child
terminates, of course.
Sure, I can unblock the parent by having the children cough up some sort
of control code after they scan every n lines or something, but this is
decidedly inelegant compared to just doing a nonblocking read on the
pipe in the first place. It's also about as interesting as just
grinding through the logs sequentially. Besides, I've got the forking
engine and the nonblocking waitpid() in place; it would be kind of a
shame to bail out now.
I'd like to make sure I'm not reinventing the wheel before go building a
perl module or the like, though I suppose I could sleep the parent and
have children send it wake-up signals when they put data in their pipes.
The hard part is telling the parent which pipe to look at---I'd just as
soon not break out semaphores and shared memory if I can help it.
Thoughts?
I'm running slightly different flavors of perl 5.004 on versions of BSD
and Linux that are a few months old---let me know if you want the OS
details and precise perl patch levels.
Thanks in advance for any info or suggestions,
Todd West
Spam boggling turned *off* for this post's reply-to header.
--
Anti-spam boggling in effect. Edit reply-to address before sending mail.
------------------------------
Date: 11 Apr 1998 02:33:49 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Numeric validation
Message-Id: <6gmkqd$23d$3@client3.news.psi.net>
ppp-support (ppp-support@canelle.telecom.uqam.ca) wrote on MDCLXXXIII
September MCMXCIII in <URL: news:352E969E.617F3F4C@canelle.telecom.uqam.ca>:
++
++ How can i validate that $num actualy contain a number?
Read the FAQ.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
------------------------------
Date: 11 Apr 1998 07:55:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Numeric validation
Message-Id: <6gn7kq$81t$1@client3.news.psi.net>
ppp-support (ppp-support@canelle.telecom.uqam.ca) wrote on MDCLXXXIV
September MCMXCIII in <URL: news:352EC5DE.4C57C6C3@canelle.telecom.uqam.ca>:
++ Because I dont understand the FAQ!! Thats why i post here.
Then say so. And say what you don't understand. Else you will get
flamed, or get the faq quoted to you....
++ Well, how do i use this stuff, if i want to check if the content of $num is
++ or not numeric. Call me stupid if you want, but i will still dont get it :-)
++
++ The faq4 say...
++ warn "has nondigits" if /\D/;
++ warn "not a whole number" unless /^\d+$/;
++ warn "not an integer" unless /^-?\d+$/; # reject +3
++ warn "not an integer" unless /^[+-]?\d+$/;
++ warn "not a decimal number" unless /^-?\d+\.?\d*$/; # rejects .2
++ warn "not a decimal number" unless /^-?(?:\d+(?:\.\d*)?|\.\d+)$/;
++ warn "not a C float"
++ unless /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/;
Well, could you be more specific about what you don't understand?
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Fri, 10 Apr 1998 22:52:22 -0500
From: "Nathan Stanford" <nathan@cyberservices.com>
Subject: Perl and Netscape Suitespot and NT 4,0 HELP
Message-Id: <156058F01DA2F906.71BD3DC0F12C83B3.539E4E529DD31C22@library-proxy.airnews.net>
Can anyone tell me how to get perl to work with Netscape Suitespot?
I have it working with IIS and PWS. So I usally know what to do.
--
Nathan Stanford, Lan/Wan Engineer
The Perl N.uT. and going to be MCSE!
http://www.nettaxi.com/citizens/nathan/
------------------------------
Date: 11 Apr 1998 02:35:00 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl Compiler for NT
Message-Id: <6gmksk$23d$4@client3.news.psi.net>
Mark Waterous (mail@silas.hypermart.net) wrote on MDCLXXXIII September
MCMXCIII in <URL: news:352e9016.25718795@news.bctel.ca>:
++ On 9 Apr 1998 15:54:01 GMT, smcdow@arlut.utexas.edu (Stuart McDow)
++ wrote:
++
++ >"Grinch" <grinch@whoville.com> writes:
++ >> Mark Kucera wrote in message ...
++ >> >IS THERE a PERL Compiler for NT or win95. if so what is it called, and
++ >> >where can i get it...
++ >>
++ >> No (but there is an interpreter), Perl, http://www.perl.com
++ >
++ >Perl is a compiler, but not usual kind. It's a "compile and run"
++ >compiler.
++
++ So in otherwords it is an interpretor. Thanks for clearing
++ that up. :)
Not in the normal sense of "interpretor".
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Sat, 11 Apr 1998 00:04:12 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Perl Compiler for NT
Message-Id: <6gn4l5$l6u@bgtnsc02.worldnet.att.net>
>++ >> >IS THERE a PERL Compiler for NT or win95. if so what is it called,
and
>++ >> No (but there is an interpreter), Perl, http://www.perl.com
>++ >Perl is a compiler, but not usual kind. It's a "compile and run"
>++ >compiler.
>++ So in otherwords it is an interpretor. Thanks for clearing
>++ that up. :)
>Not in the normal sense of "interpretor".
It's a floor wax!
It's a dessert topping!
Calm down you two, it's a floor wax AND a dessert topping!
(Sorry, couldn't resist)
There is a perl2exe out there (which is what I presume you're looking for)
but I don't know anything about it other than (1) it exists and (2) it's not
a free/GPL program like Perl proper. In fact if I remember right it costs a
fair amount. A search for perl2exe in your favorite search engine will
probably turn up more information.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
------------------------------
Date: 11 Apr 1998 01:59:02 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Perl Puzzle: How Many Contexts?
Message-Id: <ra34detl.fsf@mailhost.panix.com>
mjd@op.net (Mark-Jason Dominus) writes:
> But there are at least two other contexts in Perl.
Is it silly to speak of "double-quotish" context?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: 11 Apr 1998 06:09:24 GMT
From: conover@netcom.com
Subject: Perl scripts for EDI?
Message-Id: <6gn1ek$78c@sjx-ixn8.ix.netcom.com>
I seem to remember, (sometime in the distant past) that there were
some Electronic Data Interchange, (EDI) scripts written in perl. Could
anyone direct me to an ftp site?
Thanks,
John
--
John Conover, 631 Lamont Ct., Campbell, CA., 95008, USA.
VOX 408.370.2688, FAX 408.379.9602
conover@netcom.com, http://www2.inow.com/~conover/john.html
------------------------------
Date: Sat, 11 Apr 1998 05:44:40 +0100
From: "Adam Carden" <adam@pacific-artists.demon.co.uk>
Subject: Perl/Cgi Problem
Message-Id: <892269934.8405.0.nnrp-01.c2de97e4@news.demon.co.uk>
I was ask to build a script which display a series of banners in sequence
with one being shown each time the user loads the page. They had wanted it
so when they write the html they can just put the tag in so I decided to
create a script that was called by SSI, Unfortunately their hosting
company(bitwise) does not support SSI. I have read odd snippets that suggest
you can call a script via an image tag so long as the script only outputs
the data which is applicable to the script.
Is this possible, I have tried it but cannot get it to work
see example:
<a href="/cgi-bin/bannerad.pl?hyper"><img src="/cgi-bin/bannerad.pl?img">
If the script is called with the hyper agument the script outputs the header
and the following line:
http://www.sensormatic.com
if the script is called with the img agument the script outputs the header
and the following line:
http://www.infosecnews.com/banners/ro343.gif or similar
Can Anyone Help?
Thanks in Advance.
Adam Carden
------------------------------
Date: Sat, 11 Apr 1998 04:26:49 GMT
From: mail@silas.hypermart.net (Mark Waterous)
Subject: Re: print
Message-Id: <352ebd8d.37360271@news.bctel.ca>
On Fri, 10 Apr 1998 11:46:26 -0400, "Kelby Valenti" <kelby@mplx.com>
wrote:
>How do you do the following?
>I have a variable $One = "abc" , for example.
>
>I want to:
>print "$Oned";
print $One, "d\n"; #or,
print $One . "d\n"; #or,
print "$One" . "d\n"; #or,
print "${One}d\n";
_________________________________
Mark Waterous - Silas Productions Online
"Your entrance to a world of information..."
http://silas.hypermart.net/
------------------------------
Date: 11 Apr 1998 05:21:11 GMT
From: Thomas van Gulick <melkor@Cal040031.student.utwente.nl>
Subject: Re: Problem with SRC attribute when writing HTML file
Message-Id: <6gmuk7$fvr$1@dinkel.civ.utwente.nl>
hairball <hairball@erols.com> wrote:
> I'm using perl to write some HTML. The code is:
>
> #!/usr/local/bin/perl
> print "Content-type: text/html\n\n";
>
> print "<html>\n";
> print "<head>\n";
> print "<title>Whatever</title>\n";
> print "<script language=\"JavaScript\" src=\"include.js\"></script>\n";
>
> . . . etc
>
> I get the following error message (Netscape 3)
>
> Not Found
> The requested object does not exist on this server. The link you followed
> is either outdated, inaccurate, or the server has been instructed not to
> let you have it.
It's a problem on the server-side, not in the script. The server could not
locate the java script file (or image whatever). Make sure they are in the
directory the script runs from, or else don't use a relative path but an
absolute one (not include.js but /~joe/java/include.js)
Thomas
--
http://utumno.student.utwente.nl/
melkor@utumno.student.utwente.nl
------------------------------
Date: 11 Apr 1998 02:36:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Regular expression strangeness
Message-Id: <6gmkup$23d$5@client3.news.psi.net>
Pedro Melo (melo@co.telenet.pt) wrote on MDCLXXXIII September MCMXCIII in
<URL: news:352EA18D.1AEE4DB8@co.telenet.pt>:
++
++ the dot (.) matches everything except a newline, but a character class
++ with a dot and a newline should match, right?
Wrong. Read the manual.
Abigail
--
perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: 11 Apr 1998 03:54:00 GMT
From: Jamie Hoglund <jhoglund@mirage.skypoint.net>
Subject: Re: stdin/out/err redirection in system() ???
Message-Id: <6gmpgo$fsp$5@shadow.skypoint.net>
Theodossiou Denis <theodod8@cti.ecp.fr> wrote:
: I need to execute an external command (say 'doit'), to which I want to feed
: $msg through STDIN, and at the same time capture STDOUT into $result and
: STDERR into $error.
: At first, I tried a simple :
: $result = ` echo \"$msg\" | doit `;
: but I can't capture STDERR...
: I also tried : $result = ` echo \"$msg\" | doit 2>&1 `, but the two outputs
: get mixed up and I cannot parse them...
: So, for now, I'm doing it though three temporary files
: system ("doit <$temp1 1>$temp2 2>$temp3");
: and then parse the two output files , which is CLEARLY insufficient and
: DIRTY.
: I think the answer is creating a pipe, but how can I use it ? I read my
: book, but haven't been able to understand how I can make it work...
: Sorry if this is a regular question - if it is answered in some kind of FAQ,
: please give me a link...
I usually just do the temporary file thing, because of potential blocking
problems. but there is open2 and open3 which basically duplicate Stdio
fork & make them available via file handles. (if I understand it
correctly)
Jamie
------------------------------
Date: 11 Apr 98 06:02:07 GMT
From: harrison@pixi.com (Robert F. Harrison)
Subject: Re: Week of Month
Message-Id: <slrn6iu1p6.stg.harrison@localhost.localdomain>
On Fri, 10 Apr 1998, I R A Aggie <fl_aggie@thepentagon.com> wrote:
> In article <slrn6is7f0.stg.harrison@localhost.localdomain>,
> harrison@pixi.com wrote:
>
> + Well, at least I found my own mistake. :-) But I'm still working to
> + fix it. It doesn't handle months that start right near the end of the
> + week really well. [I've also moved on to Time:: and friends for the
> + speed].
>
> Well, let us know how it turns out. I knew the code size could be
> very small (in terms of # of lines) but I was astounded that you'd
> gotten it into about 12 lines.
Okay, if I'm not completely bonkers, this one works. The trick is in
find the week boundary. Using zero-indexed weeks and months (0..6)
days and (0..4) weeks, each Saturday can be found by:
Saturday = (7 - First_Weekday) + (7 * Week_Number)
If the First_Weekday is a Thursday (4), then Saturdays in the month
are:
January 1998
Su Mo Tu We Th Fr Sa
(7 - 4) + (7 * 0) = 3 1 2 3
(7 - 4) + (7 * 1) = 10 4 5 6 7 8 9 10
(7 - 4) + (7 * 2) = 17 11 12 13 14 15 16 17
(7 - 4) + (7 * 3) = 24 18 19 20 21 22 23 24
(7 - 4) + (7 * 4) = 31 25 26 27 28 29 30 31
If the first day is a Sunday, we'd have: 7,14,21,28,35 (35 isn't a
problem because 29,30,31 are less than 35 and the input routine should
have thown 32 away already - it's still week 5). A week starting on
Saturday would give us: 1,8,15,22,29,36.
It shouldn't really matter about Leap Years and such as we are only
testing against Saturdays and stopping if we under that value. If not,
we do the next week.
This should work. If it doesn't, I'm pretty use it's my Perl and not
my logic. :-) Let me know!
#!/usr/bin/perl -w
use Time::JulianDay;
($day,$month,$year) = @ARGV;
@quoteday = qw( Sunday Monday Tuesday Wednesday Thursday Friday Saturday );
@quoteweek = qw( 1st 2nd 3rd 4th 5th 6th);
$user_dow = day_of_week(julian_day($year,$month,$day));
$first_dow = day_of_week(julian_day($year,$month,1));
for($week=0,$test=(7-$first_dow);$week<6;$week++,$test+=7) {
last if ($day <= $test)
}
print "$quoteday[$user_dow] in the $quoteweek[$week] week of the month.\n";
print "1st day of the month: $quoteday[$first_dow].\n";
--
rfh harrison@pixi.com
DNRC "Potentate of Needless Reinstallations"
------------------------------
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 2297
**************************************