[29474] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 718 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 4 00:10:15 2007

Date: Fri, 3 Aug 2007 21:09: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           Fri, 3 Aug 2007     Volume: 11 Number: 718

Today's topics:
    Re: $hash($key) = undef vs = 1 xhoster@gmail.com
    Re: $hash($key) = undef vs = 1 <g_m@remove-comcast.net>
    Re: $hash($key) = undef vs = 1 <g_m@remove-comcast.net>
        =?utf-8?B?4pa64pa64pa6R2V0IEZSRUUgU2F0ZWxsaXRlIFRWIG9uI <anadajames@gmail.com>
    Re: @arts <kkeller-usenet@wombat.san-francisco.ca.us>
        bootstrap-Fehler (Helmut Blass)
    Re: bootstrap-Fehler <sisyphus1@nomail.afraid.org>
    Re: bootstrap-Fehler <1usa@llenroc.ude.invalid>
    Re: How do you continue in a for loop? <RedGrittyBrick@SpamWeary.foo>
    Re: I am giving up perl because of assholes on clpm --  sln@netherlands.co
    Re: Prototypes/Parameters to a Function/Sub-Routine <olson_ord@yahoo.it>
    Re: Q on localizing *STDOUT and fork <nobull67@gmail.com>
    Re: Q on localizing *STDOUT and fork <socyl@987jk.com.invalid>
    Re: Windows based perl editor? <errormsg@gmx.net>
    Re: Windows based perl editor? <g_m@remove-comcast.net>
    Re: Windows based perl editor? <sumonsmailbox@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 03 Aug 2007 19:18:42 GMT
From: xhoster@gmail.com
Subject: Re: $hash($key) = undef vs = 1
Message-Id: <20070803151844.613$uc@newsreader.com>

"~greg" <g_m@remove-comcast.net> wrote:
> When using the keys of a hash to represent a mathematical set,
> I have been in the habit of assigning them
> the arbitrary true-testing value 1.
>
> My question is, would it save any space (and if so, about how much)
> to assign them the somewhat less arbitrary value "undef" instead?

Yes.

perl -le '$h{$_}=1 foreach (1..1e7); sleep'
Using top, I see this takes 1621 MB once it is done (reliably, ran thrice)

perl -le '$h{$_}=() foreach (1..1e7); sleep'
This takes 1544 MB. (reliably)
So it is saving about 8 bytes per hash entry, on my perl.

Beware of this stringy hogzilla:

perl -le '$h{$_}="1" foreach (1..1e7); sleep'
This takes 2080 MB, or 56 extra bytes per hash entry.

This is perl, v5.8.7 built for x86_64-linux
(and usemymalloc=n)

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Fri, 3 Aug 2007 16:36:48 -0400
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: $hash($key) = undef vs = 1
Message-Id: <nu2dnU1p-utUDS7bnZ2dnUVZ_vmlnZ2d@comcast.com>


"Gunnar Hjalmarsson" > wrote
>
> Please ignore my remark.
>


ok

(but I can't speak for anyone else  ;)





------------------------------

Date: Fri, 3 Aug 2007 16:58:02 -0400
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: $hash($key) = undef vs = 1
Message-Id: <tPGdnXUie5FeCC7bnZ2dnUVZ_uiknZ2d@comcast.com>


> perl -le '$h{$_}="1" foreach (1..1e7); sleep'
> This takes 2080 MB, or 56 extra bytes per hash entry.
>
> This is perl, v5.8.7 built for x86_64-linux
> (and usemymalloc=n)
>
> Xho


you've got a good memory! :)







------------------------------

Date: Fri, 03 Aug 2007 11:45:15 -0700
From:  Ana James <anadajames@gmail.com>
Subject: =?utf-8?B?4pa64pa64pa6R2V0IEZSRUUgU2F0ZWxsaXRlIFRWIG9uIHlvdXIgUEMg4peE4peE4peE?=
Message-Id: <1186166715.490634.186530@z24g2000prh.googlegroups.com>

Watch Satellite TV On Your Computer Without Paying Monthly Fees... FOR
FREE?

Watch all your favorite shows on your Computer from anywhere in the
World!

Save 1000's of $$$ over many years on cable and satellite bills.

INSTANT DOWNLOAD

Plus Free Unlimited Downloads Movies, MP3s Music, etc !!!

More Details: http://tvonpc.us.to/



------------------------------

Date: Fri, 3 Aug 2007 11:02:35 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: @arts
Message-Id: <r67co4x4ns.ln2@goaway.wombat.san-francisco.ca.us>

On 2007-08-03, Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On Thu, 2 Aug 2007 17:03:03 -0700, Keith Keller
><kkeller-usenet@wombat.san-francisco.ca.us> wrote:
>
>>and so on.  But it doesn't terminate!  Now Michele's sig is eating up
>>all my CPU.  What am I supposed to do?!?
>
> But seriously, you're joking, aren't you?

Yes, I was joking.  It must not have been a good joke, since here I am
explaining that it was a joke.

--keith

-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



------------------------------

Date: Fri, 03 Aug 2007 20:35:31 GMT
From: helmut_nospam@web.de (Helmut Blass)
Subject: bootstrap-Fehler
Message-Id: <9hMsi.116$Zl6.90@nntpserver.swip.net>

Hallo,
ich habe auf dem Server meines Providers einige Perl-Module laufen. Vor=20
einiger Zeit ist da irgendeine Umstellung gelaufen und wenn ich jetzt eines=
=20
der Module aufrufe, kommt folgende Meldung:
Date::Calc object version 5.3 does not match bootstrap parameter 5.4 at=20
/usr/lib/perl5/5.8.6/i586-linux-thread-multi/DynaLoader.pm line 253.

Vermutlich ein Versions-Problem??
Mein Ansprechpartner beim Provider kann jetzt nichts unternehmen, weil er s=
ich=20
nicht auskennt und auf die R=FCckkehr des Programmierers aus dem Urlaub war=
ten=20
muss .-((
Aber vielleicht weiss hier in dieser NG jemand, was da zu tun ist....

thanx for your help, Helmut


------------------------------

Date: Sat, 4 Aug 2007 10:48:55 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: bootstrap-Fehler
Message-Id: <46b3cce7$0$25982$afc38c87@news.optusnet.com.au>


"Helmut Blass" <helmut_nospam@web.de> wrote in message 
news:9hMsi.116$Zl6.90@nntpserver.swip.net...
 .
 .
Date::Calc object version 5.3 does not match bootstrap parameter 5.4 at
/usr/lib/perl5/5.8.6/i586-linux-thread-multi/DynaLoader.pm line 253.

----------------------------------------

Version 5.4 of Calc.pm has been found, but Calc.so (or Calc.dll, if you're 
on Windows) is for version 5.3.
This usually means that an installation of Date::Calc was not performed 
correctly.
Try re-installing Date::Calc. That should fix the problem. If that doesn't 
fix the problem, show us a copy'n'paste of the Date::Calc build output 
('perl Makefile.PL', 'make test', and 'make install').

I don't speak German - so I've responded to the only part of your post that 
I understood :-)
Sorry if it doesn't address your question appropriately.

I believe there's a German language version of comp.lang.perl.misc 
(comp.lang.perl.misc.de ? ... I'm not sure) if you need to communicate in 
German.

Cheers,
Rob 



------------------------------

Date: Sat, 04 Aug 2007 01:26:26 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: bootstrap-Fehler
Message-Id: <Xns9981DA21BF3A1asu1cornelledu@127.0.0.1>

"Sisyphus" <sisyphus1@nomail.afraid.org> wrote in
news:46b3cce7$0$25982$afc38c87@news.optusnet.com.au: 

> 
> "Helmut Blass" <helmut_nospam@web.de> wrote in message 
> news:9hMsi.116$Zl6.90@nntpserver.swip.net...
> .
> .
> Date::Calc object version 5.3 does not match bootstrap parameter 5.4
> at /usr/lib/perl5/5.8.6/i586-linux-thread-multi/DynaLoader.pm line
> 253. 

 ...

> I don't speak German - so I've responded to the only part of your post
> that I understood :-)
> Sorry if it doesn't address your question appropriately.
> 
> I believe there's a German language version of comp.lang.perl.misc 
> (comp.lang.perl.misc.de ? ... I'm not sure) if you need to communicate
> in German.

Minor Correction: It is actually de.comp.lang.perl.misc


Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



------------------------------

Date: Sat, 04 Aug 2007 00:06:16 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: How do you continue in a for loop?
Message-Id: <CcGdnbIwD4R4KS7bnZ2dnUVZ8rKdnZ2d@bt.com>

mirod wrote:
> On Jul 31, 6:27 pm, RedGrittyBrick <RedGrittyBr...@SpamWeary.foo>
> wrote:
> 
>> perl -e "$\=qq(\n); for (1..10) { next if $_==7; print }"
>>
>> TIMTOWTDI
> 
> Well, if you're going that route, the -l option is worth having a look
> at:
> 
> perl -l -e 'for (1..10) { next if $_==7; print }'
> 

I always seem to forget -l, thanks.

perl -l -e 'for (1..10) { print unless $_==7 }'

but I now seem to have wandered off the point somewhat.

perl -le 'for (1..6,8..10) { print }'

perl -le 'print for (1..6,8..10)'





------------------------------

Date: Fri, 03 Aug 2007 19:25:49 -0700
From: sln@netherlands.co
Subject: Re: I am giving up perl because of assholes on clpm -- switching to Python
Message-Id: <5jo7b397msj7glg6kle90mh2kk1lob6292@4ax.com>

On Thu, 26 Jul 2007 14:56:13 GMT, zentara <zentara@highstream.net> wrote:

>On Wed, 25 Jul 2007 14:45:29 -0500, Martha_Jones@tx.net wrote:
>
>>Python is a better language, with php support, anyway, but I am fed up
>>with attitudes of comp.lang.perl.misc. Assholes in this newsgroup ruin
>>Perl experience for everyone. Instead of being helpful, snide remarks,
>>back-biting, scare tactings, and so on proliferate and self
>>reinforce. All honest people have left this sad newsgroup. Buy bye,
>>assholes, I am not going to miss you!!!
>>
>>Martha
>

>sihT si erehw eht gib syob yalp, uoy evah ot eb elba ot eb elba ot
>elffucs dna ekat tnemhsinup fi uoy era gnorw ro yludnu tnarongi.
>uoY osla deen ot hsauqs wohemos ohw skcatta uoy, nehw uoy
>wonk uoy era thgir.
>
>I saw gnihctaw a CBNC yadretsey, dna yeht deweivretni a gnidael
>ralos lenap ynapmoc's OEC. enO yug tsuj detsalb mih rof on nosaer
>rehto naht eh steg a tnemnrevog ydisbus, dna neve eht rotaredom tlef
>dab rof eht yaw eht evitucexe saw detsalb. TUB...... yeht era eht gib
>syob, gniyalp rof laer yenom, dna fi uoy yalp ereht, uoy evah ot tcepxe
>ot evah ruoy ssenhguot detset..... ti snaem laer tiforp dna ssol.
>
>fI uoy tnaw a retteb ecalp ot ksa rennigeb snoitseuq, ro ot eb detaert
>htiw erom tcepser, yrt eht lrep-srennigeb tsilliam ro
>ptth://sknomlrep.gro.  ehT sknom era yllausu yrev etilop.
>
> 
>aratnez

There you go again, always twisting things around.
A little hatred is good for the world, grow some balls, if it hurts
that much, cut your throat, not somebody elses.

Sln




------------------------------

Date: Fri, 03 Aug 2007 17:50:58 -0700
From:  "O. Olson" <olson_ord@yahoo.it>
Subject: Re: Prototypes/Parameters to a Function/Sub-Routine
Message-Id: <1186188658.833791.291110@g4g2000hsf.googlegroups.com>

On Aug 3, 2:03 pm, anno4...@radom.zrz.tu-berlin.de wrote:
> Not necessarily.  A user could present $obj2 coming from a subclass,
> in which case the test may fail, depending how it it done.
>
> In a purely OO design, the diff method would use accessor methods of
> the common class to compare values, not rely on a particular structure
> of the objects.
>
> Anno

Dear Anno,

	Thanks for taking interest - But I'm still not entirely clear what
you mean. ( Let's not consider inheritance for a while, because it may
complicate matters - and I'm not using it right now).

Consider for example the following class

-----------------------------------------------------
package MyTime;

sub new {
		my $inv = shift;
		my $class = ref( $inv ) || $inv;
		die "Too many arguments\n" unless @_ <=3;
		my $self;

		if ( @_ == 0 ) {

		my @time = localtime( );
		$self = { HOUR   => $time[ 2 ],
			  MINUTE => $time[ 1 ],
			  SECOND => $time[ 0 ] };
		} else {
		$self = { HOUR   => $_[ 0 ],
			  MINUTE => $_[ 1 ] || 0,
			  SECOND => $_[ 2 ] || 0 };
		}

    return bless $self, $class;
}

sub timeDiff {

		my $start_time = shift;  # Start Time - First argument
		my $stop_time = shift;   # Stop Time - Second argument


		print "Calculating the Time Difference between: " . $start_time-
>as_text . " to " . $stop_time->as_text;  #print "\n";

		my $start_seconds = $start_time->{HOUR}*3600 + $start_time-
>{MINUTE}*60 + $start_time->{SECOND};
		my $stop_seconds  = $stop_time->{HOUR}*3600  + $stop_time-
>{MINUTE}*60  + $stop_time->{SECOND};

		my $diff_seconds = $stop_seconds - $start_seconds;

		print " = $diff_seconds \n";

		return $diff_seconds;

}

-----------------------------------------------------

Assuming timeDiff() is called as:

$time_start-> timeDiff($time_stop)

 -----------------------------------------------------


My question is how can I ensure that the second argument passed to
timeDiff() is of The same class MyTime.

Thanks a lot,
O.O.



------------------------------

Date: Fri, 03 Aug 2007 19:02:29 -0000
From:  Brian McCauley <nobull67@gmail.com>
Subject: Re: Q on localizing *STDOUT and fork
Message-Id: <1186167749.116827.250990@q75g2000hsh.googlegroups.com>

On Aug 3, 4:55 pm, kj <so...@987jk.com.invalid> wrote:
> In <1186036012.070979.170...@19g2000hsx.googlegroups.com> Brian McCauley

> >I'm fairly sure I've seen modules on CPAN to wrap it up a bit...
>
> If anyone happens to know the CPAN module that Brian is referring
> to here please let me know.  I looked for it without any luck.  I
> searched for terms like "redirect" and "redirection".  (FWIW, I
> did my search with Google restricted to site:search.cpan.org.)

I think I was miss-remembering either Hook::Output::File or
SelectSaver - neither of which does what you want. Hook::Output::File
could be rewritten to do the right thing.



------------------------------

Date: Fri, 3 Aug 2007 20:44:00 +0000 (UTC)
From: kj <socyl@987jk.com.invalid>
Subject: Re: Q on localizing *STDOUT and fork
Message-Id: <f9042g$mi7$1@reader2.panix.com>

In <1186167749.116827.250990@q75g2000hsh.googlegroups.com> Brian McCauley <nobull67@gmail.com> writes:

>On Aug 3, 4:55 pm, kj <so...@987jk.com.invalid> wrote:
>> In <1186036012.070979.170...@19g2000hsx.googlegroups.com> Brian McCauley

>> >I'm fairly sure I've seen modules on CPAN to wrap it up a bit...
>>
>> If anyone happens to know the CPAN module that Brian is referring
>> to here please let me know.  I looked for it without any luck.  I
>> searched for terms like "redirect" and "redirection".  (FWIW, I
>> did my search with Google restricted to site:search.cpan.org.)

>I think I was miss-remembering either Hook::Output::File or
>SelectSaver - neither of which does what you want. Hook::Output::File
>could be rewritten to do the right thing.

Thanks!  (That's one utterly mystifying chunk of code...  And so
short too!  I can't even begin to understand it; it sure is humbling.
Time for me to crawl back to my little world...)

kj

-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.


------------------------------

Date: Fri, 3 Aug 2007 21:31:19 +0200
From: Marcus Beranek <errormsg@gmx.net>
Subject: Re: Windows based perl editor?
Message-Id: <f8vvq7$fsq$03$1@news.t-online.com>

Am Thu, 02 Aug 2007 19:28:36 -0700 schrieb Bill H:

> I have been using Edit (in a dos box) on Windows for editing perl [...]
> Can anyone recommend a good windows based perl editor? [...]
> 
> Any / all suggestions are appreciated. Bill H

Have you tried jedit, http://www.jedit.org?
It' a java-based text-editor, which comes with a lot of plugins. Most of
the plugins are for working with Java, but there are also some plugins for
editing perl. I'm using jedit for my daily work.


Best regards,
Marcus


------------------------------

Date: Fri, 3 Aug 2007 19:31:41 -0400
From: "~greg" <g_m@remove-comcast.net>
Subject: Re: Windows based perl editor?
Message-Id: <NcudnXbr9Jt_JC7bnZ2dnUVZ_ommnZ2d@comcast.com>


"Mr. Shawn H. Corey" > wrote ...
>
> I did not post three times; the internet did it for me.
> ... Normally, there is a unique ID attached to each message but sometimes this gets lost.



The headers don't support the excuse.

Each of the 3 posts has a different Message-ID
(two of them having been assigned by "...@magma.ca",
which corresponds to the From address,
and the 3rd was assigned by "...@PRIMUS.CA",
for some reason that I don't understand.)

And they each have different X-Trace lines (whatever that is)
and different Xref lines,
(which happen to be in sequential order:
 ...635013, ...635014, ...635015)

~~

But I'm not being anal. :)


I have been trying to work out the best way
to thread usenet posts for an archives.

And "robustness" is a major objective.

Lots of little problems have to be solved.
For example, I assign a permanent index to
every ID seen, whether in a Message-ID line
or in a References line. And this index ~ message-id
correspondence is the single most important aspect
of the database. So it's vitally important that
every post have a good Message-ID.
Which presents the problem of what to do
when an otherwise perfectly good post
just happens to be missing a message-id.

Which I have never actually seen an instance of.

But don't laugh! I have actually seen something
like it, once in my life.
I have see one post that contained one ID
in its References line that had one of its
bits in one of its bytes obviously mangled
during transmission! (Which was easy to see,
-- after it was guessed that that was the problem,
--by comparison with all the other posts
in the same thread.)

So I don't think that it is literally impossible that perfectly good post
(vs a malevolent one) is missing a message-id.
In any case that's the reason I was curious
about the current stutter-post situation.

(What my threader does if it ever comes across
a true case of this kind of thing,
is invent a message-id for the post,
made up of the SHA-1 of the
Subject line + Date line + body lines.
The idea is that this should be sufficient to
to distinguish two different ID-less posts,
while identifying two copies of the same
ID-less post that happen to come by different
routes, and therefore have many different headers.

(I don't use the From line in the SHA
because Google mundges From lines.
It is still possible to get the "original usenet format"
from Google, but they don't make it easy to do,
and it probably isn't possible to harvest them
from Google by bot anymore).


In this case the 3 Subjects are identical.
And the SHA of the bodies are identical.
But the dates are different.

The 2nd one was sent about a minute after the 1st.
And the 3rd, about 10 seconds after the 2nd.

Which I can't say actually refutes the excuse given
(because I don't actually understand the excuse given.)

But I think that can safely be said
that it doesn't confirm it. :)



~greg




------------------------------

Date: Sat, 04 Aug 2007 03:29:02 -0000
From:  skywriter14 <sumonsmailbox@gmail.com>
Subject: Re: Windows based perl editor?
Message-Id: <1186198142.695899.72080@r34g2000hsd.googlegroups.com>

So a lot of Perl programmer use Windows for developement!? And many
people still thinks Perl doesn't even run on Windows. In my country at
least.



------------------------------

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 V11 Issue 718
**************************************


home help back first fref pref prev next nref lref last post