[8127] in Perl-Users-Digest
Perl-Users Digest, Issue: 1746 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 27 20:07:41 1998
Date: Tue, 27 Jan 98 17:01:40 -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 Tue, 27 Jan 1998 Volume: 8 Number: 1746
Today's topics:
Re: READ THIS FIRST (brian d foy)
Re: READ THIS FIRST <rootbeer@teleport.com>
Re: READ THIS FIRST (Martien Verbruggen)
Re: Remove elements of array1 from array2. (Richard Bellavance)
Re: Remove elements of array1 from array2. (Charles DeRykus)
Re: Remove elements of array1 from array2. <rootbeer@teleport.com>
Re: Request: GUI's considered harmful (Martien Verbruggen)
Re: Sending binary files on a Socket. There has to be a <w.stanton@auckland.ac.nz>
Re: Simple Question - Hopefully! (Martien Verbruggen)
Re: Survival Of perl <tchrist@mox.perl.com>
Re: Survival Of perl <tchrist@mox.perl.com>
Re: Survival Of perl (I R A Aggie)
Re: UK download sites? <news@outline.ednet.co.uk>
unzip utility for alpha NT? angyny@interport.net
Re: vcard.vcf (Martien Verbruggen)
Re: win32:ftp (Chris Winters)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 27 Jan 1998 18:13:20 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: READ THIS FIRST
Message-Id: <comdog-ya02408000R2701981813200001@news.panix.com>
Keywords: from just another new york perl hacker
In article <19980127183700.NAA07434@ladder02.news.aol.com>, enrold@aol.com (ENROLD) posted:
> SPECIAL REPORT!
>
> Programmer's Report 1998. For all JAVA, C++, C programmers ONLY.
why is it in comp.lang.perl.misc then? oh, i didn't see the aol
address...
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
------------------------------
Date: Tue, 27 Jan 1998 15:49:48 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: ENROLD <enrold@aol.com>
Subject: Re: READ THIS FIRST
Message-Id: <Pine.GSO.3.96.980127154923.22373z-100000@user2.teleport.com>
On 27 Jan 1998, ENROLD wrote:
> Newsgroups: comp.lang.perl.misc
> Programmer's Report 1998. For all JAVA, C++, C programmers ONLY.
Then why are you bothering us with this?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 28 Jan 1998 00:39:21 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: READ THIS FIRST
Message-Id: <6alunp$dns$4@comdyn.comdyn.com.au>
In article <19980127183700.NAA07434@ladder02.news.aol.com>,
enrold@aol.com (ENROLD) writes:
[Some idiotic spam]
Don't fall for this crap. Don't deal with spammers. You can't trust them.
Do I really need to tell anyone this? heh.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: 27 Jan 1998 17:57:25 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: Remove elements of array1 from array2.
Message-Id: <6alool$qd1@ocean.CAM.ORG>
In article <34CE5FB0.4DEA44D3@ms.com>, Shaun Ledford <shaun@ms.com> wrote:
>I'm trying to remove each val of %1 from %2.
>
> %1 %2
> key val key val
> ---------- ----------
> 1 foo 1 foo Password = "bar"
> 2 abc 2 xyx Password = "..."
> 3 abc Password = "foo"
> 4 xyz Password = "jsh"
>
>
> %RESULT
> key val
> -------------
> 1 xyx Password = "..."
> 2 xyz Password = "jsh"
Ok, try this then:
delete @hash2{ values %hash1 };
Now, it's not too clear if the keys for %2 and %RESULT are "1, 2, ..." or
"foo, xyx, ...". I have assumed it's the latter. If you're using numeric
keys and you want to preserve an order to your data, you'd probably be better
off using arrays instead of hashes...
Hope this helps,
Richard.
--
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: Tue, 27 Jan 1998 22:35:40 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Remove elements of array1 from array2.
Message-Id: <EnGs3G.Ap2@bcstec.ca.boeing.com>
In article <34CE0A49.5FBA09E2@ms.com>, Shaun Ledford <shaun@ms.com> wrote:
>Is there a clean way of removing the elements of hash table 1 ( login
>name ) from hash table 2 ( names and password file )?
>
In addition to the "delete" one-liners already posted,
you could use undef. Maybe a shade faster too if you're
in a hurry :)
undef @hash2{keys %hash1};
HTH,
--
Charles DeRykus
------------------------------
Date: Tue, 27 Jan 1998 15:35:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Honza Pazdziora <adelton@fi.muni.cz>
Subject: Re: Remove elements of array1 from array2.
Message-Id: <Pine.GSO.3.96.980127153400.22373w-100000@user2.teleport.com>
On Tue, 27 Jan 1998, Honza Pazdziora wrote:
> for (keys %hash_table_1)
> { delete $hash_table_2{$_} if exists $hash_table_2{$_}; }
Why the if test? That's implicit in the delete. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 28 Jan 1998 00:24:31 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Request: GUI's considered harmful
Message-Id: <6altrv$dns$1@comdyn.comdyn.com.au>
[CC to both posters quoted]
In article <6agmge$kbo$2@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> writes:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> Terrence Brannon <brannon@surf.usc.edu> writes:
>:Tom, I lost my copy of your document "GUI's considered harmful" when I
>:moved. Could you possibly email it to me?
>
> Unfortunately, so did I. :-(
>
> --tom
A copy I had lying around:
] Newsgroups: comp.unix.misc,alt.religion.computers,comp.windows.misc,comp.windows.news,comp.windows.x,comp.human-factors,comp.windows.open-look,comp.windows.x.motif
] Path: convex!tchrist
] From: Tom Christiansen <tchrist@convex.COM>
] Subject: GUIs Considered Harmful
] Message-Id: <1992Aug19.192513.28287@news.eng.convex.com>
] Date: Wed, 19 Aug 1992 19:25:13 GMT
] Reply-To: tchrist@convex.COM (Tom Christiansen)
] Organization: Convex Computer Corporation, Colorado Springs, CO
] Followup-To: alt.religion.computers
[Despite the broad initial coverage here, please note the Followup-To:
line, which is meant only as a guideline, not a command; amend the
newsgroups line as you see fit.]
GUIs Considered Harmful
I am increasingly troubled by how many new applications are designed to
work solely under a GUI. While this may make some amount of sense for
people coming from the PC or Mac worlds, one of the strengths of Unix
has always been the ability to use it from anywhere. These people
don't seem to understand this.
Of how much ultimate utility is that nifty new spreadsheet, editor, or
debugger if I can't dialup from the field and run it on my vt100? Too
often a tool that "does windows" is little more than a marketing
gimmick to dazzle impressionable users into not noticing that they
don't have the real functionality they need.
GUI-minded programs seldom lend themselves to being used as components
in larger tools. As such, they do not fit well into the UNIX
tool-and-filter philosophy. Instead of each being a single program
that modestly attempts to do one thing well, they are a throwback to
the Bad Old Days when each program was a standalone, monolithic monster
that didn't interface with anything else.
It's all well and good to place a GUI wrapper around an existing tool,
but to design a new application with only a GUI interface in mind is to
forever limit that tool's flexibility. After all, how to you write a
shell script that drives an automated xrn session?
Providing programmability for the fancy graphics software remains an
open problem. The most effective use of GUIs in UNIX environments is
to design the nitty-gritty computational function as a "back end" that
can be driven either manually or automatically.
The GUI wrapper should be a separable module. If they're plug-replaceable,
the application isn't irretrievably wedded to any specific GUI technology,
such as SunView, NeWS, or even X11 or its children, like Open Look or
Motif. Sending standard commands down a pipe the way the STDWIN or wafe
packages behave is also a reasonable approach.
This means your program should be runnable both with and without the
GUI present, and accept input from a mouse or under programmed
control. Preferably that means both a shell-level interface for
convenience and a C-level interface for efficiency; Perl programmers
could elect either method. That way, naive users can use push-button
GUIs, blind users can use Braille terminals, and sophisticated users
can program solutions to intricate problems.
It has been noted that GUIs make simple things simple, and complex ones
impossible. Certainly it is worthwhile to make simple things simple.
But too often software is geared to only one level of expertise. That
which is novice-friendly is too frequently expert-hostile, and vice
versa. Being needlessly forced to click the mouse over a menu will
slow down the expert user who is more comfortable with a keyboard
interface.
Gratuitous distractions from the keyboard only slow down the experienced
user. A precision pointing device that didn't require taking your hands
off the keyboard would help. There are cases where only a GUI makes
sense, like a CAD system. Being able to delineate a region or draw a
figure with a mouse is probably a reasonable use for it, but selection of
a range of possibilities isn't, at least not after you've become familiar
with the tool.
--tom
--
Tom Christiansen tchrist@convex.com convex!tchrist
A truly wise man never plays leapfrog with a unicorn.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: 28 Jan 1998 12:36:09 +1200
From: Worik Macky Stanton <w.stanton@auckland.ac.nz>
Subject: Re: Sending binary files on a Socket. There has to be a better way.
Message-Id: <wkra5tigee.fsf@auckland.ac.nz>
Friends...
To answer my own question...
Instead of getc or sysread I used recv
I have to check the ammount received is what is wanted.
Worik Macky Stanton <w.stanton@auckland.ac.nz> writes:
>
> my $l = length $data;
> print $s $l . $EOT . $data; # $EOT is the 'end of transmission' marker
>
> To recieve it...
>
> my $ch;
> my $l = '';
> while(1){
$s->recv $ch, 1;# instead of $ch = $s->getc;
> last if $ch eq $EOT;
> $l .= $ch;
> }
> my $i;
> my $data = '';
while($l > 0){
my $buff;
$s->recv $buff, $l;
$data .= $buff;
$l -= length $buff;
}
Instead of...
> for($i = 0; $i < $l; $i++){
> $data .= $s->getc;
> }
>
voila
Worik
------------------------------
Date: 27 Jan 1998 23:39:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Simple Question - Hopefully!
Message-Id: <6alr7u$djg$2@comdyn.comdyn.com.au>
In article <34C919CD.2781@meta3.com>,
Ken Holm <rets@meta3.com> writes:
> if (-T $rte) {
> open (IN, $rte);
Even if your script is just an example, or maybe especially then,
you should always check the return value of open. Even if you know
that the file is a text file (odd test, anyway, a lot slower than
simply testing for existence), the program still might not have the
permissions required to open it.
> ...
> } else {
> nofile();
> }
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | I think I think, therefore I think I
Commercial Dynamics Pty. Ltd. | am.
NSW, Australia |
------------------------------
Date: 27 Jan 1998 22:50:44 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Survival Of perl
Message-Id: <6aloc4$ql6$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, chip@pobox.com writes:
:Hm, yes. Kind of like TV. And they're both financed by advertising
:and corporate public relations. Coincidence -- or *conspiracy*?!?!
Read Norman Spinrad's take in this issue of Asimov's on why the same
people have killed read science fiction. Same reason as they've screwed
up our nifty little world by making it popular.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"If you think Emacs is such a great editor, just look what it did for
Richard Stallman's typing skills!"
------------------------------
Date: 28 Jan 1998 00:24:39 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Survival Of perl
Message-Id: <6alts7$3ar$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, Jason Christian <jason@primal.ucdavis.edu> writes:
:... that I fear that I might have written Perl
:off as a difficult (well, I think the OO stuff is hard) language used
:mainly by a lot of arrogant and rude people.
Pretending that OO is somehow inherently better is definitely a way
to turn people off to perl. OO doesn't necessarily make for smaller,
easier, more robust, simpler, more scalable, or more portable code.
Often, it makes for the reverse.
The increasingly numbers of OOO modules (overly object oriented) on CPAN
is a very disturbing trend.
Good things about OO actually can help with is you *may* get better
software design, and you may get better software reuse. But the rest
is mostly mythological.
Objects have their place, but they aren't the Ultimate Solution.
They are just another technique, a tool. Learn not to apply the same
tool to each problem. It's the wrong way.
Likewise with threads. Far More Than Enough Rope to baffle the accidental
programmer.
I don't think people who can't even program matrix multiply should
be attempting multiply inherited operator-overloaded peristent distributed
object modules.
I call for perl to return to its plebian roots, eschewing confusing
approaches that drive out the average person.
Otherwise we just get Java with dollar signs:
$MyHappyFile = IO::File::Text::CommaSeparated::Locked->update(
Sys::Independent::Filename->build_it(
VOLUME => $disk,
PARTITION => $filesystem,
HOST_SYSTEM => $inetaddr,
FOLDER_FLAVOR => $dirname,
FILENAM_EXT => $filename)
);
if (! $MyHappyObject->exclusive_access_upgrade->is_successful() ) {
$MyHappyObject->raise_exception(Exception->new("IO")->fatal());
}
$rec = $MyHappyFile->build_record(@list)->quoted();
$MyHappyObject << $rec;
Simpler is better. Remember your roots. Kill complexity.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
signal(i, SIG_DFL); /* crunch, crunch, crunch */
--Larry Wall in doarg.c from the perl source code
------------------------------
Date: Tue, 27 Jan 1998 19:41:54 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Survival Of perl
Message-Id: <fl_aggie-2701981941550001@aggie.coaps.fsu.edu>
In article <Pine.OSF.3.95.980127131405.8876J-100000@primal.ucdavis.edu>,
Jason Christian <jason@primal.ucdavis.edu> wrote:
+ And yet... the level of snappishness in this newsgroup has increased so
+ much since I first perused it, that I fear that I might have written Perl
+ off as a difficult (well, I think the OO stuff is hard) language used
+ mainly by a lot of arrogant and rude people. That would be too bad, at
+ least for me.
You go and answer the same question 50 times and see if you don't get
a little snippy. Then have one (or more) of those people asking questions
_demand_ that you provide the answer, and when it isn't to their liking,
have them _demand_ the answer they want.
A fer instance (I've actually had this exchange as User B):
User A. I want to do X in perl 4. How can I do X in perl 4?
User B. It's very difficult to do X in perl 4. Perl 4 is dead, dead, dead,
upgrade to v5, where doing X is trivial.
User A. I have to do it in perl 4. What is the solution under perl 4?
User B. The solution is to upgrade to perl 5.
User A. But that's not the answer that I want. Give me a perl 4 solution!
User B. There isn't one. There isn't likely to be one. Perl 4 is quite dead,
and unsupported. The solution is to upgrade to v5, but if you can't
or won't do that, then you'll have to find your own solution. Sorry.
User A. What a helpful lot you are!
That's the sort of thing that tries a body's soul.
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Tue, 27 Jan 1998 23:01:27 -0000
From: "Chris Lamb" <news@outline.ednet.co.uk>
Subject: Re: UK download sites?
Message-Id: <6alont$7q8$1@monteverdi.ednet.co.uk>
Please ignore my previous posting, I found the sunsite after buying the
O'Reilly book "Learning Perl on Win32 systems". I apologise for wasting
anyones time !
Chris
------------------------------
Date: Tue, 27 Jan 1998 19:02:59 +0800
From: angyny@interport.net
Subject: unzip utility for alpha NT?
Message-Id: <34CDBEE3.42A1@interport.net>
Does anyone know which unzip utility tool that I can use to unzip
the Perl installation file on alpha NT?
(I try WinZip and info-zip, they don't work on alpha NT)
------------------------------
Date: 28 Jan 1998 00:37:19 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: vcard.vcf
Message-Id: <6alujv$dns$3@comdyn.comdyn.com.au>
In article <34CE0773.36E52214@fccj.cc.fl.us>,
"Bill Jones, FCCJ Webmaster" <webmaster@fccj.cc.fl.us> writes:
> OK
>
> My Card is gone.
>
> As far as MIME goes... Tuf
I don't mind. I can always add you to my killfile.
heh.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Advertising: The science of arresting
Commercial Dynamics Pty. Ltd. | the human intelligence long enough to
NSW, Australia | get money from it.
------------------------------
Date: Wed, 28 Jan 1998 00:13:17 GMT
From: cwinters@clark.net (Chris Winters)
Subject: Re: win32:ftp
Message-Id: <34ce7759.1123713@news.clark.net>
There's also a nifty Win32::Internet module...
http://www.divinf.it/dada/perl/index.sht
Chris
charlot@CAM.ORG (Richard Bellavance) wrote:
>In article <34c7ae51.5769475@nntp.netcomplete>,
>Michael Hartley <michael@hartleym.force9.co.uk> wrote:
>>Hi,
>>
>>does anyone know if there are any win32:ftp modules freely available?
>>I just need the ability to ftp to a unix server and get a single file,
>>then shutdown.
>>
>>Help very much appreciated.
>>
>
>Well, there's no Win32-specific FTP module, but there is Net::FTP. Look
>for it on the CPAN (http://www.perl.com/CPAN).
>
>Richard.
Chris Winters
Webmaster
chris@cwinters.com
------------------------------
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 1746
**************************************