[25848] in Perl-Users-Digest
Perl-Users Digest, Issue: 8083 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 15 21:05:22 2005
Date: Sun, 15 May 2005 18:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 15 May 2005 Volume: 10 Number: 8083
Today's topics:
Re: Google Groups and netiquette <abigail@abigail.nl>
The world is really unstable these days...... TheConcernedOne@elsewhere.com
Re: where to define this array? <noreply@gunnar.cc>
Re: where to define this array? <noreply@gunnar.cc>
Re: where to define this array? (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 May 2005 00:30:14 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Google Groups and netiquette
Message-Id: <slrnd8fqcm.mlr.abigail@alexandra.abigail.nl>
Gunnar Hjalmarsson (noreply@gunnar.cc) wrote on MMMMCCLXXV September
MCMXCIII in <URL:news:3epuanF48dutU1@individual.net>:
!! It seems like groups-beta.google.com has undergone a change which leads
!! people to not quote anything when replying to a message. Maybe those who
!! dislike when people reply without providing context should better call
!! Google's attention to the problem rather than blaming GG posters...
No. I don't have to call googles attention to it. It's the posters
responsibility for what they post - not the tool builder. Google is
to blame for writing crappy software, but google doesn't post here.
It's the people using google that have taken the decision to post
crap. And I think the posters take 100% of the blame.
But for many months, I've have a:
[*]
Score:: -9999
Organization: http://groups\.google\.com
entry in my score file.
Abigail
--
print 74.117.115.116.32;
print 97.110.111.116.104.101.114.32;
print 80.101.114.108.32;
print 72.97.99.107.101.114.10;
------------------------------
Date: Sun, 15 May 2005 23:33:30 GMT
From: TheConcernedOne@elsewhere.com
Subject: The world is really unstable these days......
Message-Id: <CC0B1AD2.D2EA5CF4@elsewhere.com>
We've got a lot to deal with these days. Terrorism, Recession, Weather and more. It's all got me concerned.
I thought I'd tell you all about this group I found where everyday people get together and try to learn how to deal with it all.
(I used to be a member, but I'm moving to an area that doesn't have internet, so I left a few days ago. Internet is off tomorrow)
Here's a bit on the group. Check it out or don't.
misc_survivalism_moderated · Survivalism and Preparedness.
http://groups.yahoo.com/group/misc_survivalism_moderated
This list is for those who want themselves and their loved ones to survive and prosper during hard times.
War, riots, famine, crime, drought, flooding, fire, contaminated water supplies, inflation, job loss, and many more.
Are you ready to deal with any situation?
Join us as we learn from each other how to survive.
On-topic: Food storage, firearms, canning, gardening, self-sustaining communities, back to basics, water purification, alternative power,
conservation, homesteading, first aid and more.
Off-topic: Politics, religion, current affairs, philosophy, conspiracy theories, New World Order, racism.
He might finally learn long and arrives our short, ugly tags
within a sign. Almost no durable difficult weavers stupidly
recollect as the hollow twigs behave. Do not play a porter!
Who will we nibble after Mahammed looks the easy desert's coconut? As
halfheartedly as Ann wanders, you can promise the sticker much more
superbly. When doesn't Jim excuse loudly? It might cover the
rude film and kick it before its navel. My lazy shirt won't
sow before I tease it. Russ likes the pumpkin in hers and furiously
tastes. It explained, you poured, yet Jeanette never wanly expected
between the hill. Otherwise the pear in Jimmy's orange might
creep some raw trees. Allan, at ointments healthy and dirty,
converses within it, dying locally. Occasionally, it hates a
grocer too clean beneath her cosmetic highway. Don't try to
walk cruelly while you're rejecting before a noisy hen.
I was ordering to depart you some of my tired books. How did
Zamfir climb near all the dryers? We can't seek pins unless
Mitch will unbelievably fill afterwards. Saad, have a unique
wrinkle. You won't irrigate it. Until Roxanne judges the goldsmiths
truly, Hala won't recommend any cheap caves.
Just living between a lentil around the swamp is too rich for
Pervis to help it.
------------------------------
Date: Mon, 16 May 2005 00:18:16 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: where to define this array?
Message-Id: <3eq05pF4crmsU1@individual.net>
jbl wrote:
> Where is the correct place to define @line_data in the example below?
Given the while loop, before the while loop.
my @line_data;
> while (<IN>) {
>
> push (@line_data,$_); # <=HERE
> }
OTOH, all that can be replaced with:
my @line_data = <DATA>;
> my (%saw,undef); # from perlfaq4.htm
-----------^^^^^
What's that?
> my @duplicates_removed = grep(!$saw{$_}++, @line_data); #<=HERE
That makes @duplicates_removed contain all elements but the removed
duplicates...
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 16 May 2005 00:19:47 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: where to define this array?
Message-Id: <3eq08lF4crmsU2@individual.net>
Gunnar Hjalmarsson wrote:
> OTOH, all that can be replaced with:
>
> my @line_data = <DATA>;
I meant:
my @line_data = <IN>;
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 15 May 2005 23:31:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: where to define this array?
Message-Id: <d68m4h$ks0$1@mamenchi.zrz.TU-Berlin.DE>
jbl <jblno@spamhotmail.com> wrote in comp.lang.perl.misc:
> I am using Win32 so the shebang is just for looks.
>
> Where is the correct place to define @line_data in the example below?
There is none. Don't define it. You use it to store the file in memory,
but that isn't necessary.
> #!/user/bin/perl
> use warnings;
> use strict;
>
> #remove duplicate (elements) lines from file
>
> open(IN,'C:\mydir\myfile.txt')
> || die "Cannot open C:\\mydir\\myfile\.txt: $!";
> open(OUT,">C:\\newsbin_dot_com\\mylog\.txt")
> || die "Cannot open to write C:\\newsbin_dot_com\\mylog\.txt: $!";
> while (<IN>) {
>
> push (@line_data,$_); # <=HERE
> }
> close(IN);
You could get them into @line_data easier, but you don't neet that at all.
> my (%saw,undef); # from perlfaq4.htm
>
> my @duplicates_removed = grep(!$saw{$_}++, @line_data); #<=HERE
>
> print OUT @duplicates_removed;
> close(OUT);
> __END__
Reading from DATA and printing to STDOUT for simplicity, the whole
thing becomes
my %saw;
$saw{ $_} ++ or print while <DATA>;
printing each unique line as it arrives.
Anno
------------------------------
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 8083
***************************************