[9800] in Perl-Users-Digest
Perl-Users Digest, Issue: 3393 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 7 17:07:11 1998
Date: Fri, 7 Aug 98 14:00:21 -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 Fri, 7 Aug 1998 Volume: 8 Number: 3393
Today's topics:
Re: "Here" documents and the mystery that is FTP (Honza Pazdziora)
Re: <BASE HREF= ...> and "access disallowed from script <REPLY_TO_lastronin@earthlink.net>
Re: ANNOUNCE: Free Perl Books for 5.005 - CRC Errors in <dparrott@ford.com>
Re: Are my posts getting thru? Was: Scoping question. <REPLY_TO_lastronin@earthlink.net>
Re: ARGV truncations <kirkmo@us.ibm.com>
Re: BIZARRE: killing window kills bg perl process <kj0@mailcity.com>
Re: c.l.p.moderated: not much traffic? <mgregory@asc.sps.mot.com>
Re: Calling one Perl script from within another (Nem W Schlecht)
Re: Can't Match Multi-Line Pattern -- Thanks <matt@steinhoff.net>
Re: Can't sysopen(..., O_WRONLY|O_NONBLOCK) <fcusack@iconnet.net>
Re: Can't sysopen(..., O_WRONLY|O_NONBLOCK) <fcusack@iconnet.net>
Re: Can't sysopen(..., O_WRONLY|O_NONBLOCK) (Matt Knecht)
Re: Expression Tree Alogorithm (Nem W Schlecht)
Re: Expression Tree Alogorithm <marks@webleicester.co.uk>
Re: Frames <potus@usa.net>
Re: Good Book? <dparrott@ford.com>
Re: help a newbie, please! mchunziker@us.fortis.com
Re: math error (Nem W Schlecht)
Perl for kids: Partial work on-web (jonathan seth hayward)
Perl Style (was Re: variable indirection [off topic - p <dgris@rand.dimensional.com>
Re: Please help! (Alastair)
PumpGen: Generating HTML with Dynamic Templates (Hans Stoop)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 7 Aug 1998 19:52:08 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: "Here" documents and the mystery that is FTP
Message-Id: <slrn6smmn8.muk.adelton@aisa.fi.muni.cz>
On Fri, 07 Aug 1998 14:35:09 -0500, pearse <pearse@mail.shebang.net> wrote:
> Yes, yes. I'm using ASCII.
>
> So, I'm got two things going on here.
> 1) wintel editior is adding /r/n to EOF
> 2) wintel editior is adding ^M to EOF
>
> Which is it? And couldn't the perl interpreter be told that EOF = EOF/r/n =
> EOF^M? If so, where do I post the patch?
To post a patch, use the script perlbug. Even if I highly doubt your
patch on this topic will be accepted. It's really not Perl's fault
that it's doing what you tell it to do. And BTW, it's \r\n and not
/r/n, it's EOL and not EOF and the ^M (which is the same as \r, for
the curious) is prepended, not added.
Hope this helps,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
Please note: won't be answering my email from Aug 10 to 14 -- will be gone.
------------------------------
Date: Fri, 7 Aug 1998 16:17:13 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: <BASE HREF= ...> and "access disallowed from scripts ..."
Message-Id: <6qfmo7$sgh$1@oak.prod.itd.earthlink.net>
kill base href if it's getting too troublesome. use %ENV hash array instead.
or,
start URLs relative to html root, i.e.
<a href="/cgi-bin/somescript.pl">
cheers,
ha quach
mailto:info@r-go.com
>When I looked at the script-generated source for the new window this
>line appears as the first line:
>
><BASE HREF="http://www.my-domain.com/cgi-bin/">
------------------------------
Date: Fri, 07 Aug 1998 15:12:17 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
To: Curtis Jewell / Dennis Whalen <cjdpcssd@ims-1.com>
Subject: Re: ANNOUNCE: Free Perl Books for 5.005 - CRC Errors in text version archive?
Message-Id: <35CB5191.2473@ford.com>
Curtis Jewell / Dennis Whalen wrote:
>
> Tom Christiansen wrote in message <6qdkpd$6iv$1@csnews.cs.colorado.edu>...
> > [courtesy cc of this posting sent to cited author via email]
> >
> >In comp.lang.perl.misc,
> > cicho@polbox.com (Marek Jedlinski) writes:
> >:Suggested solution: since gzip is unix-centric anyway, please provide a
> >:.zip archive version as well.
> >
> >No, sir. CPAN is in .tar.gz format. You're talking about four thousand,
> >one hundred and ninety-two files to duplicate. If the Windows folks
> >want to play on the net, then they need to cope with the norms here.
>
> Personally, I agree with you... .tar.gz is perfectly fine with me, and I
> run Windoze. But nicely just tell them to please avoid .txt.gz in the
> future and all will be well with them and us.
>
> Even if they do .txt.tar.gz!
>
> I'm forced into Windows... (I'd use Linux if I had the HD room!)
>
> --Curtis
There are gzip/gunzip and tar utilities available for Win95.
They are free, so far as I know, and run just fine -- I use
'em all the time.
I don't remember the links off the top of my head.
--
-----------------------------------------------------------------------
Dennis M. Parrott | Unix: dparrott@ford.com
PCSE Webmaster | PROFS: DPARROTT
Ford Motor Company | VAX: EEE1::PARROTT
Dearborn, Michigan USA | public Internet: dparrott@ford.com
-----------------------------------------------------------------------
Voice: 313-322-4933 Fax: 313-248-1234 Pager: 313-201-9978
------------------------------
Date: Fri, 7 Aug 1998 15:58:15 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: Are my posts getting thru? Was: Scoping question.
Message-Id: <6qflkl$rah$1@oak.prod.itd.earthlink.net>
open (outfile, "mytest") or die "can't: $!";
> { # some block
> s/olddata/newdata/;
> print outfile;
> }
> close (outfile) or die "can't: $!";
try the usual syntax for filehandles, all caps: OUTFILE. make sure your
braces starts with a conditional block/loop thingy like a while(), etc.
you'll also benefit from data direction packmen: < to read, > to
write/create, >> to append, +< to read/write, etc. it's in the Perl manual.
open(FILE, "<$path")
|| print "Error opening file to read, path is $path";
while (<FILE>)
{
blah blah blah;
}
close(FILE);
don't forget flock() for writing.
cheers,
ha quach
mailto:info@r-go.com
------------------------------
Date: Fri, 07 Aug 1998 16:33:16 -0400
From: Kirk Moren <kirkmo@us.ibm.com>
To: Nem W Schlecht <nem@abattoir.cc.ndsu.nodak.edu>
Subject: Re: ARGV truncations
Message-Id: <35CB648B.4E69EDBD@us.ibm.com>
Nem W Schlecht wrote:
> [courtesy copy e-mailed to author(s)]
>
> In comp.lang.perl.misc, Kirk Moren <kirkmo@us.ibm.com> wrote:
> >I have a situation where an rexx program is calling a perl 5 program to
> >perform some socket i/o. The data is being passed to the perl program
> >via arguments such as...
> >
> >`perl perlsock.pl host.com 5000 a long data string containing normal and
> >special characters`
> >
> >Everything after the host name and port is considered data to be sent.
> >The data contains
> >some special characters occassionally such as hex characters (0a0dx) and
> >this apparently confuses Perl due to the fact that all data subsequent
> >to the special hex character is truncated and not available to @ARGV.
>
> Can you give us a better example of a call that fails? I'm not very
> familiar with REXX, does it have something equivalent to 'open(FH, "|
> command")' where you could then pipe your data to the perl script via
> STDIN? How are you reading in your arguments? I'm assuming your doing
> something like this:
>
> #!/local/bin/perl
> $host = shift(@ARGV);
> $post = shift(@ARGV);
> $data = join(' ', @ARGV);
> ....
>
> --
> Nem W Schlecht nem@plains.nodak.edu
> NDUS UNIX SysAdmin http://www.nodak.edu/~nem/
> "Perl did the magic. I just waved the wand."
I'm reading in my arguments in a similar method to what you have listed,
parsing the arguments in a space delimited way.
To provide an actual example would be quite lengthy since most argument
lengths
are close to 1000 bytes, but a good illustration would be the following...
`perl perlsock.pl adv3.tpa.co.com 5000 0999data string preceded by 4 byte
length of 0999 contains a string of data and special characters0a0dxthis is
the end`
@ARGV in perlsock only receives up to ... and special characters ... with all
data past and including the 0a0dx hex string represenation being truncated.
Thanks,
Kirk Moren
------------------------------
Date: 7 Aug 1998 20:50:27 GMT
From: k y n n <kj0@mailcity.com>
Subject: Re: BIZARRE: killing window kills bg perl process
Message-Id: <6qfpaj$244@news1.panix.com>
In <6qd8hm$i8p$3@csnews.cs.colorado.edu> Tom Christiansen <tchrist@mox.perl.com> writes:
>In comp.lang.perl.misc,
> k y n n <kj0@mailcity.com> writes:
>:I have a perl script that runs fine in the background (e.g., "foo &")
>:as long as its parent shell is up, but dies immediately if one kills
>:the shell, just as if it were a foreground process...
>:
>:The OS is IRIX6.2 and the perl version is 5.004_4.
>I bet you're using one of those lame shells that doesn't automatically
>"no hup" backgrounded processes.
No, actually, I'm using a shell (tcsh) that does automatic nohup'ing
on processes run with an "&" at the end of the command line, so I
don't think that's it.
I've distilled the problem to the script below. It (the script) takes
one command line argument (default 1), representing the number of
children to exec. (It exec's a make-work script called buzz).
If called with an argument of 1:
$ foo 1 &
it and its exec'd child persist after the issuing shell has expired,
as they should. But, if one calls
$ foo 2 &
parent and children disappear as soon as the issuing shell is killed.
(There's one more weird bit about "foo 2 &", for n > 1, which I
describe below).
Here are the main script foo, and the make-work script buzz:
#!/usr/local/bin/perl -w
### foo (main script)
# Takes a positive argument n; exec's the make-work script buzz n
# times; after each fork is completed, the parent process sends each
# of the exec'd buzz jobs a STOP signal; after all n jobs have been
# exec'd and suspended, the parent sends the first buzz job a CONT
# signal; and goes to sleep.
my $n = shift;
$n = 1 unless defined $n and $n > 0;
my @pid = ();
my $p;
for (1..$n) {
FORK:
if($p = fork) { # parent's branch
1;
}
elsif(defined $p) { # child's branch
exec "buzz" or die "Couldn't exec buzz\n";
exit; # just in case
}
elsif ($! =~ /No more process/) { sleep 5; redo FORK }
else { die "Can't fork: $!\n" }
push(@pid, $p);
die "Can't STOP $p!\n" unless 1 == kill(STOP => $p);
}
die "Can't CONT $pid[0]!\n" unless 1 == kill(CONT => $pid[0]);
sleep;
----------------------------------------------------------------------
#!/usr/local/bin/perl
### buzz
for(;;) { rand }
----------------------------------------------------------------------
(Arguments > 1 show one further anomaly: in most (but not all) cases,
instead of exec'ing the requested number n of "buzz", it exec's only
1, plus forks (n-1) copies of itself; on rare occasions, it exec's the
n "buzz" jobs as requested.)
The problem occurs under all conditions I've tested, including tcsh
and Bourne shells, and IRIX and Linux.
K.
------------------------------
Date: 07 Aug 1998 21:43:49 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: c.l.p.moderated: not much traffic?
Message-Id: <r84svpc7lu.fsf@asc.sps.mot.com>
Russ Allbery <rra@stanford.edu> writes:
> John Porter <jdporter@min.net> writes:
> > John Klassa wrote:
>
> >> Is it me, or is the traffic on c.l.p.moderated pretty much a trickle?
>
> > Maybe your sense of normal has been twisted by the daily deluge on
> > clp.misc. :-)
>
> Yeah, I think that's most of it. :) If one looks at the moderated groups
> for other languages, they tend to be a good bit lower in volume than the
> unmoderated groups.
Actually, I think that the flow of interesting articles is about the
same on each...
Martin.
------------------------------
Date: 7 Aug 1998 15:27:39 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: Calling one Perl script from within another
Message-Id: <6qfnvr$opi@abattoir.cc.ndsu.nodak.edu>
[courtesy copy e-mailed to author(s)]
In comp.lang.perl.misc, Michael Stearns <michael@datahost.com> wrote:
>I would like to call one Perl script from another (which happens to be a
>cgi that supplies an argument for the first script.)
>
>What is the best way to accomplish this? It seems like the exec commands
>works, but I was under the impression that this has some negative
>security implications.
If you simply want to run the script, use do():
do('other.pl');
I don't think you can pass arguments to this, though. However, the other
script will be able to see any global variables that you have in your
original script. do() returns whatever the other script returns.
--
Nem W Schlecht nem@plains.nodak.edu
NDUS UNIX SysAdmin http://www.nodak.edu/~nem/
"Perl did the magic. I just waved the wand."
------------------------------
Date: Fri, 07 Aug 1998 16:42:39 -0400
From: Matt Steinhoff <matt@steinhoff.net>
Subject: Re: Can't Match Multi-Line Pattern -- Thanks
Message-Id: <35CB66BF.3AB@steinhoff.net>
Thanks to Craig and the rest who assisted. Replacing /m with /s
worked.
Perl is pretty darn nifty.
Matt
Craig Berry (cberry@cinenet.net) wrote:
> /m has only one effect -- changing how ^ and $ are interpreted. Without
> /m, they match only at the beginning and end of the entire string; with
> it, they can also match at internal newlines. Your regex has no ^ or $,
> so /m is irrelevant.
>
> /s has only one effect -- changing how . is interpreted. Without /s, .
> matches any character except newline. With it, it matches any character
> *including* newline. You want your .* above to span newlines, so /s is
> what you need.
>
> Hope this helps...
>
> ---------------------------------------------------------------------
> | Craig Berry - cberry@cinenet.net
> --*-- Home Page: http://www.cinenet.net/users/cberry/home.html
> | Member of The HTML Writers Guild: http://www.hwg.org/
> "Every man and every woman is a star."
------------------------------
Date: Fri, 07 Aug 1998 20:10:26 GMT
From: Frank Cusack <fcusack@iconnet.net>
Subject: Re: Can't sysopen(..., O_WRONLY|O_NONBLOCK)
Message-Id: <3vg1f8zh8g.fsf@blockhead.iconnet.net>
Never mind. Found out it doesn't work in C either. Anyone know why?
~frank
--
Frank Cusack + Today's Haiku No keyboard present
Icon CMT Corp. + error message: Hit F1 to continue
PGP: C001AA75 + Zen engineering?
------------------------------
Date: Fri, 07 Aug 1998 20:20:50 GMT
From: Frank Cusack <fcusack@iconnet.net>
Subject: Re: Can't sysopen(..., O_WRONLY|O_NONBLOCK)
Message-Id: <3vd8aczgr5.fsf@blockhead.iconnet.net>
Yow, that is the correct behavior for O_WRONLY|O_NONBLOCK.
~frank
--
Frank Cusack + Today's Haiku No keyboard present
Icon CMT Corp. + error message: Hit F1 to continue
PGP: C001AA75 + Zen engineering?
------------------------------
Date: Fri, 07 Aug 1998 20:33:14 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Can't sysopen(..., O_WRONLY|O_NONBLOCK)
Message-Id: <ewJy1.299$bL3.2372583@news3.voicenet.com>
Frank Cusack <fcusack@iconnet.net> wrote:
>my $MKFIFO = "/usr/bin/mkfifo";
>my $FIFO_NAME = "/tmp/fifo";
># setup FIFO
>unless (-p $FIFO_NAME) {
> unlink($FIFO_NAME);
> system($MKFIFO, $FIFO_NAME) && die "Can't create $FIFO_NAME: $!\n";
>}
>sysopen(FIFO, $FIFO_NAME, O_WRONLY | O_NONBLOCK) || die "open: $!\n";
>print "didn't block!\n";
Check out man -s2 open :
When opening a FIFO with O_RDONLY or O_WRONLY
set:
If O_NONBLOCK or O_NDELAY is set:
An open() for reading only returns
without delay. An open() for writing
only returns an error if no process
currently has the file open for reading.
Looks like you're out of luck. You'll have to make sure whatever you
have reading the FIFO is opened first, or default to a regular file.
--
Matt Knecht - <hex@voicenet.com>
------------------------------
Date: 7 Aug 1998 15:15:59 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: Expression Tree Alogorithm
Message-Id: <6qfn9v$ok7@abattoir.cc.ndsu.nodak.edu>
[courtesy copy e-mailed to author(s)]
In comp.lang.perl.misc, Mark <marks@webleicester.co.uk> wrote:
>Does anyone have an algorithm for building an Expression Tree from an
>Infix Expression ? Or even the code !
>
>I could work it out for myself, but I could do with it quickly !
And you need this for what? Assignment due tomorrow? Sounds like homework
from one of my old C.S. classes, and I see that you are currently in
school. Hmm.. I *do* have a left-child, next right sibling example:
http://abattoir.cc.ndsu.nodak.edu/~nem/perl/perlsem/advn/str.html
This will at least give you an idea on how to handle the tree structure
within perl.
--
Nem W Schlecht nem@plains.nodak.edu
NDUS UNIX SysAdmin http://www.nodak.edu/~nem/
"Perl did the magic. I just waved the wand."
------------------------------
Date: Fri, 07 Aug 1998 21:29:23 +0100
From: Mark <marks@webleicester.co.uk>
Subject: Re: Expression Tree Alogorithm
Message-Id: <35CB63A3.ED4021FC@webleicester.co.uk>
Hi,
Actually your wrong.. I'm in my placement year working. I'm sorry but I found
it quiet insulting for you to assume this. I wouldn't ask if it was for any
assignment I need to hand in.
Mark.
--
Nem W Schlecht wrote:
> [courtesy copy e-mailed to author(s)]
>
> In comp.lang.perl.misc, Mark <marks@webleicester.co.uk> wrote:
> >Does anyone have an algorithm for building an Expression Tree from an
> >Infix Expression ? Or even the code !
> >
> >I could work it out for myself, but I could do with it quickly !
>
> And you need this for what? Assignment due tomorrow? Sounds like homework
> from one of my old C.S. classes, and I see that you are currently in
> school. Hmm.. I *do* have a left-child, next right sibling example:
>
> http://abattoir.cc.ndsu.nodak.edu/~nem/perl/perlsem/advn/str.html
>
> This will at least give you an idea on how to handle the tree structure
> within perl.
>
> --
> Nem W Schlecht nem@plains.nodak.edu
> NDUS UNIX SysAdmin http://www.nodak.edu/~nem/
> "Perl did the magic. I just waved the wand."
>
--
================================
Mark Simonetti
se96ms@dmu.ac.uk
marks@webleicester.co.uk
http://www.cms.dmu.ac.uk/~se96ms
================================
"I used to be indecisive, but now I'm not so sure."
------------------------------
Date: Fri, 07 Aug 1998 14:11:22 -0600
From: Jesse <potus@usa.net>
Subject: Re: Frames
Message-Id: <35CB5F6A.D696271B@usa.net>
Why would you want to write a perl program to do that? You can do that really
easily, without making your computer run perl.
Norman Bunn wrote:
> When I run a perl program to generate HTML for frames, I receive:
>
> CGI Error
> The specified CGI application misbehaved by not returning a complete set of
> HTTP headers. The headers it did return are:
>
> <html>
> <head>
> <title>my title</title>
> </head>
> <frameset cols='23%,77%'>
> <frameset rows='66%,*'>
> <frame src=ordermenu.html name=ordermenu>
> <frame src=picture.html name=picture>
> </frameset>
> <frameset rows="*,25">
> <frame src=ordermain.html name=ndsmain marginwidth=1 marginheight=1>
> <frame marginheight=0 src=/desktopindex.html name=desktopindex
> scrolling=no>
> </frameset>
> </frameset>
> </html>
>
> The HTML is okay, as it displays fine when copied and pulled up in a
> browser. The program works fine from the command line. Any ideas why this
> is happening under NT 4.0 and IIS 4? Here's the source:
>
> #!c:/perl/bin/perl
>
> use CGI qw(:all);
> #####################################################
>
> print "<html><head><title>my title</title></head>";
> print "<frameset cols='23%,77%'>";
> print "<frameset rows='66%,*'>";
> print "<frame src=ordermenu.html name=ordermenu>";
> print "<frame src=picture.html name=picture>";
> print "</frameset>";
> print "<frameset rows=\"*,25\">";
> print "<frame src=ordermain.html name=ndsmain marginwidth=1
> marginheight=1>";
> print"<frame marginheight=0 src=/desktopindex.html name=desktopindex
> scrolling=no>";
> print "</frameset>";
> print "</frameset>";
> print "</html>";
>
> Norman
> norman.bunn@mci.com
--Jesse ( potus@usa.net )
http://icu.dyn.ml.org
or
http://www.crosswinds.net/albuquerque/~potus
------------------------------
Date: Fri, 07 Aug 1998 15:07:52 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
To: jdporter@min.net
Subject: Re: Good Book?
Message-Id: <35CB5088.36D2@ford.com>
Tom Christiansen wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, jdporter@min.net writes:
> :This still doesn't help me know if a book I already own
> :is worth using. Am I to infer that if it isn't a 4/5 camel
> :book in Camel Critiques, it is not a good book? What,
> :all the 4/5 camel books have already been reviewed, and
> :all else is chaff?
>
> [ Tom C's reply snipped ]
Just as a word means exactly what I choose it to mean, nothing
more and nothing less, a Good Book is one that "learnt ya
sumthin'", nothing more and nothing less.
If you directly ask me my definition of a Good Book on Perl,
I would point directly to the O'Reilly series. My personal
opinion is that they are the best of the lot by far. In the
old days, people were pointed to "K&R" (Kernighan and Ritchie)
to learn C. Later, to "Stroustrup" or "Lippman" to learn C++.
These days, I tell people to read titles by Wall, Scwhartz
and Co. (To be fair, there are a couple of books on 'advanced
Perl' that I can't remember the publisher of off the top of
my head that look pretty good. I should also note that the
publisher IMHO has a pretty good reputation for having
published serious computer-realted books -- it is either
Addison-Wesley or Prentice-Hall...)
I tend not to refer people to the books like "Perl for
Simpletons and Foofs" or "Learn Perl in 27 Microseconds
or Less" because they tend not to deliver what they
claim as well as mislead people into believing that they
can really master some reasonably complicated things
(like Perl) in a few, painless days.
--
-----------------------------------------------------------------------
Dennis M. Parrott | Unix: dparrott@ford.com
PCSE Webmaster | PROFS: DPARROTT
Ford Motor Company | VAX: EEE1::PARROTT
Dearborn, Michigan USA | public Internet: dparrott@ford.com
-----------------------------------------------------------------------
Voice: 313-322-4933 Fax: 313-248-1234 Pager: 313-201-9978
------------------------------
Date: Fri, 07 Aug 1998 20:01:00 GMT
From: mchunziker@us.fortis.com
Subject: Re: help a newbie, please!
Message-Id: <6qfmds$m0t$1@nnrp1.dejanews.com>
In article <35CA02A2.110A@min.net>,
jdporter@min.net wrote:
> mchunziker@us.fortis.com wrote:
> >
> > Win95 doesn't use the #!/usr/bin/perl line. It's a unix thing.
>
> No, but perl.exe *does* look at that line, for command line options.
Didn't know that, that's very good when combined with the stuff below.
> > I have heard that defining .pl extensions does not work in win95.
>
> You heard wrong. I've done it, and it works.
>
Damn, you are correct (just tried it). I must have heard 10 people say it
wouldn't work... oh well, when you ASSUME......
> --
> John Porter
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 7 Aug 1998 15:00:11 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: math error
Message-Id: <6qfmcb$obb@abattoir.cc.ndsu.nodak.edu>
[courtesy copy e-mailed to author(s)]
In comp.lang.perl.misc, Tom Bridgwater <T.Bridgwater@mindgear.com> wrote:
>I've come across a strange problem with integer vs. floating point math
>that seems like Perl 5.004 isn't handling correctly. The increment in
[deletia]
>print "Try '50000 23 5' to see the problem\n";
>if (@ARGV < 3) { die "need three numbers\n"; }
>&domath (@ARGV);
Very interesting. It seems that with the 23/5 combination, it fails on
*certain* numbers that are divisible by 5. I added a loop around this
function and ran it through 1000. 97 values failed in this range using the
23/5 comb. The first 10 were 25, 45, 50, 55, 85, 90, 95, 100, 103, & 110.
I'm running perl5.005. Can you check these numbers and see if they fail
for you as well? There were a bunch of others as well (23/10 failed quite
a bit as well). It also seems that it only fails on numbers that are
already whole. It works on some whole numbers, but fails on others. Quite
odd. I guess I would consider this a bug.
--
Nem W Schlecht nem@plains.nodak.edu
NDUS UNIX SysAdmin http://www.nodak.edu/~nem/
"Perl did the magic. I just waved the wand."
------------------------------
Date: 7 Aug 1998 20:57:27 GMT
From: jhayward@students.uiuc.edu (jonathan seth hayward)
Subject: Perl for kids: Partial work on-web
Message-Id: <6qfpnn$at1$1@vixen.cso.uiuc.edu>
Earlier, I posted an article mentioning that I was working on a Perl book for
children. My little brothers seem very uninterested in Perl, and they were
my main reason for writing. For now, I have decided to drop the project.
What I have written, I have placed on the web at:
http://www.imsa.edu/~jhayward/perl_guide
It is not a finished product, but it does explain some of the basics of
computer science, and may be useful to show children to teach them to tinker
-- enough basics to potentially spark curiosity, and get kids interested
before overwhelming them with the really heavy duty stuff. So I thought I'd
drop a note for anyone who was interested.
Cheers.
-Jonathan
------------------------------
Date: Fri, 07 Aug 1998 20:07:18 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Perl Style (was Re: variable indirection [off topic - parens])
Message-Id: <6qfm1i$1pf$1@rand.dimensional.com>
[posted to comp.lang.perl.misc and mailed to the cited author]
In article <6qfiss$nlh@abattoir.cc.ndsu.nodak.edu>
nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht) wrote:
>On a side note... I've noticed that a lot of code snippets posted to clpm
>are missing a lot of parens, IMO.
<snip>
>Now, I've been off in my own little la-la land of perl programming for a
>couple of years now and I'm trying get back into posting more on clpm, but
>this is a bit shocking to me. Is it generally taken that calls without
>parens are easier to read or somehow otherwise preferred? I disagree, but
>that's merely my opinion.
I agree with you completely. There is a real tendency in this group
toward omitting parens whenever possible, but this is just bad style.
There is at least one post every week where the author has a problem
with a construct such as-
open FILE, $file || die "Oops: $!";
If the poster hadn't been led into the belief that omitting parens
whenever possible is a _good_ idea he wouldn't have had this
problem. Saving keystrokes is good, but not when it leads to silly
bugs.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: 7 Aug 1998 20:20:43 GMT
From: alastair@psoft.co.uk (Alastair)
Subject: Re: Please help!
Message-Id: <6qfnir$16j@handupme.avid.com>
Jonah Olsson <jonah@g-s.net> wrote:
>Hello!
>
>In my chat system everything is logged and feeded into a file where each
>block of data (name, time, text etc.) starts and ends with %%%.
>
>When printing each block I open the file into a string like this:
>
>open (CHAT, "$datafile") || die "The chat will should be back soon! ($!)\n";
> local $/;
> $chat = <CHAT>;
>close (CHAT);
>
>But how should I search for the blocks starting and ending with %%%? Is it
>better to use an array?
>
>
I think the next step is quite a basic question to ask which might
mean you haven't looked hard enough yet. I believe the 'split'
function may turn out to be useful.
Further to that, I'm not sure why you bother using the '$/' here. I
think if you want to slurp in the whole file you need to undef the
current value of $/. I found this out by looking at the 'perlvar' doc
i.e.
perldoc perlvar
I think I'd probably just read the file a line at a time, split the
line on your separator (using 'split') and then print the values out.
Perhaps I'd decide to add the values to a hash and push these onto a
list - just like in the documented data structure examples ;
Camel book
perldoc perldsc (i.e. data structures)
Hope this helps.
--
Alastair
Avid Effects
alastair@psoft.co.uk
------------------------------
Date: Fri, 07 Aug 1998 22:09:52 +0200
From: hans@PumpkinDesign.nl (Hans Stoop)
Subject: PumpGen: Generating HTML with Dynamic Templates
Message-Id: <35d65e13.110559528@news.xs4all.nl>
I think that some of you are interested in the free PumpGen. From the
introduction:
PumpGen allows the effortless generation and maintenance of all types
of web sites. It is friendly towards both novices and power users.
PumpGen can be customized for their particular needs with Perl. The
key features of PumpGen are:
* Simplifies maintenance
* Separation of layout and content,
* Dynamic templates,
* Rich set of standard functionality,
* Extendable,
* Filter for adding WIDTH and HEIGHT parameters to the IMG-tag,
* Integrated with HomeSite,
* Based on Perl
It can be found at http://www.pumpkindesign.nl/pumpgen/index.htm.
Regards,
Hans Stoop
---
Pumpkin Design - Geavanceerde Web Articiteit
e-mail: hans@PumpkinDesign.nl
http://www.PumpkinDesign.nl/
tel.: +31(0)71-5238800
fax: +31(0)71-5238801
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3393
**************************************