[18121] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 281 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 13 14:06:05 2001

Date: Tue, 13 Feb 2001 11:05:20 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <982091119-v10-i281@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 13 Feb 2001     Volume: 10 Number: 281

Today's topics:
    Re:  Hashes of Arrays rfoskett@my-deja.com
        "Any" with Arrays <paul_wasilkoff@ucg.org>
    Re: "Any" with Arrays <tony_curtis32@yahoo.com>
    Re: (OFF TOPIC) Re: This is driving me nuts and I need  <jbroz@transarc.ibm.com>
    Re: (OFF TOPIC) Re: This is driving me nuts and I need  <bart.lateur@skynet.be>
    Re: Another XML::Parser Question <thunderbear@bigfoot.com>
    Re: Another XML::Parser Question (Logan Shaw)
    Re: catching HUP signal (Anno Siegel)
        Changes to the second field of /etc/passwd   ( Please H (Ken Laird)
    Re: FAQ 4.24:   How do I reformat a paragraph? (Peter J. Acklam)
        Fastest way to parse a XML-document? <thunderbear@bigfoot.com>
    Re: Fastest way to parse a XML-document? <matt@sergeant.org>
    Re: Finding multiply of prime factors (Craig Berry)
        Hashes of Arrays <lxq79@REMOVE.CAPITALS.hotmail.com>
    Re: Hashes of Arrays <jdf@pobox.com>
    Re: Hashes of Arrays <tshoenfe@cisco.com>
    Re: Hashes of Arrays <lxq79@REMOVE.CAPITALS.hotmail.com>
    Re: Hashes of Arrays <tshoenfe@cisco.com>
    Re: Help Running  Perl Scripts from a web-page (Falc2199)
    Re: How bad is that Jeopardy post? (Tramm Hudson)
    Re: How bad is that Jeopardy post? <godzilla@stomp.stomp.tokyo>
    Re: How bad is that Jeopardy post? (Logan Shaw)
    Re: How can I modify the value of a variable directly f <godzilla@stomp.stomp.tokyo>
    Re: How can I modify the value of a variable directly f (Anno Siegel)
    Re: How can I modify the value of a variable directly f <godzilla@stomp.stomp.tokyo>
        localtime -> reverse -> localtime <postmaster@roosit.nl>
    Re: localtime -> reverse -> localtime (Abigail)
    Re: localtime -> reverse -> localtime (Anno Siegel)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 13 Feb 2001 17:23:01 GMT
From: rfoskett@my-deja.com
Subject: Re:  Hashes of Arrays
Message-Id: <96bqhl01dvo@news2.newsguy.com>

> $user{$id}{job => [2, 300, 5]}

You cannot use references as hash keys as they are automatically stringifed (though can use Tie::RefHash)

You want something more like:

  $user{$id}{$job} = [2,300,5];

> while (@row = $sth->fetchrow_array()){
>     $user{$row[0]}{@job} = $row[1];
> }

it's using the last job id as you are specifying '@job' as a hashkey - which will convert to the last element in the @job array.  $job must be a specific element, ie: $job[3]

while (@row = $sth->fetchrow_array()){
    $user{$id}{$job} = \@row;
}

> and to print it:

foreach $id (sort {$a <=> $b} keys %user){
    foreach $job (sort keys %{$user{$id}}){
        @row = @{$user{$id}{$job}};
	print("ID:$id JOB:$job = ".(join',',@row)." \n");
    }
}

havent tested the above but hope it gives you a clue.

rog

==================================
Posted via http://nodevice.com
Linux Programmer's Site


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

Date: Tue, 13 Feb 2001 13:41:59 -0500
From: "PaAnWa" <paul_wasilkoff@ucg.org>
Subject: "Any" with Arrays
Message-Id: <t8j0fqk1cqp39f@corp.supernews.com>

I am working on a form-processing script.  In particular I am looking at a
way of more efficiently evaluating the country field value.  For example, if
the country field equals Fiji or New Zealand or Tonga an email is sent to
address1.  If the country field equals Canada an email is sent to address 2.
If the country field is equal to Austria or Belgium or Denmark or
Switzerland or France an email is sent to address3.  But if the country
field is equal to USA or all other countries then a datafile is appended.

How do I simplify the arguments to a)detect if an email should be sent and
then b)to what address should the mail be sent.  Is there a way to do the
following:

if ($in{'Country'} eq ANY @Country) {action 1;}

PAW




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

Date: 13 Feb 2001 13:03:03 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: "Any" with Arrays
Message-Id: <87ofw6flso.fsf@limey.hpcc.uh.edu>

>> On Tue, 13 Feb 2001 13:41:59 -0500,
>> "PaAnWa" <paul_wasilkoff@ucg.org> said:

> I am working on a form-processing script.  In particular
> I am looking at a way of more efficiently evaluating the
> country field value.  For example, if the country field
> equals Fiji or New Zealand or Tonga an email is sent to
> address1.  If the country field equals Canada an email
> is sent to address 2.  If the country field is equal to
> Austria or Belgium or Denmark or Switzerland or France
> an email is sent to address3.  But if the country field
> is equal to USA or all other countries then a datafile
> is appended.

> How do I simplify the arguments to a)detect if an email
> should be sent and then b)to what address should the
> mail be sent.  Is there a way to do the following:

> if ($in{'Country'} eq ANY @Country) {action 1;}

How about a hash to translate the country name to the
address?

    my %country_addrs = ( Belgium => 'foo@bar',
                          Australia => 'zob@bob',
                          ...
                        );

And then lookup the name received over the web:

    my $cy = param('Country');
    my $addr = $country_addrs{$cy};

    if (defined $addr) {
        ; # got a good one
    } else {
        ; # unknown country, do catch-all
    }

It looks like you are using an old perl4ish library for
doing CGI, so I recommend switching to CGI.pm (which I
used in my example code).

    perldoc CGI

hth
t
-- 
The avalanche has already started.
It is too late for the pebbles to vote.


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

Date: Tue, 13 Feb 2001 16:10:53 +0000
From: jb <jbroz@transarc.ibm.com>
Subject: Re: (OFF TOPIC) Re: This is driving me nuts and I need a guru
Message-Id: <3A895C8D.A4B029E2@transarc.ibm.com>

"Godzilla!" wrote:
> 
[ ... ]
> Our Perl group here, is a slice of this larger problem. Our Perl
> group well exemplifies how people, each looking to satiate her
> or his unhealthy ego, will abuse others without hesitation. Some

That's an opinion. The only thing I object to is seeing the same (usually
off topic) question being posted again and again and reading questions here
that are more appropriate to c.l.p.modules. It's obvious that many posters
haven't read the documentation (save the doc rants) and, in most cases,
haven't even bothered to solve the problem themselves ('Here's my question,
tell me the answer!'). If I were a regular poster I would have probanbly
stopped bothering long ago.

Posting in jeopardy sytle makes it even more annoying, so much so that the
group is, sadly, painful to read much of the time. I'm surprised that many
of the regulars still post (but a good killfile does help :)

joe


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

Date: Tue, 13 Feb 2001 16:26:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: (OFF TOPIC) Re: This is driving me nuts and I need a guru
Message-Id: <72oi8t4l0vcvjgici8jfgcnm2nngr3s8bq@4ax.com>

Godzilla! wrote:

>I know my place; the kitchen. I shall head there
>now, barefoot and pregnant.
                   ^^^^^^^^

I'm pretty sure that Uri isn't responsible for *that*.

-- 
	Bart.


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

Date: Tue, 13 Feb 2001 16:11:33 +0100
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: Another XML::Parser Question
Message-Id: <3A894EA5.134F3488@bigfoot.com>

Uri Guttman wrote:

>   G> Write your own code rather than use a module.
> 
> hey moronzilla, let's see you back that up. write your own and publish
> it. oh, i forgot you don't write code to share. that would be module. or
> a library. or something that has been done in coding for 45 years. but
> you wouldn't know about any of that. in fact the perl you profess to use
> and love uses MODULES and LIBRARIES you can't stop it. so write an xml
> parser already. write any parser. hey, you claim to know english, write
> a universal language translator all by yourself. become rich and famous
> instead of a bitch and infamous. your choice.

Hey Uri.

You are being fed by the troll :-)

In this case, however, it might be reasoable to write a character
encoder snippet in addition to using the module.

-- 
  Thorbjørn Ravn Andersen              "...sound of...Tubular Bells!"
  http://bigfoot.com/~thunderbear


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

Date: 13 Feb 2001 12:53:53 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Another XML::Parser Question
Message-Id: <96bvs1$3uk$1@doughboy.cs.utexas.edu>

In article <3A81F6B3.BB73FE@stomp.stomp.tokyo>,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>kumar22@my-deja.com wrote:
>> Hey, does anyone know how to get the XML::Parser module NOT to
>> translate special character codes?
>
>Write your own code rather than use a module.

Be sure to write it in your own language that runs on your own
operating system too.  Also, build your own processor.  And be sure to
make it out of silicon you made yourself, rather than silicon you just
found lying around on the Earth somewhere.  That's cheating, and you
don't get a proper understanding of what holds silicon together, which
is absolutely *essential* to truly understanding your code.  Anything
else is cargo cult programming.

  - Logan
-- 
my  your   his  her   our   their   *its*
I'm you're he's she's we're they're *it's*


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

Date: 13 Feb 2001 14:05:39 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: catching HUP signal
Message-Id: <96bevj$h1f$2@mamenchi.zrz.TU-Berlin.DE>

nancy  <antsyp@my-deja.com> wrote in comp.lang.perl.misc:
>I've got a server preforking a number of child procs, communicating via
>pipes.  The parent process keeps a scoreboard of the various states of
>the children - idle, busy, or exit (about to die).  I want to be able
>to HUP the kiddies to tell them to die gracefully (send an exit status
>to the parent and die).  I've got code catching the HUP, and it appears
>to be executing the handler (I've added prints to see if it actually
>hits the handler, it does), but the child proc still terminates
>ungracefully, and I'm not sure why.  Not sure if this is because of the
>method being used to spawn the child procs...Any ideas?

This sounds unlikely, but since you are not showing the code that
forks the kids, who knows.

>Here are the code snippets:
>sub _handle_hup {
>        $hup = 1; # $hup is a global var, initially set to 0
>}
>
>sub _do_preforked_child {
>    my $self = shift;
>    my $starttime = time;
>    $SIG{HUP} = \&_handle_hup;
>...

Actually, your code excerpt doesn't show any of the relevant parts.
Where does the child's code look at the value of $hup?  Where is
the code to "exit gracefully"?  In particular, what method are you
using to send an exit code to the parent?

There's not a lot one can say without that information.

Anno


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

Date: 13 Feb 2001 17:41:08 GMT
From: kenlaird@yahoo.com (Ken Laird)
Subject: Changes to the second field of /etc/passwd   ( Please HELP )
Message-Id: <96brjk$2sro$1@news4.isdnet.net>

I would like to change the second field of /etc/passwd (from "x" to "y") .

this command line works fine : 

perl -e '@a=`cat /etc/passwd`;chomp @a;for (@a) {($field)=(split /:/)[1];
$field=~s/x/y/g;print "$field\n"}'

but prints only the second field with the changes.

I would like to create a second file with the changes included .
Moreover I wouldn't like to change any "x" outside the second field .

Will be glad to hear of any solution .

Cordially

Ken Laird

kenlaird@yahoo.com



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

Date: 13 Feb 2001 17:22:26 +0100
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: FAQ 4.24:   How do I reformat a paragraph?
Message-Id: <wklmrar7ag.fsf@math.uio.no>

PerlFAQ Server <faq@denver.pm.org> writes:

> +
>   How do I reformat a paragraph?
> 
>     Use Text::Wrap (part of the standard Perl distribution):
> 
>         use Text::Wrap;
>         print wrap("\t", '  ', @paragraphs);
> 
>     The paragraphs you give to Text::Wrap should not contain embedded
>     newlines. Text::Wrap doesn't justify the lines (flush-right).
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Isn't there a difference between justified text and flush-right
text?  I thought justified text was adjusted (i.e., stretched) so
the text was aligned on both sides, whereas flush-right text is
only aligned along the right side (with no stretching).

At least, this is how it is implemented in HTML/CSS.

Peter

-- 
sub int2roman{@x=split//,sprintf'%04d',shift;@r=('','I','V','X','L','C','D'
,'M');@p=([],[1],[1,1],[1,1,1],[1,2],[2],[2,1],[2,1,1],[2,1,1,1],[1,3],[3])
;join'',@r[map($_+6,@{$p[$x[0]]}),map($_+4,@{$p[$x[1]]}),map($_+2,@{$p[$x[2
]]}),map($_+0,@{$p[$x[3]]})];}print "@{[map{int2roman($_)}@ARGV]}\n";#JAPH!


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

Date: Tue, 13 Feb 2001 15:34:23 +0100
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Fastest way to parse a XML-document?
Message-Id: <3A8945EF.5C8F6A27@bigfoot.com>


I have a need for reading very large XML-documents (100Mb or more) as a
stream.  Many tags, small text-nodes, ROWSET-ROW layout.

I did some testing last year which showed that the XML::Parser available
at that time was very slow compared with Java-parsers, and found that
throwing regexps after a pretty-printed document was faster than parsing
the XML.

Times have changed - so I would like to know if matters have improved. 
Is it feasible today to use Perl instead Java for streamed XML?


-- 
  Thorbjørn Ravn Andersen              "...sound of...Tubular Bells!"
  http://bigfoot.com/~thunderbear


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

Date: Tue, 13 Feb 2001 15:17:15 +0000
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: Fastest way to parse a XML-document?
Message-Id: <3A894FFB.82450069@sergeant.org>

Thorbjørn Ravn Andersen wrote:
> 
> I have a need for reading very large XML-documents (100Mb or more) as a
> stream.  Many tags, small text-nodes, ROWSET-ROW layout.
> 
> I did some testing last year which showed that the XML::Parser available
> at that time was very slow compared with Java-parsers, and found that
> throwing regexps after a pretty-printed document was faster than parsing
> the XML.
> 
> Times have changed - so I would like to know if matters have improved.
> Is it feasible today to use Perl instead Java for streamed XML?

Sadly not for documents of that size, no. The problem is that Perl XML
parsers use expat in XS code to do their work. In order to pass events back
to Perl you need to change the C variables into Perl ones (called SVs at the
XS level) for every event. This is slow compared to either remaining all in
Java or all in C. Needless to say, doing it all in C is the fastest
solution, with Java being about 3 times or more slower.

One thing you could consider, if you're not too bad at C, but don't want to
be worrying about things like memory allocation, is to have a go at using
Ken MacLeod's Orchard framework. This provides an OO alternative to C called
MoC (mostly C) that does things like garbage collection for you
automatically. Its built with XML capabilities specifically in mind, and
should be almost as fast as a raw expat based C parser (i.e. faster than
Java). There are interfaces from MoC to Perl in case you need to do that
(modulo the slowdown of doing so).

HTH.

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


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

Date: Tue, 13 Feb 2001 18:55:55 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Finding multiply of prime factors
Message-Id: <t8j0prf9a04921@corp.supernews.com>

Verbitum Fong (verbitumfong@hotmail.com) wrote:
: For example:
: 48 = 2 x 2 x 2 x 2 x 3
: 121 = 11 x 11
: 12345 = 3 x 5 x 823

This is quite wasteful, as it checks composites when it doesn't need to.
But for small input numbers, it's pretty good.

#!/usr/bin/perl -w
# pfac -- prime-factorize numbers from <>
# Craig Berry (2001/02/13)

use strict;

while (<>) {
  my @facs;
  my $fac = 2;

  while ($_ > 1) {
    if ($_ % $fac) {
      $fac++;
    }
    else {
      push @facs, $fac;
      $_ /= $fac;
    }
  }

  print join(' x ', @facs), "\n";
}

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "When the going gets weird, the weird turn pro."
   |               - Hunter S. Thompson


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

Date: Wed, 14 Feb 2001 01:07:50 +0900
From: LXQ <lxq79@REMOVE.CAPITALS.hotmail.com>
Subject: Hashes of Arrays
Message-Id: <20010214010750.3f5757f7.lxq79@REMOVE.CAPITALS.hotmail.com>

Hi,
I tried to make a hash of arrays and hashes like this:

$user{$id}{job => [2, 300, 5]}

Then the data is from the database. The first call to the database will
get all user id and job number. The @row is set of: $id and job. It is
possible for the user with same id to have some job numbers, so I want to
push them all in the array job. How can I do this? I tried:

while (@row = $sth->fetchrow_array()){
    $user{$row[0]}{@job} = $row[1];
}

and to print it:
foreach $id (sort {$a <=> $b} keys %user){
    foreach ($user{$id}{@job}){
	print("$id = $_\n");
    }
}

But it seems like the @job only contains the last value returned by the
database. How can I put all the job number returned by the database inside
the @job with appropriate user id? Please help, and thanks so much :)


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

Date: 13 Feb 2001 12:12:57 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Hashes of Arrays
Message-Id: <u25ybj6u.fsf@pobox.com>

LXQ <lxq79@REMOVE.CAPITALS.hotmail.com> writes:

You MUST turn on the -w switch in the first line of your program:

  #! /path/to/perl -w

It would have warned you about the many errors in your program.

You should also take an hour or two to read perlreftut and perlref,
along with perllol and perldsc.

>     $user{$row[0]}{@job} = $row[1];
                     ^^^^
      this is the number of elements in the @job array

I'm not sure why you're putting hash references into %user, since it
seems like there's simply a list of job numbers associated with each
user.  If I'm right, then the following code will build the data
structure you want:

   push @{$user{$row[0]}}, $row[1];

This treats the value of $user{$row[0]} as an array reference.

> and to print it:
> foreach $id (sort {$a <=> $b} keys %user){
                        ^^^
           this operator is for numeric comparisons
                you are comparing strings

  foreach $id (sort keys %user) {
     foreach $job ( @{$user{$id}} ) {
        print "$id = $job\n";
     }
  }

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


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

Date: Tue, 13 Feb 2001 09:14:11 -0800
From: Todd Shoenfelt <tshoenfe@cisco.com>
Subject: Re: Hashes of Arrays
Message-Id: <3A896B63.3927AC76@cisco.com>

Hi LXQ,

use strict;
use strict;
use strict;

It will save you a lot of trouble with scoping issues like this.

> while (@row = $sth->fetchrow_array()){
>     $user{$row[0]}{@job} = $row[1];
> }

# Try:
while ( my @row = $sth->fetchrow_array()) {
    ...
}

--
Todd Shoenfelt
Cisco Systems, Inc.
EMAN (Enterprise Management)
Web Developer
Bldg. 12, First Floor, Cube A5-13
408-527-8958




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

Date: Wed, 14 Feb 2001 02:38:40 +0900
From: LXQ <lxq79@REMOVE.CAPITALS.hotmail.com>
Subject: Re: Hashes of Arrays
Message-Id: <20010214023840.2237d12a.lxq79@REMOVE.CAPITALS.hotmail.com>

On 13 Feb 2001 12:12:57 -0500
Jonathan Feinberg <jdf@pobox.com> wrote:

> I'm not sure why you're putting hash references into %user, since it
> seems like there's simply a list of job numbers associated with each
> user.  If I'm right, then the following code will build the data
> structure you want:
> 
>    push @{$user{$row[0]}}, $row[1];
> 
> This treats the value of $user{$row[0]} as an array reference.

use strict;

my $dsn = "DBI:mysql:bulletin";
my $dbUser = "bk";
my $dbPass = "";
my ($dbh, $sth);
my %user;
my @row;
my @shokushu;
my $id;
my (%user, @row);

[... snip ..]
while (@row = $sth->fetchrow_array()){
      push @{$user{$row[0]}{job}}, $row[1];
}


I've changed it to this. But when I print it, all the arrays are NULL. Any
idea? 

And also, the reason I make it like this is because there is another hash
of arrays inside the hash %user. So it looks like:

$user{$id}{job => [1, 2, 3]}{area => [3, 2, 0]}{value => [5, 6]}

That is the complete hash. 


> 
> > and to print it:
> > foreach $id (sort {$a <=> $b} keys %user){
>                         ^^^
>            this operator is for numeric comparisons
>                 you are comparing strings
> 
>   foreach $id (sort keys %user) {
>      foreach $job ( @{$user{$id}} ) {
>         print "$id = $job\n";
>      }
>   }

Sorry I forgot to write. That is because the key $id is numeric. 


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

Date: Tue, 13 Feb 2001 10:16:06 -0800
From: Todd Shoenfelt <tshoenfe@cisco.com>
Subject: Re: Hashes of Arrays
Message-Id: <3A8979E5.5613A593@cisco.com>

> while (@row = $sth->fetchrow_array()){

Every time you loop, @row <i>gets re-assigned</i> the values of the next table
row.  If you don't stick a 'my' in front of it, your problems will persist.

--
Todd Shoenfelt
Cisco Systems, Inc.
EMAN (Enterprise Management)
Web Developer
Bldg. 12, First Floor, Cube A5-13
408-527-8958




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

Date: 13 Feb 2001 15:30:46 GMT
From: falc2199@aol.comNOJUNK (Falc2199)
Subject: Re: Help Running  Perl Scripts from a web-page
Message-Id: <20010213103046.17652.00000637@ng-cm1.aol.com>

>1) Did you upload your perl program as ASCII text?
>2) Did you change permissions ( chmod ) on your perl program to 755 after you
>uploaded it?
>3) Make sure perl is where the shebang line says it is
>4) You're missing the basic minimum HTML tags to create an HTML

I am sure I got 1,3, and 4 covered. The only problem is changing the
permissions.
I am writing my scripts on a Windows platform, so I don't have to worry about
it then.Only when my web-host runs my script on a UNIX server do they come into
play.

 I am not sure how you change permissions with my FTP service, if that is even
where you change it.

Can you point me in the direction of a free FTP app where you know how to
change permissions, so you can tell me how it is done.

Thanks,
Jehan


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

Date: 13 Feb 2001 14:22:26 GMT
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: How bad is that Jeopardy post?
Message-Id: <96bfv2$n9h$1@sloth.swcp.com>

Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Tramm Hudson wrote:
> > Did you ever yearn for a ranking scale that would 
> > allow to you kill posts based on the absurdity of
> > the arguments?
> 
> If I were one of those who uses a killfile,
> you would certainly reside in my killfile.

Although the bogoscore program would consistently give you low
(better) scores since your posts are almost always well formatted
and prepared in the conventional manner.

It is not targetted at users such as you, who know how to
post and write well.  It soley ranks based on superficial
criteria that can be determined from a lexical analysis
of the message.

Now, if it scored based on ad hominem attacks, that would be different.

Tramm
-- 
  o   hudson@swcp.com                  hudson@turbolabs.com   O___|   
 /|\  http://www.swcp.com/~hudson/          H 505.323.38.81   /\  \_  
 <<   KC5RNF @ N5YYF.NM.AMPR.ORG            W 505.986.60.75   \ \/\_\  
  0                                                            U \_  | 


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

Date: Tue, 13 Feb 2001 07:04:46 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: How bad is that Jeopardy post?
Message-Id: <3A894D0E.586E92CE@stomp.stomp.tokyo>

Tramm Hudson wrote:
 
> Godzilla! wrote:
> > Tramm Hudson wrote:

> > > Did you ever yearn for a ranking scale that would
> > > allow to you kill posts based on the absurdity of
> > > the arguments?

> > If I were one of those who uses a killfile,
> > you would certainly reside in my killfile.

> > > my cow-orkers practice these henious crimes, 

> > You are posting to the wrong newsgroup.
> > Try this group:

> > alt.bestility.for.idiots

> Although the bogoscore program would consistently give you low
> (better) scores since your posts are almost always well formatted
> and prepared in the conventional manner.
 
> It is not targetted at users such as you, who know how to
> post and write well.  It soley ranks based on superficial
> criteria that can be determined from a lexical analysis
> of the message.
 
> Now, if it scored based on ad hominem attacks, 
> that would be different.


Ahhh.... po' boy. You and your spam are breaking
my wittle heart. Truly you are, dahhhhling.

Godzilla!


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

Date: 13 Feb 2001 12:50:52 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: How bad is that Jeopardy post?
Message-Id: <96bvmc$3r9$1@doughboy.cs.utexas.edu>
Keywords: jeopardy posting, netiquette, etiquette, isohedron, bogoscore, mail filter

In article <96abgb$p36$1@sloth.swcp.com>, Tramm Hudson <hudson@swcp.com> wrote:
>  But I have found that a good first approximation can be
>achieved with just a textual analysis of the message.  Things like
>Jeopardy ("top posting"), excessive quoting, no sig dash, ratio of
>quoted text to original.

What if there is no sig dash because there is no sig?  I've been
reading Usenet news from this account for about a year (overall for
about 11 years), and only a day or two ago did I create ~/.signature,
just because I didn't feel like bothering until then.

  - Logan
-- 
my  your   his  her   our   their   *its*
I'm you're he's she's we're they're *it's*


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

Date: Tue, 13 Feb 2001 06:54:58 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: How can I modify the value of a variable directly from within a sub?
Message-Id: <3A894AC2.E8ECEE53@stomp.stomp.tokyo>

Anno Siegel wrote:
 
> Godzilla! wrote:
> > Randal wrote:
> >> >>>>> Godzilla! wrote:

(various snippage)

> It's uncontested that it works, if "works" means it assigns the
> commify()d version of $number to $number.  The problem is actually
> that it works too much, doing unnecessary referencing and de-referencing.
 
> The other problem is that it doesn't solve the OP's problem, which
> was how to modify the value of $number in place, without an explicit
> use of assignment.

 
Why are you parroting what Randal has previously stated?
Polly wanna cracker?

Godzilla!


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

Date: 13 Feb 2001 15:21:34 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How can I modify the value of a variable directly from within a sub?
Message-Id: <96bjdu$335$2@mamenchi.zrz.TU-Berlin.DE>

Godzilla! <godzilla@stomp.stomp.tokyo> wrote in comp.lang.perl.misc:
>Anno Siegel wrote:

>> It's uncontested that it works, if "works" means it assigns the

[...]

>Why are you parroting what Randal has previously stated?

Because you gave no sign of having understood.  In fact, I am
somewhat amazed you even noticed that (some of) my posting
repeated what Randal said.

Anno


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

Date: Tue, 13 Feb 2001 08:29:23 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: How can I modify the value of a variable directly from within a sub?
Message-Id: <3A8960E3.3DF9C170@stomp.stomp.tokyo>

Anno Siegel wrote:
 
> Godzilla! wrote:
> > Anno Siegel wrote:

(snippage)

> > Why are you parroting what Randal has previously stated?
> > Polly wanna cracker?

> Because you gave no sign of having understood.  In fact, I am
> somewhat amazed you even noticed that (some of) my posting
> repeated what Randal said.

So do you want a cracker or not?

Godzilla!


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

Date: Tue, 13 Feb 2001 15:29:40 +0100
From: Marc Roos <postmaster@roosit.nl>
Subject: localtime -> reverse -> localtime
Message-Id: <3A8944D4.2FB4AA4F@roosit.nl>

Greetings! 

I am using localtime to change a time in seconds to a time seperated in
sec min hour day month and year.
But I would like to go back from sec min .. year to a time in seconds. I
am now using mktime, but
I get not correct result

source
==================
      4 $sec=0;
      5 $min=0;
      6 $hour=0;
      7 $mday=0;
      8 $mon=0;
      9 $month=0;
     10 $year=0;
     11 $yeari=0;
     12 
     13 $month=10;
     14 $yeari=2000;
     15 
     16
($sec,$min,$hour,$mday,$mon,$year)=localtime(mktime(0,0,0,0,int($month-1),$yeari-1900));
     17 printf "sec= %s min= %s, hour= %s,mday= %s,mon= %s,year= %s\n",
$sec,$min,$hour,$mday,$mon+1,$year+1900;
===============================

output:
====================
sec= 0 min= 0, hour= 1,mday= 30,mon= 9,year= 2000


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

Date: 13 Feb 2001 14:35:42 GMT
From: abigail@foad.org (Abigail)
Subject: Re: localtime -> reverse -> localtime
Message-Id: <slrn98ihhu.6o7.abigail@tsathoggua.rlyeh.net>

Marc Roos (postmaster@roosit.nl) wrote on MMDCCXXIII September MCMXCIII
in <URL:news:3A8944D4.2FB4AA4F@roosit.nl>:
,, Greetings! 
,, 
,, I am using localtime to change a time in seconds to a time seperated in
,, sec min hour day month and year.
,, But I would like to go back from sec min .. year to a time in seconds. I
,, am now using mktime, but
,, I get not correct result
,, 
,, source
,, ==================
,,       4 $sec=0;
,,       5 $min=0;
,,       6 $hour=0;
,,       7 $mday=0;
,,       8 $mon=0;
,,       9 $month=0;
,,      10 $year=0;
,,      11 $yeari=0;
,,      12 
,,      13 $month=10;
,,      14 $yeari=2000;
,,      15 
,,      16
,, ($sec,$min,$hour,$mday,$mon,$year)=localtime(mktime(0,0,0,0,int($month-1),$yeari-1900));
,,      17 printf "sec= %s min= %s, hour= %s,mday= %s,mon= %s,year= %s\n",
,, $sec,$min,$hour,$mday,$mon+1,$year+1900;
,, ===============================
,, 
,, output:
,, ====================
,, sec= 0 min= 0, hour= 1,mday= 30,mon= 9,year= 2000
-- 
$_ = "\x3C\x3C\x45\x4F\x54"; s/<<EOT/<<EOT/e; print;
Just another Perl Hacker
EOT


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

Date: 13 Feb 2001 15:18:02 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: localtime -> reverse -> localtime
Message-Id: <96bj7a$335$1@mamenchi.zrz.TU-Berlin.DE>

Marc Roos  <postmaster@roosit.nl> wrote in comp.lang.perl.misc:
>Greetings! 
>
>I am using localtime to change a time in seconds to a time seperated in
>sec min hour day month and year.
>But I would like to go back from sec min .. year to a time in seconds. I
>am now using mktime, but
>I get not correct result
>
>source
>==================
>      4 $sec=0;
>      5 $min=0;
>      6 $hour=0;
>      7 $mday=0;
>      8 $mon=0;
>      9 $month=0;
>     10 $year=0;
>     11 $yeari=0;
>     12 
>     13 $month=10;
>     14 $yeari=2000;
>     15 
>     16
>
>($sec,$min,$hour,$mday,$mon,$year)=
>    localtime(mktime(0,0,0,0,int($month-1),$yeari-1900));
                            ^Here...
 ...you are specifying day zero of whatever month we're talking
(October).  Note that, unlike the count of months, which starts
at zero, the days in a month are counted conventionally, beginning
at one.  So what's a poor routine to do?  It goes back one day before
day one of October, which is the last day of September, which is
what you get:

>output:
>====================
>sec= 0 min= 0, hour= 1,mday= 30,mon= 9,year= 2000

The specification of unix date components takes some careful reading.
Apparently convenience took precedence over consistency in their
design.

More questions about your code:

Why do you assign values to the variables $sec through $mday, but
don't use them in the call to mktime()?

Why do you apply the int() function to $month-1?

If you think it does any good there, why don't you apply it to
$yeari-1900?

Apparently sloppiness took precedence over consistency *and*
convenience in your posting.

Anno


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 281
**************************************


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