[26834] in Perl-Users-Digest
Perl-Users Digest, Issue: 8863 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 18 09:05:29 2006
Date: Wed, 18 Jan 2006 06:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 18 Jan 2006 Volume: 10 Number: 8863
Today's topics:
2 basics questions: 1)'a' < 'b' 2)Run, but is it ok? <winter@yahoo.co.uk>
Re: 2 basics questions: 1)'a' < 'b' 2)Run, but is it (Anno Siegel)
Re: 2 basics questions: 1)'a' < 'b' 2)Run, but is it <bart.lateur@pandora.be>
Re: Blather-Adjusting Programs vjp2.at@at.BioStrategist.dot.dot.com
Re: Blather-Adjusting Programs (Anno Siegel)
Re: Script execution blocked when reading from a socket <troc@pobox.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 18 Jan 2006 09:13:17 +0100
From: "Olaf \"El BLanco\"" <winter@yahoo.co.uk>
Subject: 2 basics questions: 1)'a' < 'b' 2)Run, but is it ok?
Message-Id: <dqktar$mh6$1@cormoran.emeteo.local>
1) Why this not work? I need the OK when a < b, B < Z, etc...
print "First char: "; $c1 = <STDIN>;
print "Second char: "; $c2 = <STDIN>;
if ($c1 <= $c2)
{ print "OK"; }
2) print "Give me 4 numbers...\n";
print "-->"; $n1 = <STDIN>;
print "-->"; $n2 = <STDIN>;
print "-->"; $n3 = <STDIN>;
print "-->"; $n4 = <STDIN>;
$larger = $n1;
if ($n2 >= $larger) { $larger = $n2; }
if ($n3 >= $larger) { $larger = $n3; }
if ($n4 >= $larger) { $larger = $n4; }
print "The biggest is $larger";
------------------------------
Date: 18 Jan 2006 08:22:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: 2 basics questions: 1)'a' < 'b' 2)Run, but is it ok?
Message-Id: <dqkts5$3fu$1@mamenchi.zrz.TU-Berlin.DE>
Olaf \"El BLanco\" <winter@yahoo.co.uk> wrote in comp.lang.perl.misc:
>
> 1) Why this not work? I need the OK when a < b, B < Z, etc...
> print "First char: "; $c1 = <STDIN>;
> print "Second char: "; $c2 = <STDIN>;
> if ($c1 <= $c2)
> { print "OK"; }
Strings are compared using "le", not "<=". See perldoc perlop.
> 2) print "Give me 4 numbers...\n";
> print "-->"; $n1 = <STDIN>;
> print "-->"; $n2 = <STDIN>;
> print "-->"; $n3 = <STDIN>;
> print "-->"; $n4 = <STDIN>;
> $larger = $n1;
> if ($n2 >= $larger) { $larger = $n2; }
> if ($n3 >= $larger) { $larger = $n3; }
> if ($n4 >= $larger) { $larger = $n4; }
> print "The biggest is $larger";
Even trivial programs like these are best developed under strict and
warnings. Switch them on. You'll have to declare your variables
with "my" after that. Do that too.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Wed, 18 Jan 2006 13:23:31 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: 2 basics questions: 1)'a' < 'b' 2)Run, but is it ok?
Message-Id: <h3gss1hj1flv4art3c23mg5itd7ot188ve@4ax.com>
Olaf "El BLanco" wrote:
>1) Why this not work? I need the OK when a < b, B < Z, etc...
>print "First char: "; $c1 = <STDIN>;
>print "Second char: "; $c2 = <STDIN>;
>if ($c1 <= $c2)
> { print "OK"; }
A "char" is a string (with length 1), not a number. Forget all your
preconceived ideas from C, that a string is an array of numbers... it
isn't. Instead, it's far more like a string in Basic.
You compare strings with le, lt, eq, ne, ge, gt.
>2) print "Give me 4 numbers...\n";
>print "-->"; $n1 = <STDIN>;
>print "-->"; $n2 = <STDIN>;
>print "-->"; $n3 = <STDIN>;
>print "-->"; $n4 = <STDIN>;
>$larger = $n1;
>if ($n2 >= $larger) { $larger = $n2; }
>if ($n3 >= $larger) { $larger = $n3; }
>if ($n4 >= $larger) { $larger = $n4; }
>print "The biggest is $larger";
You could put the results in an array, and loop through them. Heck, you
could even loop through the list of scalars:
$larger = $n1;
foreach my $n ($n2, $n3, n4) {
if ($n >= $larger) { $larger = $n; }
}
print "The biggest is $larger";
--
Bart.
------------------------------
Date: Wed, 18 Jan 2006 09:54:59 +0000 (UTC)
From: vjp2.at@at.BioStrategist.dot.dot.com
Subject: Re: Blather-Adjusting Programs
Message-Id: <dql39j$kde$1@reader2.panix.com>
Please save me. If I have to keep dealing with such warped humanoids I
will end up becomingone of them. I need a program to deal with them so
I don't have to. (Ok, the following is a spoof, but believe it or not,
they think it's real. I tried it. This is what our cities are full of.)
Alrophthe Xieddle Infestment Bunk
287 Park Avenue, Suite 7589, New York, NY 10017 (212) 288-9970
Esteemed Colleague,
It is our unperturbably articulated honor to functionally offer
you the operationally validated aggregately syndicated solutions
position as our unremunerable chief coordination director of
achievment implementation information security ability generation
solutions deployment resources identification documentation human
mitigations operations characterization coordinator.
We contingently conflatulate you on achieving the wondrously
seamless authorization qualification for this directionally usability
articulation technique utilization credential conditional metrics
mitigation dimensionalization comprehensive contribution proscription
prioritization professional model development position.
Once you commence parametrization revision in our adequate
systems registration documentational procedures for coordination
conflagration we will be able to initializationally invocationally
selectionally embed you in our application limitation relationship
redeployment solutions novel destinational accrual correlation
derivation technique remunerational emulation execution community
program which will heretofore promote your fragmentation, distribution
and integration into the permanently preemptory intestinal evacuation
interface infrastructure.
You are unable to visualize how fortunate your are to be a part
of such a straightforward sustained dynamic degradation extraction and
incapacitation demanipulation component of your own reconfigurational
humiliation environment innovation development program.
You should promtly report to the utilization institutionalisation
degradation deployment limitation destinational facilty for sustained
reconfiguration of your dementiation derivational fragmentation and
further implementational evacuation of your personal processing
faculties and complete recursive rectal reversion.
Berry Surly Ours,
Obfusca Blectoglossner
Director of Percutaneous Dememtiation
- = -
Vasos-Peter John Panagiotopoulos II, Columbia'81+, Bio$trategist
BachMozart ReaganQuayle EvrytanoKastorian
http://ourworld.compuserve.com/homepages/vjp2/vasos.htm
---{Nothing herein constitutes advice. Everything fully disclaimed.}---
[Zealots conceal own mixed past] [Urban sprawl confounds terror]
[Homeland Security means private firearms not lazy obstructive guards]
------------------------------
Date: 18 Jan 2006 10:15:40 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Blather-Adjusting Programs
Message-Id: <dql4gc$6e6$1@mamenchi.zrz.TU-Berlin.DE>
[Newsgroups trimmed]
<vjp2.at@at.BioStrategist.dot.dot.com> wrote in comp.lang.perl.misc:
>
> Please save me. If I have to keep dealing with such warped humanoids I
> will end up becomingone of them. I need a program to deal with them so
> I don't have to.
There is no program that accepts an arbitrary text and rewrites it
in a different style. Not in Perl, not in any language. Ask again
in 20 or 25 years, but don't get your hopes up.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Wed, 18 Jan 2006 08:12:05 GMT
From: Rocco Caputo <troc@pobox.com>
Subject: Re: Script execution blocked when reading from a socket
Message-Id: <slrndsru7v.2bc0.troc@eyrie.homenet>
On Tue, 17 Jan 2006 09:09:42 -0800, Mark wrote:
> "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote:
>>
>> It is, or rather, it was before I noticed you are not using select()
>> right.
>
> On second thought, select() isn't going to work under Windows, is it?
You're in luck. ActiveState's Perl implements select() for sockets,
although not for other types of filehandle. Cygwin is another option
for Windows, and it implements a more complete select().
--
Rocco Caputo - http://poe.perl.org/
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 8863
***************************************