[7879] in Perl-Users-Digest
Perl-Users Digest, Issue: 1504 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 19 04:08:01 1997
Date: Fri, 19 Dec 97 01:00:34 -0800
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, 19 Dec 1997 Volume: 8 Number: 1504
Today's topics:
Re: <SELECT MULTIPLE > Script only gives one value. Ca (Stephen P. Clouse)
Re: Advanced Perl Programming book <ghowland@hotlava.com>
Re: Best port to Win 95? (Dan Sugalski)
Debt Consolidation Loan Program <pfarson@ix.netcom.com>
Re: DEBUGGER: How see expr result ? (Ilya Zakharevich)
Re: Evaluate blank text? <blakem@seas.upenn.edu>
Re: Evaluate blank text? (Stephen P. Clouse)
Re: Forcing list context <ajohnson@gpu.srv.ualberta.ca>
Re: Forcing list context <jvradelis@mediaone.net>
Re: Foreach, array, s/// problem <Tim.Maher@seaslug.org>
Re: HELP: Incredibly easy question that I just cannot f <Tim.Maher@seaslug.org>
Re: Iteration within a foreach loop (Paul)
printing quotes with print command (Glen Bell)
Re: printing quotes with print command <Tim.Maher@seaslug.org>
questions about database scripts ddoedens@indy.net
Single key input on NT4.0 with ActiveWare Perl <whitej@lci.com>
Re: Sorting Hashes By Value (Gabor)
Re: Teaching programing (Chris Winters)
Re: Teaching programing (Kenneth Albanowski)
Re: Threading in NT rodney@bond.net
Re: What kind of machine wouldn't support FLOCK? (Dan Sugalski)
Re: Which language pays most 17457 -- C++ vs. Java? <ghowland@hotlava.com>
Re: Which language pays most 17457 -- C++ vs. Java? <steve@seasoned-software.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 18 Dec 1997 21:40:04 GMT
From: stephenc@granddesign.com (Stephen P. Clouse)
Subject: Re: <SELECT MULTIPLE > Script only gives one value. Can you help?
Message-Id: <349a9723.26239008@news.kc.net>
Hash: SHA1
On Thu, 18 Dec 1997 14:54:01 GMT, stephenc@granddesign.com (Stephen P. Clouse)
wrote:
>foreach $pair (split(/&/,$cgiin)) {
> ($key,$val) = split(/=/,$pair,2);
> $cgi{$key} .= \000 if $cgi{$key};
> $cgi{$key} .= $val;
>}
Whoops...someone was nice enough to point out that I left off the part about URI
decoding. Doh! That's kinda necessary if you want non-alpha characters to be
at all intelligible.
foreach $pair (split(/&/,$cgiin)) {
$pair =~ s/\+/" "/ge;
$pair =~ s/%(..)/pack("c",hex($1))/ge;
($key,$val) = split(/=/,$pair,2);
$cgi{$key} .= "\000" if $cgi{$key};
$cgi{$key} .= $val;
}
Guess it's seven lines now (and in my e-mail reply to the nice person, I wrote
six...I can tell I'm gonna have a good evening :)
- --
Stephen P. Clouse
stephenc@granddesign.com -- steve@warpcore.org -- UIN 135012
Grand Design, Inc. (http://www.granddesign.com) -- Quality Business Web Design
The Warp Core (http://www.warpcore.org) -- The Web's Premier Descent Site
PGP-Encrypted E-Mail Preferred (Key available at www.granddesign.com/stephenc)
Fight Spam/UCE -- http://www.cauce.org
Version: PGP for Business Security 5.5
iQA/AwUBNJmYKWOLD55Fj/ZkEQL/UACfdVEEh8FKF07C8D/SxmX33vo2+0YAoKV7
FZQktLjxN4E2kz5f2Xvola1M
=Tu/i
-----END PGP SIGNATURE-----
This article was posted from <A HREF="http://www.slurp.net/">Slurp Net</A>.
------------------------------
Date: Thu, 18 Dec 1997 19:51:35 +0100
From: Gary Howland <ghowland@hotlava.com>
To: Allen Choy <achoy@us.oracle.com>
Subject: Re: Advanced Perl Programming book
Message-Id: <349970B7.112A@hotlava.com>
Allen Choy wrote:
>
> Hi.
>
> Does anyone have any opinions, good and bad, re: the Advanced Perl
> Programming book?
> I'm considering purchasing it, but don't know much about it.
Gets my vote as the best perl book. Tackles most of the tricky subjects
in perl exceeedingly well, full of real world examples (ranging from
databases to networking to user interfaces), and very easy to read and
understand.
Gary
--
"I kicked the perl habit, and so can you. Ask and I'll show you how."
pub 1024/C001D00D 1996/01/22 Gary Howland <gary@hotlava.com>
Key fingerprint = 0C FB 60 61 4D 3B 24 7D 1C 89 1D BE 1F EE 09 06
------------------------------
Date: 19 Dec 1997 04:38:18 GMT
From: sugalskd@osshe.edu (Dan Sugalski)
Subject: Re: Best port to Win 95?
Message-Id: <67ctnq$dkm$1@news.NERO.NET>
Dustin Mollo (dustin@sonic.net) wrote:
: Martien Verbruggen (mgjv@comdyn.com.au) wrote:
: : Go to http://language.perl.com/info/software.html, and look at the
: : Alien Ports section
:
: Actually, this page is rather dated. I still have a few more things to add
: to the page, but take a look at http://www.perl.com/latest.html. That is
: rather recent, and includes a nice little description of why one would want
: ActiveState's version of Perl over Gurusamy's version and vice-versa
: (thanks to Jeff Urlwin).
:
: The things I need to add, are the platforms that Perl will natively compile
: for. I have the UNIX variants listed, but I also understand it will compile
: on VMS (which versions though), and someone told me that it will compile on
: OS/2. These, among a few other things, should be added to the page shortly.
: If anyone has any thing else, let me know!
All of the released versions of 5.004 (5.004, _01, and _04) compiled
straight from the latest.tar.gz distribution. The 5.005 release should
also compile from the base distribution.
Dan
------------------------------
Date: 19 Dec 1997 06:22:43 GMT
From: <pfarson@ix.netcom.com>
Subject: Debt Consolidation Loan Program
Message-Id: <67d3rj$9dc@sjx-ixn2.ix.netcom.com>
We are not a direct loan company. This is not
for a loan. We cut your debt by consolidating
your unsecured bills, where a loan would not
get you out of debt, but dig your hole even
deeper.
There is a FREE $10.00 Calling Card at the end of this message.
No Credit Check Needed.
No Collateral Needed.
Bankruptcy and bad credit ok.
Not Bankruptcy or New Credit Report Scam. This program is offered thru a
company that has been in biz for over 4 years and over 10,000 satisfied clients behind
it.
To obtain your consolidation, please call:
Chris Logan 1-800-769-0975 ext. 11
DEBT CONSOLIDATION LOAN PROGRAM
NEED TO CONSOLIDATE YOUR UNSECURED BILLS? Are you one of thousands with
no credit and no collateral to help secure approval, or you just have extremely bad credit
and no one wants to help you, and all you hear is stories and more stories?
NO COLLATERAL AND NO CREDIT CHECK!!!!!!!!!
---Turn around time is minimal. We are experienced and are determined to give you the
best possible service. All information is strictly confidential. Program has been offered for
over 4 years and has over 10,000 satisfied customers. Experienced staff of knowledgeable
specialists assure that all accounts are processed in a timely, accurate manner, and are in
communication with the nations leading creditors.
BILL CONSOLIDATION. There is NO CREDIT CHECK for this program. You can be
approved for this program even if you have credit problems- including bankruptcy. No
co-signers. No collateral. Virtually everyone is qualified, since there is a program to fit
nearly everyone's needs.
Through this unique program you will find it easy to obtain a consolidation of all your bills
into one monthly payment! If you have not yet established credit, have late payments,
charge- offs, repossessions, judgments, liens, prior bankruptcy, or have been turned down
previously for the cash or credit you needed --then this program is for you.
To obtain your consolidation, please call:
Chris Logan 1-800-769-0975 ext. 11
SAMPLE PROGRAM INFORMATION
The goal of the program is to restructure your debt. We make it easier and more
affordable for you to pay your monthly unsecured bills (credit cards, personal loans,
student loans and medical bills, etc.)
SHORT TERM BENEFITS:
1. You will have one single payment per month, we issue the payment directly to creditors.
2. We will attempt to lower your monthly payments, enabling you to afford paying your
bills each month.
3. We assist you in stopping creditor harassment.
4. We recommend closing your accounts and work towards lowering your debt to income
ratio.
To be eligible for the buy-out of one or more high interest debts we have a 6-12 month
probationary period during which you must qualify for the Probationary Review.*
This tell us.....
1. You are being responsible to your creditors
2. You are financially able to make reduced monthly payments.
3. Your monthly payments are being received
If you meet the Probationary Review* qualifications, you will be reviewed. If it is
determined that you are eligible for the buy-out, then one or more high interest debt
accounts will be bought out. These accounts will be closed..
LONG TERM BENEFITS:
1-4 short term benefits
5. Bought out account balances are brought to zero
6. You will get a more reasonable interest rate on bought out accounts, up to 20% less
7. You will start to re-establish your credit rating because bought-out account balances
will show zero. Your credit rating will be rehabilitated while you are paying loan to us
because we will report to the credit bureaus when you are current in your payments.
If and when you qualify for the buy-out. Accounts will be purchased that are most
beneficial to you. This means accounts with the highest interest rates.
To obtain your consolidation, please call:
Chris Logan 1-800-769-0975 ext. 11
YES, Through this unique program you can get the FINANCIAL RELIEF YOU NEED!! If
you have credit problems, then this program is designed just for you! Your chances are
excellent for approval. We operate entirely by mail. Call today to get started.
NOW YOU CAN GET A BILL CONSOLIDATION
EVEN IF YOU HAVE BAD CREDIT!
Do you need to consolidate bills, lower monthly payments, cut interest payments, or any
other worthwhile purpose for a consolidation? Are you unable to get approval because a
problem with your credit record has caused banks to turn you down in the past? If you have
a credit problem, then we can help! This letter is your invitation to participate in our
"DEBT CONSOLIDATION LOAN PROGRAM."
At "PEOPLES CREDIT SERVICES" we understand if you have had problems with credit
and believe you deserve a second chance! Credit is a necessity in todays society--no one
plans to get bad credit. It is usually an unexpected event that triggers the fall, such as a
family break-up, lay-off from work, medical problems, or just simply letting your bills get
away from you. It takes years to build up good credit but only a couple missed payments to
destroy your credit rating. Once you have left the circle of good credit, nobody wants to
give you another chance. You may be a quality person with a steady job and a bright future
but are the victim of the "DENIAL" mentality of many lenders that prohibits you from
getting help you need when you need it most. But now you no longer have to take "NO"
for an answer!
PEOPLES CREDIT SERVICES was founded to-provide assistance to individuals with
credit problems. We feel that a negative credit history should not stand in the way from you
receiving help you need--even if you have late payments, charge-offs, repossessions, or
have been recently turned down. You see, we've discovered a surprising fact: Individuals
will credit problems are more likely to fulfill new obligations because they appreciate the
second chance that they worked hard for, and want to put their negative experience behind
them. They want to re-establish good credit and start fresh. At "P.C.S." we want to
maintain a helpful relationship with you--We don't view our clients as account numbers.
To obtain your consolidation, please call:
Chris Logan 1-800-769-0975 ext. 11
Probationary Period Review:
1. You must be a collection payment program member for at least six months.
2. Your payments must be received in our office on or before the due date.
3. Your payments must be in the form of a money order, personal checks are not excepted.
4. You can not have applied for or had existing credit extended during this probationary
period.
5. Your employment status at the time of the review and buy-out must equal to or be
greater than your status at the start of the program.
6. Your income must be verified by you employer and W2 form. If you are self employed
you must provide your most recent tax return.
7. You must have references of four relatives who can verify your address, phone number,
employment phone number, at least 30 days prior to the change.
8. You must notify us of any changes in address, phone number, employment phone
prior to change.
9. You must comply with any requests for further information.
----------------------------------------------------------------------------------------------
| This is a FREE $10.00 CALLING CARD! |
| |
| To Activate This Calling Card |
| Call 1-800-962-2190 Acct Rep: PF569022 |
| |
| They give you a card number: __ __ __ __ __ __ __ __ __ __|
| |
| To use dial: 1) 1-888-TEL3-444 2) Enter your card #, |
| 3) Dial 1 + Area Code + Number. ## Places another call. |
----------------------------------------------------------------------------------------------
------------------------------
Date: 19 Dec 1997 05:16:48 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: DEBUGGER: How see expr result ?
Message-Id: <67d000$3kv$1@agate.berkeley.edu>
In article <349938EB.89BE0BCB@timji.seaslug.org>,
Tim Maher <tim@timji.seaslug.org> wrote:
> So in Perl, when the debugger has just evaluated the following:
> s/abc/def/g # how many subs did it do?
> or
> $count <= 16
>
> how can I directly see the result ? (i.e., without watching the way it
> branches to conditionally executed code, etc., which still would not
> tell me the value of the result, just its T/F status)
If it is assigned to something, you may e`x'amine this something.
Otherwise it is executed in void context, thus will not return
anything.
> In a similar vein, when it hits a sub return statement, I see the
> expression that
> calculates the return value, but I don't get to see the return value
> itself! There
> must be a way . . .
See documentation for `r' command. But again, it will not work in
void context.
Ilya
------------------------------
Date: 19 Dec 1997 02:51:49 GMT
From: "Blake D. Mills IV" <blakem@seas.upenn.edu>
Subject: Re: Evaluate blank text?
Message-Id: <67cng5$nj0$1@netnews.upenn.edu>
Chipmunk <rjk@coos.dartmouth.edu> wrote:
: They're not. In fact, none of the three conditionals are equivalent.
: ($firstname eq '') true if $firstname is: undefined, ''
: (not $firstname) true if $firstname is: undefined, '', 0
: (not defined($firstname)) true if $firstname is: undefined
: In particular, only the first one is likely to be correct for the
: original posters needs, to detect blank input in a form.
: Chipmunk
My bad.. it looks like you're right. I just checked, and both CGI.pm
and cgi-lib.pl treat blank fields as the null-string. I always thought
blank fields were left undefined.... hence the qualified "essentially
equivalent" above.
Thanks.
-Blake
------------------------------
Date: Fri, 19 Dec 1997 04:15:22 GMT
From: stephenc@granddesign.com (Stephen P. Clouse)
Subject: Re: Evaluate blank text?
Message-Id: <349af483.3307065@news.kc.net>
Hash: SHA1
On Thu, 18 Dec 1997 16:51:09 -0500 in message <<67c68g$3rb$1@gamera.albany.net>
comp.lang.perl.misc>, "FeckMan" <feckman@albany.net> wrote:
>I'm a perl newbie who is trying to get a script to ensure that all the
>required fields of an HTML form have been filled out (simply not left
>blank), and, if not, to generate an error page. The script works great
>except for ONE thing -- I can't figure out how to make the script evaluate
>whether or not a variable posted to it from a form is blank or not.
Since a null value always evaluates to false, just use:
if (!($cgivar)) { gripe; }
At least it works on every script I've written...
- --
Stephen P. Clouse
stephenc@granddesign.com -- steve@warpcore.org -- UIN 135012
Grand Design, Inc. (http://www.granddesign.com) -- Quality Business Web Design
The Warp Core (http://www.warpcore.org) -- The Web's Premier Descent Site
PGP-Encrypted E-Mail Preferred (Key available at www.granddesign.com/~stephenc)
Fight Spam/UCE -- http://www.cauce.org
Version: PGP for Business Security 5.5
iQA/AwUBNJn01WOLD55Fj/ZkEQJ0WQCfb5I2VpH6QCMdv9s9p80OedShZbcAn0U9
8fUwpH0jpRgtcpA5AX455tr+
=YgAg
-----END PGP SIGNATURE-----
This article was posted from <A HREF="http://www.slurp.net/">Slurp Net</A>.
------------------------------
Date: Thu, 18 Dec 1997 21:07:25 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Forcing list context
Message-Id: <3499E4ED.7219732B@gpu.srv.ualberta.ca>
Peter Scott wrote:
!
! Okay, suppose you have a string you want to count the number of
! occurrences of a substring in, e.g., you want to find out how many
! "foo" there are in $s = "foofooraw for foodies". Now $s =~ /foo/g
! will return a list of them, and we just want the size of the list;
! but doing $x = ($s =~ /foo/g) causes the /g modifier to be evaluated
! in scalar context (so it doesn't do any good to put "scalar" in there),
! and so it looks like one has to do my @a = ($s =~ /foo/g); my $x = @a;
!
! It just rankles to name and create a new variable for this purpose;
! the laziness virtue in me thinks there has to be a way to do without.
! Is there? What am I missing?
this works with perl5.004 or later:
$s = "foofooraw for foodies";
$x=()=$s=~/foo/g;
print $x;
or, with version 5 less than 5.004
$s = "foofooraw for foodies";
$x=@{[$s=~/foo/g]};
print $x;
hope it helps
regards
andrew
------------------------------
Date: Fri, 19 Dec 1997 01:38:38 -0500
From: "James T. Vradelis" <jvradelis@mediaone.net>
Subject: Re: Forcing list context
Message-Id: <349A166D.4A9AACF2@mediaone.net>
This works:
$s = "foofooraw for foodies";
print (scalar (@results = ($s =~ /foo/g)));
Jim Vradelis
Legal Computer Solutions, Inc.
http://www.lcsweb.com
------------------------------
Date: Thu, 18 Dec 1997 21:23:05 +0000
From: Tim Maher <Tim.Maher@seaslug.org>
To: James Gryga <jamesgry@netcom.com>
Subject: Re: Foreach, array, s/// problem
Message-Id: <34999439.BEA66657@seaslug.org>
James Gryga wrote:
> Hi, Thank you for taking the time to read and hopefully reply to this
> post.
>
> I have a script that checks for a key word at the begining of the line
>
> and if it finds that word, it deletes the line and writes the
> corrected
> version of the file. That part was simple. for example:
>
> #!/usr/bin/perl -pi
>
> s/^Word1: (.*)\n//g;
> s/^Word2: (.*)\n//g;
> .
> .
> .
> and so on.
>
> this works very well. However, since most of the lines are identical
> except for the key work, I thought of using an array and the foreach
> statement.
>
> #!/usr/bin/perl -pi
>
> @Array = ("Word1: ", "Word2: ", "Word3: ", ...and so on);
>
> foreach $element (@Array) {
> s/^$element (.*)\n//g;
> }
>
> This does not work. I am probably overlooking something very simple.
That's right, it doesn't. Yes, you are! In the foreach case, you are
requiring
2 <SP>s after the colon, because you've embedded one after each word in
the array, and you've added a second one after the variable reference in
the RE.
> Any help would be appreciated.
>
> jim
--
====================================================================
| Tim Maher, Ph.D. Tel/Fax: (206)781-UNIX |
| Head UNIX Guru, CONSULTIX Email: tim@consultix.wa.com |
| *The UNIX Training Experts* http://www.consultix.wa.com/yumpy/ |
====================================================================
------------------------------
Date: Thu, 18 Dec 1997 21:11:38 +0000
From: Tim Maher <Tim.Maher@seaslug.org>
To: James East <james@abgroup.demon.co.uk>
Subject: Re: HELP: Incredibly easy question that I just cannot find the answer to!
Message-Id: <3499918A.845A4893@seaslug.org>
James East wrote:
> Hi.
>
> Can someone please tell me how to put an or operator in an if
> statement?
> What I want to do is:
>
> if ($graphics eq "no") or ($graphics eq "yes") {
> ...
> }
>
> How do I do this?
if ( ($graphics eq "no") or ($graphics eq "yes") ) {
You need parens around the entire compound expression. You could often
actually leave out the ones around the individual expressions when using
or/and,
but it's probably a good habit to leave them in.
>
>
> Replies to e-mail would be appreciated. Thanks a lot.
>
> James East
--
====================================================================
| Tim Maher, Ph.D. Tel/Fax: (206)781-UNIX |
| Head UNIX Guru, CONSULTIX Email: tim@consultix.wa.com |
| *The UNIX Training Experts* http://www.consultix.wa.com/yumpy/ |
====================================================================
------------------------------
Date: 19 Dec 1997 04:35:34 GMT
From: paul@pmcg.com (Paul)
Subject: Re: Iteration within a foreach loop
Message-Id: <67ctim$ni1$1@la-mail4.digilink.net>
In article <3499D049.F86AAB05@coos.dartmouth.edu>
Chipmunk <rjk@coos.dartmouth.edu> wrote:
>
> Use a for loop instead of a foreach loop.
>
> for ($i=0; $i<=$#buf; ++$i) {
> if ($buf[$i] =~ /$match_this_puppy/) {
> $i+=2;
> }
> }
Bingo! :) Thanks.
Paul
------------------------------
Date: Thu, 18 Dec 1997 18:09:13 GMT
From: bell@cet.com (Glen Bell)
Subject: printing quotes with print command
Message-Id: <67borr$dvj$2@legends.cet.com>
Hello
I hope you do not mind me asking a question about perl.
I am trying to do this
print NEWFILE " <body bgcolor="#FFFFFF"
background="../backgrounds/ruff.jpg">";
but I get a malformed header error. I am assuming this is because of the
quotes inside the quotes. Is there a way to do this and not cause an error.
I tried using %22 but did not give me the proper background color or the
background so i am assuming this was not correct. Can you tell me how to do
this or if I can do it at all.
please E-Mail me at bell@cet.com if you can help
------------------------------
Date: Thu, 18 Dec 1997 21:06:51 +0000
From: Tim Maher <Tim.Maher@seaslug.org>
To: Glen Bell <bell@cet.com>
Subject: Re: printing quotes with print command
Message-Id: <3499906B.C289E66@seaslug.org>
Glen Bell wrote:
> Hello
>
> I hope you do not mind me asking a question about perl.
In this newsgroup, that's the only thing we cannot object to! 8-}
>
>
> I am trying to do this
> print NEWFILE " <body bgcolor="#FFFFFF"
> background="../backgrounds/ruff.jpg">";
use single quotes to encase the literal string containing the double
quotes,like so: print NEWFILE '<body....".....">';
Or, even more work, you could use double quotes as you did but put a
backslash
before each of the nested double quotes.
> but I get a malformed header error. I am assuming this is because of
> the
> quotes inside the quotes. Is there a way to do this and not cause an
> error.
> I tried using %22 but did not give me the proper background color or
> the
> background so i am assuming this was not correct. Can you tell me how
> to do
> this or if I can do it at all.
>
> please E-Mail me at bell@cet.com if you can help
------------------------------
Date: Thu, 18 Dec 1997 22:31:01 -0500
From: ddoedens@indy.net
Subject: questions about database scripts
Message-Id: <3499EA75.1FB4@indy.net>
Hello,
i am very new to Perl and am working on a project that uses Perl to do
take the info from a web page and search a database. I have found
several sites that offer help to people new to perl. I am confused
about the various free scripts out there. They all seem to refer to
different standards , Berkley, SQL, etc...What is the difference between
all of these...Can I uses these scripts to queiry my database (with a
little modification maybe)...
Any help would be greatly appreciated...i am learning
Thanks
ddoedens@indy.net
------------------------------
Date: Thu, 18 Dec 1997 13:04:29 -0500
From: John Gordon White <whitej@lci.com>
Subject: Single key input on NT4.0 with ActiveWare Perl
Message-Id: <349965AD.1804D1A@lci.com>
This is a multi-part message in MIME format.
--------------76DB96CEDA7FCE3343DCB7A3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I'm hoping this will be a simple question -- for someone else ...
How can I do single key input from the keyboard?
I'm not sure yet if I need for this to be a read with wait or without.
It would be best if I can choose. The application will be similar to a
hex editor.
I'm using ActiveWare's Perl for Win32 Build 312 (compliant to Perl
V5.003_07), on an NT 4.0 workstation. It's excellent. It doesn't have
fcntl(), but buried down in the libraries there is a Fcntl module which
calls the Fcntl.pll dynamic load library. Other than comments in the
module, there's no documentation.
Thanks!
--------------76DB96CEDA7FCE3343DCB7A3
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for White (at work), John
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: John White (at work)
n: White (at work);John
org: LCI International
email;internet: whitej@lci.com
title: Unix System Administrator
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------76DB96CEDA7FCE3343DCB7A3--
------------------------------
Date: 19 Dec 1997 03:02:34 GMT
From: gabor@vinyl.quickweb.com (Gabor)
Subject: Re: Sorting Hashes By Value
Message-Id: <slrn69johj.d0p.gabor@vinyl.quickweb.com>
In comp.lang.perl.misc, Stephan Vladimir Bugaj (bugaj@bell-labs.com) on Thu, 18 Dec 1997 11:12:29 -0500 writes:
# Other than using a less moronic sorting routine than selection
# sort (like quicksort or insertion sort, which I'm writing right
# now) is there a better way to sort hashes on values than this:
you are going too complicated, how about this
@values = sort {$hash{$a} cmp $hash{$b}} keys %hash;
or to sort in descending order
@values = sort {$hash{$b} cmp $hash{$a}} keys %hash;
or you could use for ascending order values
@values = sort values %hash;
change 'cmp' to '<=>' if you have integer values.
gabor.
--
Be consistent.
-- Larry Wall in the perl man page
------------------------------
Date: Fri, 19 Dec 1997 03:25:53 GMT
From: cwinters@clark.net (Chris Winters)
Subject: Re: Teaching programing
Message-Id: <3499e8db.8153867@news.clark.net>
Jacqui Caren <Jacqui.Caren@ig.co.uk> wrote:
>Other languages aimed at educational use such as Logo may also
>be a good first step.
>
>I would (depending upon skills etc) start with Pascal. It provides
>a better programming model for teaching than BASIC.
>
>There should be some very good Pascal primers designed for teaching
>purposes.
I remember with fondness the text *Oh, Pascal!* from my high
school days. I saw recently that it had been updated since then
(which wasn't that long ago). Not quite up to the Camel book, but
still very readable and easy to understand.
Chris
Chris Winters
Webmaster
cwinters@clark.net
------------------------------
Date: 18 Dec 1997 03:18:42 -0500
From: kjahds@kjahds.com (Kenneth Albanowski)
Subject: Re: Teaching programing
Message-Id: <67am92$7lj@kjahds.kjahds.com>
In article <673kfq$6nk$1@Starbase.NeoSoft.COM>,
Will Morse <will@Starbase.NeoSoft.COM> wrote:
>
>I really think that any computer language is okay. perl, or any other
>interpretted language, is better for this purpose than, say, C or any other
>compiled language, for the simple reason that the turnaround to fix a problem
>or try an alternative is less. Tcl/Tk would also be a good alternative
>because they could get graphics, which kids all like.
What about LOGO?
--
Kenneth Albanowski (kjahds@kjahds.com)
------------------------------
Date: Thu, 18 Dec 1997 22:01:10 -0600
From: rodney@bond.net
To: jeffery@mitre.org
Subject: Re: Threading in NT
Message-Id: <882503882.1123483649@dejanews.com>
In article <3491597F.8FBD5D59@mitre.org>,
Jeffery Schweiger <jeffery@mitre.org> wrote:
>
> I am tryijng to write a multitasking program on Windows NT. I have
> noticed that
> the NT version of perl does not support the fork command and threading
> in Perl is
> suppose to be in the next release of Perl (5.005).
>
> Is there a way to multitask with Peal for NT?
The Unix Perl (with real fork and exec) is available with OpenNT. It
is a Unix subsystem on NT -- so you get all the other Unix semantics
on it too. There are a lot of people running OpenNT for the real perl
to do work for web server engines. They're at www.opennt.com.
- Rodney
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 19 Dec 1997 05:24:09 GMT
From: sugalskd@osshe.edu (Dan Sugalski)
Subject: Re: What kind of machine wouldn't support FLOCK?
Message-Id: <67d0dp$hhd$1@news.NERO.NET>
Tom Christiansen (tchrist@mox.perl.com) wrote:
: In comp.lang.perl.misc, syarbrou@ais.net (Steve) writes:
: :I have done extensive testing of flock on unix systems anyways and
: :several systems have it, but only Linux truely seems to support it.
: :All the other flavors of UNIX accept the command but do not work.
:
: I cannot contain my disbelief: what was your test? What you're saying
: is exceedingly scary, and to the best of my occasionally splotchy
: memory, contrary to my own empirical checks. You should look through
: /usr/src/perl/pp_sys.c for the contortions we go through to make this
: work supporting the system calls of flock, fcntl, or lockf. I believe
: that the current version of Perl works on virtually all systems vaguely
: programmer-friendly, and many that aren't.
[Some snippage]
: VMS seems to suffer here, since /usr/src/perl/vms/perlvms.pod says:
:
: The following functions were not implemented in the VMS port,
: and calling them produces a fatal error (usually) or
: undefined behavior (rarely, we hope):
:
: chroot, dbmclose, dbmopen, fcntl, flock,
This is, unfortunately, true. However, VMS has locking welded into its
filesystem--opening a file for update will lock the file against
modifications by other processes.
A VMS emulation of flock or fcntl is on the to-do list. (VMS supports
record and file locking just fine, it just does it in a decidedly
non-flock/fcntl-ish way)
Dan
------------------------------
Date: Thu, 18 Dec 1997 19:42:12 +0100
From: Gary Howland <ghowland@hotlava.com>
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <34996E84.4A96@hotlava.com>
Craig A. Johnston wrote:
>
> COBOL. COBOL pays the most. Get to it, son.
This is not strictly true - MUMPS pays even more than COBOL.
However, there are more COBOL positions available (but it makes
no difference, since you'll never find an unemployed MUMPS or COBOL
programmer).
Gary
--
"I kicked the perl habit, and so can you. Ask and I'll show you how."
pub 1024/C001D00D 1996/01/22 Gary Howland <gary@hotlava.com>
Key fingerprint = 0C FB 60 61 4D 3B 24 7D 1C 89 1D BE 1F EE 09 06
------------------------------
Date: Wed, 17 Dec 1997 23:17:11 -0800
From: steve <steve@seasoned-software.com>
To: Gary Howland <ghowland@hotlava.com>
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <3498CDF7.4EF2248E@seasoned-software.com>
This is a multi-part message in MIME format.
--------------41E644ED503192B6E1A5D7F4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Gary Howland wrote:
> Craig A. Johnston wrote:
> >
> > COBOL. COBOL pays the most. Get to it, son.
>
> This is not strictly true - MUMPS pays even more than COBOL.
> However, there are more COBOL positions available (but it makes
> no difference, since you'll never find an unemployed MUMPS or COBOL
> programmer).
MUMPS? Better get VAXinated for that one! Sorry, couldn't resist. Old
joke, I know! 8-)
>
>
> Gary
> --
> "I kicked the perl habit, and so can you. Ask and I'll show you how."
>
> pub 1024/C001D00D 1996/01/22 Gary Howland <gary@hotlava.com>
> Key fingerprint = 0C FB 60 61 4D 3B 24 7D 1C 89 1D BE 1F EE 09 06
--------------41E644ED503192B6E1A5D7F4
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for steve
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: steve
n: ;steve
org: SEASONED SOFTWARE
email;internet: steve@seasoned-software.com
note: notes would be here!
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------41E644ED503192B6E1A5D7F4--
------------------------------
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 1504
**************************************