[28368] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9732 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 16 03:05:52 2006

Date: Sat, 16 Sep 2006 00:05:06 -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           Sat, 16 Sep 2006     Volume: 10 Number: 9732

Today's topics:
        boolean madness: false is the new true? <steve-usenet@vertigan.wattle.id.au>
    Re: boolean madness: false is the new true? <glennj@ncf.ca>
    Re: boolean madness: false is the new true? <tadmc@augustmail.com>
    Re: boolean madness: false is the new true? <jurgenex@hotmail.com>
        Building a perl C extension module erroring out on Ubun <strombrg@dcs.nac.uci.edu>
    Re: Check IP range for DNSBL listing <notvalid@cox.net.invalid>
        deleteing records from DB_File doesnt decrease file siz <botfood@yahoo.com>
    Re: in-memory plot <see.sig@rochester.rr.com>
        jifty <bootiack@yahoo.com>
    Re: Learning perl - for experienced programmers <mgarrish@gmail.com>
    Re: Learning perl - for experienced programmers <trwww@sbcglobal.net>
    Re: Learning perl - for experienced programmers <dha@panix.com>
    Re: Learning perl - for experienced programmers <john@castleamber.com>
        link extract <novostik@googlemail.com>
    Re: link extract <john@castleamber.com>
    Re: link extract <john@castleamber.com>
    Re: Maximum number of sockets <sisyphus1@nomail.afraid.org>
        new CPAN modules on Sat Sep 16 2006 (Randal Schwartz)
    Re: Sum the middle column for a given unique volser. <mumia.w.18.spam+nospam.usenet@earthlink.net>
    Re: Sum the middle column for a given unique volser. <Noatec@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 16 Sep 2006 00:45:57 GMT
From: Steve Vertigan <steve-usenet@vertigan.wattle.id.au>
Subject: boolean madness: false is the new true?
Message-Id: <pan.2006.09.16.00.38.15.690014@vertigan.wattle.id.au>

I have the following method in a module I'm writing...

sub uses {
my $self = shift; my $var = shift;
if ($var) {
	if ($self->{'DEFINED'}{$var}) { return true; }
	else { return false; } #this line broken
} else {
	my @def = keys %{$self->{'DEFINED'}};
	return @def;
}
}

and using it in the context if ($obj->uses('badvar')) always tests as
true.  However using return 0 instead of return false seems to
work fine.  Either my perl interpreter is broken or my brain is, any
guesses?


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

Date: 16 Sep 2006 01:23:39 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: boolean madness: false is the new true?
Message-Id: <slrnegmkgr.218.glennj@smeagol.ncf.ca>

At 2006-09-15 08:45PM, "Steve Vertigan" wrote:
>  I have the following method in a module I'm writing...
>  
>  sub uses {
>  my $self = shift; my $var = shift;
>  if ($var) {
>  	if ($self->{'DEFINED'}{$var}) { return true; }
>  	else { return false; } #this line broken
>  } else {
>  	my @def = keys %{$self->{'DEFINED'}};
>  	return @def;
>  }
>  }
>  
>  and using it in the context if ($obj->uses('badvar')) always tests as
>  true.  However using return 0 instead of return false seems to
>  work fine.  Either my perl interpreter is broken or my brain is, any
>  guesses?

Brain, I'm afraid.  You're returning the unquoted string "false".  Of
course, a non-empty string evaluates as a boolean true value.  Using
strict and warnings would have caught it.

$ perl -le 'use strict; use warnings; sub X {return false}; print "true" if X()'
Bareword "false" not allowed while "strict subs" in use at -e line 1.
EXecution of -e aborted due to compilation errors.

$ perl -le 'use warnings; sub X {return false}; print "true" if X()'
Unquoted string "false" may clash with future reserved word at -e line 1.
true

However, you could define it as a constant:

$ perl -le '
    use strict;
    use warnings; 
    use constant false => 0; 
    use constant true => not false; 
    sub X {return false};
    sub Y {return true};
    print("X is: ", X() ? "true" : "false");
    print("Y is: ", Y() ? "true" : "false");
'
X is: false
Y is: true


-- 
Glenn Jackman
Ulterior Designer


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

Date: Fri, 15 Sep 2006 23:18:18 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: boolean madness: false is the new true?
Message-Id: <slrnegmuoa.acf.tadmc@magna.augustmail.com>

Steve Vertigan <steve-usenet@vertigan.wattle.id.au> wrote:


> 	else { return false; } #this line broken


You should always enable warnings when developing Perl code.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 16 Sep 2006 06:45:41 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: boolean madness: false is the new true?
Message-Id: <p4NOg.135$W13.92@trnddc05>

Steve Vertigan wrote:
> I have the following method in a module I'm writing...
>
> sub uses {
> my $self = shift; my $var = shift;
> if ($var) {
> if ($self->{'DEFINED'}{$var}) { return true; }
> else { return false; } #this line broken
> } else {
> my @def = keys %{$self->{'DEFINED'}};
> return @def;
> }
> }
>
> and using it in the context if ($obj->uses('badvar')) always tests as
> true.  However using return 0 instead of return false seems to
> work fine.  Either my perl interpreter is broken or my brain is, any
> guesses?

When trying to run your code isn't the warning message from perl quite 
obvious:

    Bareword "true" not allowed while "strict subs" in use at t.pl line 6.
    Bareword "false" not allowed while "strict subs" in use at t.pl line 8.
    Execution of t.pl aborted due to compilation errors.

jue 




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

Date: Fri, 15 Sep 2006 23:02:50 GMT
From: Dan Stromberg <strombrg@dcs.nac.uci.edu>
Subject: Building a perl C extension module erroring out on Ubuntu 5.10
Message-Id: <pan.2006.09.15.23.03.09.233969@dcs.nac.uci.edu>


Hi again.

I'm trying to get a C extension module I wrote with SWIG to work with
perl.  I got it to work OK with python, but perl's being a little more
troublesome.

When I use the usual (?) incantation, I get compile-time errors:

$ make
#swig -python -o odirectcmodule.c odirectcmodule.swg
swig -perl5 -o odirect_perl.c odirectcmodule.swg
gcc -ansi -Wall -Dbool=char -I/usr/lib/perl/5.8.7/CORE -fpic -c odirect_perl.c
In file included from /usr/lib/perl/5.8.7/CORE/op.h:496,
                 from /usr/lib/perl/5.8.7/CORE/perl.h:2600,
                 from odirect_perl.c:703:
/usr/lib/perl/5.8.7/CORE/reentr.h:611: error: field ‘_crypt_struct’ has incomplete type
/usr/lib/perl/5.8.7/CORE/reentr.h:619: error: field ‘_drand48_struct’ has incomplete type
/usr/lib/perl/5.8.7/CORE/reentr.h:770: error: field ‘_random_struct’ has incomplete type
/usr/lib/perl/5.8.7/CORE/reentr.h:775: error: field ‘_srandom_struct’ has incomplete type
In file included from /usr/lib/perl/5.8.7/CORE/perl.h:2605,

Is there something a little loopy with the way Ubuntu builds C extension
modules for perl?

I could try to find where _crypt_struct and such are defined and #include
the right header into the .c from SWIG, but shouldn't swig and the perl
extension module API's have a sort of in-advance agreement on how this is
to be done?

Is this a known problem?

Thanks!




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

Date: Fri, 15 Sep 2006 18:25:39 -0400
From: John Mason Jr <notvalid@cox.net.invalid>
Subject: Re: Check IP range for DNSBL listing
Message-Id: <12gma358jerev9b@news.supernews.com>

RR wrote:
> I'm looking for a Perl script that will easily check ranges of IP
> addresses that make it into DNSBLs, such as sbl-xbl.spamhaus.org and
> bl.spamcop.net
> 
> I found RBLcheck and ARBLcheck
> 
> http://freshmeat.net/projects/rblcheck.pl/
> http://www.unixwiz.net/tools/arblcheck.html
> 
> But unfortunately those don't allow me to put in ranges of IPs
> 
> Ideally, I'd like for these scripts to email me when there's a
> violation.  Any links to decent Perl mail scripts would be greatly
> appreciated.  Thus far, I've found
> 
> http://willmaster.com/possibilities/archives/wmp20020709001.shtml
> http://willmaster.com/possibilities/archives/wmp20020716001.shtml
> http://perl.about.com/od/email/a/perlemailsub.htm
> 


If you are looking at making large numbers of queries against the 
various RBLs  consider setting up a local copy. Many RBLs have methods 
available to allow you to keep a local copy synchronized


John


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

Date: 15 Sep 2006 16:31:53 -0700
From: "botfood" <botfood@yahoo.com>
Subject: deleteing records from DB_File doesnt decrease file size?
Message-Id: <1158363113.642465.123370@k70g2000cwa.googlegroups.com>

I am working on a DB cleanup tool that purges records from a tie()ed
file created with DB_File. I have a first pass done on the tool, and
seems to be functioning. On a test DB it correctly reports that it
found about 2500 'old' records according to my criteria,and deleted
them...

problem is that the file itself, which was about 10.3MB for 14k
records, did not change size after 2500 records were deleted. I sort of
expected some reduction in file size?!

Is there some kind of 'compact' or cleanup utility that I need to run
on the database to squeeze out the empty holes or something?


snippets shown... not working code
=======
        ....
	use DB_File;
	tie ( %tempHash , 'DB_File' , "${cfgRelPath_cgi2DB}/${dbfile}" ) ;


then later in a loop I delete a specific record with something like
this

         delete($tempHash{$tempKey}) ;

=================



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

Date: Sat, 16 Sep 2006 02:37:12 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: in-memory plot
Message-Id: <srJOg.41911$8j3.30780@twister.nyroc.rr.com>

Maitre Bart wrote:
> I would like to create a XY plot and put it in a html-like email.
> 
> 1) I am looking for a lib (or a set of libs) that allows to create a XY
> plot (or any other kind) where I can save the resulting graphic in a
> .png file. Though I expect this is achievable in more than one step.
> 
> 2) I will then manage to create a html file with the appropriate
> content (that will reference my graphic files).
> 
> 3) Send the html page by email.
> 
> I would appreciate suggestions to accomplish steps #1 and #3, since I
> have enough experience and knowledge to perform step #2.
 ...

Modules are your friends.  Did you check on CPAN to see if there are any 
that might do some of these things?

You might check out GD::Graph to create your plot and .png file.  And 
MIME::Lite or Mail::Sender (or many others) should help create and send 
the email with attachments.  Or without attachments if you want the 
images to be loaded from your server when the email is read.  And the 
HTML could be nicely created with the CGI module (in a bit of an 
unorthodox use, perhaps).

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


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

Date: 15 Sep 2006 16:56:16 -0700
From: "gavino" <bootiack@yahoo.com>
Subject: jifty
Message-Id: <1158364576.828827.170570@h48g2000cwc.googlegroups.com>

windows XP
active perl 5.8.8.817
ppm to install jifty
running though tutorial
http://search.cpan.org/dist/Jifty/lib/Jifty/Manual/Tutorial.pod
stuck here:
C:\xtreme\MyWeblog>jifty model --name Post
The following parameter was passed in the call to
Jifty::View::Mason::Handler->new() but was not listed in the validation
options: plugins



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

Date: 15 Sep 2006 15:29:42 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Learning perl - for experienced programmers
Message-Id: <1158359382.797607.43230@d34g2000cwd.googlegroups.com>


cartercc@gmail.com wrote:

> Dan Stromberg wrote:
> > Hi folks.
> >
> > I know a variety of languages, from assemblers to VHLL's, but I'd like to
> > learn at least the fundamentals of perl 5.
>
> For two good, quick reads, I'd recommend the O'Reilly books, Learning
> Perl and Learning Perl Objects and Modules, both by Schwartz. Each
> chapter can be digested in about half an hour (for an experienced
> programmer) and contains several useful exercies. Additionally, they
> can be picked up used for very good prices.
>

Might be a little too easy for an experienced programmer. It sounds
like he'd be better off jumping straight into the documentation, or
going for the Camel or Cookbook.

> In my job, I use ColdFusion, Perl, and Java. Each language has its good
> uses and bad uses. Perl is very good for one off scripts of less than
> 25 - 50 lines.

I don't follow the logic of that. It sounds like you need a lesson in
OO Perl if you can only write procedural code that can't be maintained
(and I've never heard of a language that is only good until a certain
number of lines has been passed, to be honest).

Basic design practices are basic design practices. If you'd like some
examples of hideous and unmaintainable Java code there's plenty I'm
sifting through at my current job. A language is only as bad as the
person writing it.

Consider also that to most people the benefit of perl is cpan and the
active community, and that the modules you're using to make your
scripts so short are probably many thousands of lines of maintainable
code (or not, as not everything in cpan smells like roses).

Matt



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

Date: Sat, 16 Sep 2006 02:34:48 GMT
From: "Todd W" <trwww@sbcglobal.net>
Subject: Re: Learning perl - for experienced programmers
Message-Id: <cpJOg.1642$6S3.1062@newssvr25.news.prodigy.net>


"Dan Stromberg" <strombrg@dcs.nac.uci.edu> wrote in message 
news:pan.2006.09.15.21.02.26.903850@dcs.nac.uci.edu...
>
> Hi folks.
>
> I know a variety of languages, from assemblers to VHLL's, but I'd like to
> learn at least the fundamentals of perl 5.
>
> I'd like to find a web article, magazine article or brief book that will
> provide a very dense, pithy introduction.
>
> Is such a resource available?

No one has mentioned _Perl in a Nutshell_ so I thought I'd add it to the 
list:

http://www.oreilly.com/catalog/perlnut2/

Very terse but complete.

Todd W.




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

Date: Sat, 16 Sep 2006 03:10:53 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: Learning perl - for experienced programmers
Message-Id: <slrnegmqpt.e1u.dha@panix2.panix.com>

On 2006-09-15, John Bokma <john@castleamber.com> wrote:
> Dan Stromberg <strombrg@dcs.nac.uci.edu> wrote:
>
>
>> book - is there something like that for perl?  It might even come under
>> the name of a reference, perhaps.
>> 
>> Is such a resource available?
>
> Programming Perl, 3rd edition. It's a tough read, but worth it and IMO 
> matches exactly your description (been there, done that, only with the 
> purple version).

That's MAUVE, thank you very much. :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"In my opinion, there's nothing in this world beats a '52 Vincent and
a red headed girl" - James Adie


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

Date: 16 Sep 2006 04:54:36 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Learning perl - for experienced programmers
Message-Id: <Xns983FF3370CBDFcastleamber@130.133.1.4>

"David H. Adler" <dha@panix.com> wrote:

> On 2006-09-15, John Bokma <john@castleamber.com> wrote:
>> Dan Stromberg <strombrg@dcs.nac.uci.edu> wrote:
>>
>>
>>> book - is there something like that for perl?  It might even come
>>> under the name of a reference, perhaps.
>>> 
>>> Is such a resource available?
>>
>> Programming Perl, 3rd edition. It's a tough read, but worth it and
>> IMO matches exactly your description (been there, done that, only
>> with the purple version).
> 
> That's MAUVE, thank you very much. :-)

http://www.answers.com/MAUVE

It certainly doesn't match the colour from the Wikipedia article though
:-) 

CC0099 (too "grey)/FF0099 (too pink) [1] comes closest but that's based
on the memory I have of the book and the settings of my monitor :-D. 

BTW, not saying your wrong, but names of colors, and perception of
colors is a hard thing :-) (I often describe colors as: a kind of
purple, with some grey mixed into, and too much green, now that confuses
people). 

http://www.oreilly.com/catalog/wdnut/excerpt/web_palette.html

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: 15 Sep 2006 19:45:05 -0700
From: "novostik@googlemail.com" <novostik@googlemail.com>
Subject: link extract
Message-Id: <1158374705.314959.304330@h48g2000cwc.googlegroups.com>

hi everybody.....
                       i have a problem in out here. I know how to
extract links from a html page.But is there any way u can extract a
particular set of links from an html page??By this i mean,say there is
a particular page which has news links on one side of the page, links
of company products on the middle, and links of its businesses in the
right side.Can u tell me how to extract these links as three different
sets.



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

Date: 16 Sep 2006 05:03:57 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: link extract
Message-Id: <Xns9840A8C89B1castleamber@130.133.1.4>

"novostik@googlemail.com" <novostik@googlemail.com> wrote:

> hi everybody.....
>                        i have a problem in out here. I know how to
> extract links from a html page.But is there any way u can extract a
> particular set of links from an html page??By this i mean,say there is
> a particular page which has news links on one side of the page, links
> of company products on the middle, and links of its businesses in the
> right side.Can u tell me how to extract these links as three different
> sets.

I probably would use HTML::TreeBuilder for that. If the tree sections are 
each in their own container this is a piece of cake. Also, you can use 
regexp on attribute values, which might help.

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: 16 Sep 2006 05:39:53 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: link extract
Message-Id: <Xns98406C07A60Bcastleamber@130.133.1.4>

John Bokma <john@castleamber.com> wrote:

> "novostik@googlemail.com" <novostik@googlemail.com> wrote:
> 
>> hi everybody.....
>>                        i have a problem in out here. I know how to
>> extract links from a html page.But is there any way u can extract a
>> particular set of links from an html page??By this i mean,say there
>> is a particular page which has news links on one side of the page,
>> links of company products on the middle, and links of its businesses
>> in the right side.Can u tell me how to extract these links as three
>> different sets.
> 
> I probably would use HTML::TreeBuilder for that. If the tree sections

                                                          ^^^^

:-D

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: Sat, 16 Sep 2006 11:48:08 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Maximum number of sockets
Message-Id: <450b58e1$0$9241$afc38c87@news.optusnet.com.au>


"A Ma" <angusma@attglobal.net> wrote in message news:450b0ea0@kcnews01...
> "Sisyphus" <sisyphus1@nomail.afraid.org> wrote in message
> news:450a0b62$0$11969$afc38c87@news.optusnet.com.au...
> >
> >
> > Anyway - first check to see just what the actual value of
PERL_FD_SETSIZE
> > is.
> >
>
> A few updates:
>
> 1. I discovered that my immediate problem is unrelated to FD_SETSIZE. It
> turns out that I had a problem with IO::Select. In my test program, if I
do
> the following instead:
>
> my $pselect1 = IO::Select->new();
> my $pselect2 = IO::Select->new();
>
> for ($i=0;$i<=49;$i++) {
>  my $port = $i + 500;
>  if ($server1[$i] = IO::Socket::INET->new(LocalPort => $port,
>    Type      => SOCK_STREAM,
>    Reuse     => 1,
>    Listen    => 10 )) {
>   $pselect1->add($server1[$i]);
>  } else {
>   print "Cannot open port $port.\n";
>   $server1[$i] = 0;
>  }
>
>  $port = $i + 550;
>  if ($server2[$i] = IO::Socket::INET->new(LocalPort => $port,
>    Type      => SOCK_STREAM,
>    Reuse     => 1,
>    Listen    => 10 )) {
>   $pselect2->add($server2[$i]);
>  } else {
>   print "Cannot open port $port.\n";
>   $server2[$i] = 0;
>  }
> }
>
> then I can access all 100 ports. So IO::Select is limiting me to 64
sockets.

Heh ... hadn't thought of trying that :-)
However, I think it still could possibly be FD_SETSIZE that's limiting you
to 64 sockets per object. (Mind you .... I don't even *know* whether
FD_SETSIZE has any effect on the number of sockets you can open :-)

>
> 2. I wasn't able to run the In line C code. It seems to want to use "cl"
as
> the C compiler whereas I only have gcc from Mingw. I even tried copying
> gcc.exe as cl.exe but the compiler options are different. I don't know how
> to tell Inline to use a different compiler.

Seems odd. I think there *is* a way to get Inline to use the compiler of
choice - it should be mentioned in either 'perldoc Inline::C' or 'perldoc
Inline'.
But Inline::C should attempt to use the same compiler that was used to build
it - which in your case would be gcc. The inline::C that's being found (a
ppm ?) has apparently been built using cl.

>
> 3. My original ActiveState Perl was installed in c:\perl. When I compiled
my
> own version, I changed INST_TOP to put it in c:\perl1. Then I changed the
> path to point to c:\perl1\bin. But I think it is still going back to
c:\perl
> to look for some files. How do I switch between two different versions of
> Perl?
>

Yep - you just alter the path. Entering:
set PATH=C:\perl1\bin;%PATH%

will ensure that perl1\bin executable will be found. If you want to switch
back to C:\perl\bin you can just do:
set PATH=C:\perl\bin;%PATH%

You can always find out which perl you're running by entering:
perl -e "print $^X"

If the '.pl' extension has been associated the perl.exe in C:\perl\bin, then
altering the path to point to C:\perl1\bin won't change that - and if you
call a script by entering 'script.pl' instead of 'perl script.pl' you'll be
using C:\perl\bin, no matter which perl the path points to.

Cheers,
Rob




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

Date: Sat, 16 Sep 2006 04:42:10 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Sep 16 2006
Message-Id: <J5o52A.21w7@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

App-Info-0.50
http://search.cpan.org/~dwheeler/App-Info-0.50/
Information about software packages on a system
----
Archive-Zip-1.17_03
http://search.cpan.org/~adamk/Archive-Zip-1.17_03/
Provide an interface to ZIP archive files.
----
Array-Unique-0.07
http://search.cpan.org/~szabgab/Array-Unique-0.07/
Tie-able array that allows only unique values
----
BerkeleyDB-SecIndices-Accessor-0.04
http://search.cpan.org/~dongxu/BerkeleyDB-SecIndices-Accessor-0.04/
Simply drive your BerkeleyDB database with secondary indices
----
Bio-Das-1.03
http://search.cpan.org/~lds/Bio-Das-1.03/
Interface to Distributed Annotation System
----
Bundle-CPANPLUS-Test-Reporter-0.05
http://search.cpan.org/~kane/Bundle-CPANPLUS-Test-Reporter-0.05/
----
CGI-Application-Plugin-PageBuilder-0.97
http://search.cpan.org/~cmoore/CGI-Application-Plugin-PageBuilder-0.97/
Simplifies building pages with multiple templates.
----
Catalyst-Plugin-Cache-0.02
http://search.cpan.org/~nuffin/Catalyst-Plugin-Cache-0.02/
Flexible caching support for Catalyst.
----
Catalyst-Plugin-LogWarnings-0.01_module_release_corrupted_the_other_one
http://search.cpan.org/~jrockway/Catalyst-Plugin-LogWarnings-0.01_module_release_corrupted_the_other_one/
Log perl warnings to your Catalyst log object
----
DBIx-ORM-Declarative-0.10
http://search.cpan.org/~jschneid/DBIx-ORM-Declarative-0.10/
Perl extension for object-oriented database access
----
DBIx-ORM-Declarative-0.11
http://search.cpan.org/~jschneid/DBIx-ORM-Declarative-0.11/
Perl extension for object-oriented database access
----
Data-Table-1.49
http://search.cpan.org/~ezdb/Data-Table-1.49/
Data type related to database tables, spreadsheets, CSV/TSV files, HTML table displays, etc.
----
Devel-Pler-0.14
http://search.cpan.org/~adamk/Devel-Pler-0.14/
----
Encode-IBM-0.04
http://search.cpan.org/~audreyt/Encode-IBM-0.04/
IBM-specific encoding mappings
----
Geography-JapanesePrefectures-v0.0.4
http://search.cpan.org/~tokuhirom/Geography-JapanesePrefectures-v0.0.4/
Japanese Prefectures Data.
----
Handel-0.99_12
http://search.cpan.org/~claco/Handel-0.99_12/
Simple commerce framework with AxKit/TT/Catalyst support
----
Hardware-Vhdl-Lexer-1.00
http://search.cpan.org/~mykl/Hardware-Vhdl-Lexer-1.00/
Split VHDL code into lexical tokens
----
Ingres-Utility-IIMonitor-0.11
http://search.cpan.org/~worm/Ingres-Utility-IIMonitor-0.11/
API to IIMONITOR Ingres utility for IIDBMS servers control
----
Ingres-Utility-IINamu-0.02
http://search.cpan.org/~worm/Ingres-Utility-IINamu-0.02/
API to IINamu Ingres utility for (un)registering services with IIGCN
----
Module-Pluggable-Dependency-0.0.1
http://search.cpan.org/~mndrix/Module-Pluggable-Dependency-0.0.1/
order plugins based on inter-plugin dependencies
----
Module-Pluggable-Dependency-0.0.2
http://search.cpan.org/~mndrix/Module-Pluggable-Dependency-0.0.2/
order plugins based on inter-plugin dependencies
----
Module-Pluggable-Dependency-0.0.3
http://search.cpan.org/~mndrix/Module-Pluggable-Dependency-0.0.3/
order plugins based on inter-plugin dependencies
----
Net-RawIP-0.21_03
http://search.cpan.org/~szabgab/Net-RawIP-0.21_03/
Perl extension for manipulate raw ip packets with interface to libpcap
----
PAR-Repository-0.13
http://search.cpan.org/~smueller/PAR-Repository-0.13/
Create and modify PAR repositories
----
PAR-Repository-Client-0.12
http://search.cpan.org/~smueller/PAR-Repository-Client-0.12/
Access PAR repositories
----
PAR-Repository-Query-0.12
http://search.cpan.org/~smueller/PAR-Repository-Query-0.12/
Implements repository queries
----
POE-Component-Generic-0.0906
http://search.cpan.org/~gwyn/POE-Component-Generic-0.0906/
A POE component that provides non-blocking access to a blocking object.
----
POE-Component-SSLify-0.05
http://search.cpan.org/~apocal/POE-Component-SSLify-0.05/
Makes using SSL in the world of POE easy!
----
POE-Component-Server-SimpleHTTP-1.12
http://search.cpan.org/~apocal/POE-Component-Server-SimpleHTTP-1.12/
Perl extension to serve HTTP requests in POE.
----
POE-Component-SimpleDBI-1.13
http://search.cpan.org/~apocal/POE-Component-SimpleDBI-1.13/
Asynchronous non-blocking DBI calls in POE made simple
----
POE-Component-SpreadClient-0.01
http://search.cpan.org/~apocal/POE-Component-SpreadClient-0.01/
handle Spread communications in POE
----
POE-Component-SpreadClient-0.02
http://search.cpan.org/~apocal/POE-Component-SpreadClient-0.02/
handle Spread communications in POE
----
Parse-IRC-1.00
http://search.cpan.org/~bingos/Parse-IRC-1.00/
A parser for the IRC protocol.
----
Perl-Configure-0.03
http://search.cpan.org/~mschilli/Perl-Configure-0.03/
Answer perl's ./Configure questions reproducibly
----
Plagger-0.7.12
http://search.cpan.org/~miyagawa/Plagger-0.7.12/
Pluggable RSS/Atom Aggregator
----
TM-1.13
http://search.cpan.org/~drrho/TM-1.13/
Topic Maps, Base Class
----
Tk-MinMaxScale-0.12
http://search.cpan.org/~jpvidal/Tk-MinMaxScale-0.12/
Two Scale to get a (min, max) pair of values
----
Wiki-Toolkit-0.72
http://search.cpan.org/~dom/Wiki-Toolkit-0.72/
A toolkit for building Wikis.
----
threads-shared-1.03
http://search.cpan.org/~jdhedden/threads-shared-1.03/
Perl extension for sharing data structures between threads


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 16 Sep 2006 03:53:31 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: Sum the middle column for a given unique volser.
Message-Id: <%yKOg.12802$xQ1.6160@newsread3.news.pas.earthlink.net>

On 09/15/2006 01:28 PM, Noatec wrote:
> If I have a data set like the one below.
> 1st column = tape volser.
> 2nd column = the number of reads in the last hour.
> 3rd column = the last write date.
> I need to sum the 2nd column for each unique volser and spit out
> volser,sum,last write date.
> Would anyone be interested in helping me incorporate the hash?
> 
> Sample Data:
> 300000,1,2003-08-22
> 300000,1,2003-08-22
> 300000,1,2003-08-22
> 300000,1,2003-08-22
> 300000,1,2003-08-22
> 300000,1,2003-08-22
> 300000,2,2003-08-22
> 300000,2,2003-08-22
> 300000,2,2003-08-22
> 300000,2,2003-08-22
> 300000,3,2003-08-22
> 300000,3,2003-08-22
> 300001,1,2003-04-21
> 300001,1,2003-04-21
> 300001,1,2003-04-21
> 300001,1,2003-04-21
> 300001,1,2003-04-21
> 300001,1,2003-04-21
> So on an so forth for 1500 volsers.
> 
> This is all I have so far.
> #!/usr/bin/perl
> use warnings;
> my $line = mlist;
> my $sum = 0;
> 
> # open the file
> open(MLIST,"$line") or die "Unable to open mlist:$!\n";
> 
> # read it in one record at a time
> while ($line = <MLIST>) {
> my ($volser,$reads,$lwd) = split(/,/,$line);
> 
> 
> printf "$volser $reads $lwd"
> }
> 
> # close the file
> close(MLIST);
> 

First, make sure you know how hashes and hashes of arrays 
work. Read and understand "perldoc perldsc"

Put each volser in a hash. Each volser has two bits of 
information you need the program to remember about it: the 
count of accesses and the last access date.

The only way to store multiple pieces of data in a hash value 
is to use an anonymous array, so you would need to put the 
count of accesses and the last access date in an anonymous 
array when you assign to the hash.

On each iteration of the while loop, the count of accesses 
would be added to, and the last access date would be set to 
the latest seen so far.

I've already written most of the program, so I know it works.

BTW, if a poster is consistently rude to you, there is no need 
to read that person's posts.


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

Date: 15 Sep 2006 21:25:57 -0700
From: "Noatec" <Noatec@gmail.com>
Subject: Re: Sum the middle column for a given unique volser.
Message-Id: <1158380756.976840.19940@i3g2000cwc.googlegroups.com>


Paul Lalli wrote:
> Noatec wrote:
> > Paul Lalli wrote:
> > > Noatec wrote:
> > > > Paul Lalli wrote:
> > > > > Paul Lalli wrote:
> > > > > > Noatec wrote:
> > >
> > > > > > > #!/usr/bin/perl
> > > > > > > use warnings;
> > > > > > > my $line = mlist;
> > > > > > > my $sum = 0;
> > > > > > >
> > > > > > > # open the file
> > > > > > > open(MLIST,"$line") or die "Unable to open mlist:$!\n";
> > > > > > >
> > > > > > > # read it in one record at a time
> > > > > > > while ($line = <MLIST>) {
> > > > > > > my ($volser,$reads,$lwd) = split(/,/,$line);
> > > > > > >
> > > > > > >
> > > > > > > printf "$volser $reads $lwd"
> > > > > > > }
> > > > > > >
> > > > > > > # close the file
> > > > > > > close(MLIST);
> > > > > >
> > > >
> > > > Thanks for taking another look at the post.
> > > > I was unable to get the provided code to work right.
> > >
> > > That is a horrible error description.  How is it not "working right"
> > > for you?  What errors are you seeing?  Syntax errors?  Runtime errors?
> > > Incorrect output?  No output?  Infinite loop?  Crash?  Computer bursts
> > > into flames?
> > >
> > > >
> > > > my %volsers=();
> > > > for my $line (split(/\n/, $data)){
> > > >     my ($volser, $reads, $date) = split(/\,/,$line);
> > > >     $volsers{$volser}{reads}+=$reads;
> > > >     $volsers{$volser}{date}=$date;
> > >
> > >
> > > Other than the missing } that I assume you missed when copying, there's
> > > nothing wrong with that code.  Therefore, there's something wrong with
> > > your usage of it.  Please post a SHORT but COMPLETE script that
> > > demonstrates the problem you're seeing.
> > >
> > > > Just was just looking for another perspective on the problem.
> > >
> > > How can anyone have a different perspective when you haven't told
> > > anyone what's wrong with this perspective?
>
> > Are you always this critical of people who are trying to learn?
>
> You do not appear to be trying to learn.  You appear to be wanting
> someone to do your work for you.
>
> > I wouldn't think a teacher of technology would want to turn people off
> > of learning a new language.
>
> You are not trying to learn.  And as for "teacher of technology",
> you're not one of my students.  You're a guy posting to Usenet looking
> for a freebie.
>
> > Your posts are very condescending and borderline rude.
>
> No, I've passed beyond borderline now, and I'm definately being
> flat-out rude.  That's because your method of posting and asking
> questions has been at least equally rude.  You post a question to one
> list, and got an answer.  Rather than following up with that question,
> you posted to another group, made no mention of the answer you already
> got, and posted no further attempt to solve the problem based on the
> answer you already got.  Then when someone confronts you on it, you
> simply say "it didn't work", with no attempt to explain in what way it
> didn't work, or show the attempt you made that lead to it "not
> work"ing.  That is an astonishing amount of time of other people which
> you have wasted.  That is extremely rude.
>
> > I'm truly not looking for someone to solve this for me.
> > I really want to learn it.
>
> Then why haven't you posted your best attempt?  How can anyone correct
> it for you?  Why haven't you posted any specific questions beyond "How
> do I do this?"?
>
> > I'm trying to incorporate the hash into this working code that will
> > simply list every row.
> > I don't know what $data should be.
>
> So why didn't you ask that in the first place?  Why have you wasted all
> this time making people guess as to your level of understanding?  If
> you didn't understand what the code you were given is doing, why didn't
> you ask about that code?
>
> > #!/usr/bin/perl
>
> You forgot:
> use strict;
>
> > use warnings;
> > #my $line = $ARGV[0];
> > my $line = mlist;
>
> What the hell is this?  Is this a function?  Is it a bareword string?
> Where did it come from, and what does it represent?
>
> > my $sum = 0;
> >
> > # open the file
> > open(MLIST,"$line") or die "Unable to open mlist:$!\n";
>
> perldoc -q quoting
>
> So $line is supposed to be the name of the file you want to open?
> Doesn't that seem to be a REALLY bad variable name to you?
>
> Change those two lines to:
> my $filename = 'mlist';
> open my $MLIST, '<', $filename or die "Unable to open $filename: $!\n";
>
> > # read it in one record at a time
> > while ($line = <MLIST>) {
>
> Now you're using $line for something completely different.  Granted,
> here $line makes sense.
>
> while (my $line = <$MLIST>) {
>
> > my ($volser,$reads,$lwd) = split(/,/,$line);
>
> So now you have your three variables.  So now put them into the hash
> the way it was explained to you already.  The only difference is that
> while you called the line from the file $line, the poster who gave you
> that code called it $data.
>
> > printf "$volser,$reads,$lwd"
> > }
> >
> > # close the file
> > close(MLIST);
>
> Now loop through the keys of the hash and print out the values.
>
> Once you've actually made an ATTEMPT to do this, if it doesn't work,
> post a SHORT but COMPLETE script that demonstrates your error.
>
> Paul Lalli

HOLY CRACKERS !!!!!!!
You really made me angry !!!!
I thought about what you said; took some time to cool off and I'm fine
now.
Honestly, I'll bet you're probably not the prick you come off to be in
this medium.

At any rate, to prove that I am trying to learn, I'll stick with the
abrasive critique and post my findings tomorrow.
I kinda like the tough love thing.

Good Evening.



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

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


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