[28114] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9478 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 16 06:05:59 2006

Date: Sun, 16 Jul 2006 03:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 16 Jul 2006     Volume: 10 Number: 9478

Today's topics:
        CPANPLUS on debian headache <hobosalesman@gmail.com>
    Re: CPANPLUS on debian headache <hobosalesman@gmail.com>
    Re: CPANPLUS on debian headache <hobosalesman@gmail.com>
    Re: CPANPLUS on debian headache <hobosalesman@gmail.com>
    Re: CPANPLUS on debian headache <BZ@caradhras.net>
    Re: How get UTF-8 from urlencoded web form <bart@nijlen.com>
        new CPAN modules on Sun Jul 16 2006 (Randal Schwartz)
    Re: Parse data structure <see.sig@rochester.rr.com>
    Re: Parse data structure Davidcollins001@gmail.com
    Re: Problem with ([\w ]+?) <poubelles@gmail.com>
    Re: Problem with ([\w ]+?) <mumia.w.18.spam+nospam.usenet@earthlink.net>
    Re: Requirements for Perl on Windows XP? <1usa@llenroc.ude.invalid>
    Re: Requirements for Perl on Windows XP? <sisyphus1@nomail.afraid.org>
        THE END <hobosalesman@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 15 Jul 2006 23:20:45 -0700
From: "Hobo Salesman" <hobosalesman@gmail.com>
Subject: CPANPLUS on debian headache
Message-Id: <1153030845.284022.27880@b28g2000cwb.googlegroups.com>

Trying to set up cpanplus on debian testing. I find this:

http://debian.pkgs.cpan.org/

So I install cpanp using it... or try to until I'm stopped by a bug
that the changelog for cpanplus on cpan describes as:

"Key 'file' is of invalid type
    Turns out it's a bug in Module::Build, reported as
    #19741, which creates a 'Build' file when running
    'perl Makefile.PL' on a M::B generated Makefile.PL"

Ok... so instead I download cpanplus source from cpan, which is a later
version than the debian package anyway. Unfortunately it complains of a
dozen missing dependencies when running Makefile.PL. It suggests using
the bootstrapped version to install them easily and gives an example
command. I attempt and it fails after a long wait with a 500 server
error (timed out), which I don't understand because an unreachable
server isn't a 500??

Default debian distribution doesn't seem to give any way to search for
perl modules, the best it does is (sometimes) mention modules in the
description of a package. My best guess is cpanplus is the best way to
manage modules? I need an easy way to tell one machine to install all
the same modules as another machine.

Anyway, to get this damn module do I have to download and build every
one of it's dependencies seperately? I find it really puzzling that
every other peice of software I've wanted on this system takes no more
than 30 seconds to install, but installing a couple perl modules has so
far been as much as a root canal.

HS



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

Date: 15 Jul 2006 23:41:05 -0700
From: "Hobo Salesman" <hobosalesman@gmail.com>
Subject: Re: CPANPLUS on debian headache
Message-Id: <1153032065.750843.213090@i42g2000cwa.googlegroups.com>

Hobo Salesman wrote:
> command. I attempt and it fails after a long wait with a 500 server
> error (timed out), which I don't understand because an unreachable
> server isn't a 500??

I looked closer, it's using FTP, which means 500 is illegal PORT
command. I'm using iptables NAT and apparently the FTP client is
telling the server it's opening a port to set up a new data connection,
but the NAT router doesn't know this because it doesn't know anything
about application layer protocols. In other words, FTP sucks because it
can't be routed properly based on TCP/IP alone, and cpanp sucks because
I can't tell it to use PASV (which would solve the problem). Boy I love
linux, I have 10+ machines to install each of these 10+ modules on one
at a time.



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

Date: 16 Jul 2006 00:05:52 -0700
From: "Hobo Salesman" <hobosalesman@gmail.com>
Subject: Re: CPANPLUS on debian headache
Message-Id: <1153033552.903249.247410@s13g2000cwa.googlegroups.com>

Hobo Salesman wrote:
> I looked closer, it's using FTP, which means 500 is illegal PORT
> command. I'm using iptables NAT and apparently the FTP client is

Ok, thanks to ip_nat_ftp I can use non-PASV FTP... except that
ftp.cpan.org is a flaky peice of shit server. Seems like they're using
DNS for load balancing, I get a new IP every time I do an NSLOOKUP,
seems to be at least 4 or 5 servers, HALF of which seem to be down. I
can't get a ping reply or response on port 21 even using my gateway
machine for a lot of these servers.

Bootstrapped CPANPLUS is downloading all these files, failing most of
the time, and I have to manually find them buried 20 levels deep in the
filesystem to delete them so it can try these flaky servers again
(otherwise it just fails a checksum)...

 ... is this really the best way to install perl modules? If CPANPLUS is
using ftp.cpan.org to get the actual modules to install then this is a
joke, a very frustrating non-funny joke.



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

Date: 16 Jul 2006 00:16:48 -0700
From: "Hobo Salesman" <hobosalesman@gmail.com>
Subject: Re: CPANPLUS on debian headache
Message-Id: <1153034208.856643.268220@b28g2000cwb.googlegroups.com>

Hobo Salesman wrote:
> ... is this really the best way to install perl modules? If CPANPLUS is
> using ftp.cpan.org to get the actual modules to install then this is a
> joke, a very frustrating non-funny joke.

Hahaha... oh lord this is insane. It fails because Archive::Tar isn't
installed, in other words the method they have for satisfying
dependencies fails due to missing dependencies. So I download from cpan
and install, no make errors no problems... except that it still
complains theres no Archive::Tar. Ok.... so use the CPAN debian
respository to get the package that has this module... install that
too. Still can't find Archive::Tar... who the fuck knows where it's
looking for it.

I spent less time learning iproute2 and writing a firewall script than
installing CPANPLUS, and this is the tool that makes managing perl
modules easy...? I'm going nuts here, I need the functionality this
program provides but it seems hopelessly unusable?!



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

Date: Sun, 16 Jul 2006 09:14:27 +0000 (UTC)
From: BZ <BZ@caradhras.net>
Subject: Re: CPANPLUS on debian headache
Message-Id: <slrnebk0rj.lv3.BZ@emilia.vpn.zoetekouw.net>

Hobo Salesman wrote in comp.lang.perl.misc:
>  Default debian distribution doesn't seem to give any way to search for
>  perl modules, the best it does is (sometimes) mention modules in the
>  description of a package.

Uhm, Debian packages of perl modules are just consistently named;
there's therefor no need to search.
Just use dpkg -l lib\*-perl or so to list all available modules.

-- 
BZ


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

Date: 16 Jul 2006 02:41:46 -0700
From: "Bart Van der Donck" <bart@nijlen.com>
Subject: Re: How get UTF-8 from urlencoded web form
Message-Id: <1153042906.092292.33600@m73g2000cwd.googlegroups.com>

Yohan N. Leder wrote:

> All my tests are done using ActivePerl 5.8.8.817 under Win2K FR and
> Apache2.
>
> I'm trying to obtain (and display) user data which come from a web form
> with enctype as 'application/x-www-form-urlencoded' and don't succeed. I
> can do-it if the form is a 'multipart/form-data' but not a
> 'application/x-www-form-urlencoded'.

[snip code ]

> For example, if I submit the 'urlencoded' form (the first one, at top of
> generated web page, if you run the script without any url parameter)
> with the letter '=E9' (accentuated e) inside the textarea, I get 'msg=3D%=
C3%
> A9' displayed in the browser (knowing this has been proceeded through
> the see() sub).
>
> While, if I submit the same '=E9' from the 'multipart/form-data' form (the
> second one, at bottom of generated web page), I get a well interpreted
> UTF-8 '=E9' as expected.
>
> How to get this same UTF-8 '=E9' when form uses 'application/x-www-form-
> urlencoded' enctype ? How to modify the see() sub for this urlencoded
> form case ?

That shouldn't be particularly mysterious. You're specifying the page's
charset as UTF-8 in its header (where you say "Content-type: text/html;
charset=3DUTF-8"), causing the '=E9'- character to be sent as Unicode's
literal '=C3=A9' (dec 142/hex 8E/eacute/LATIN SMALL LETTER E WITH ACUTE.
The code point for =C3 is C3, and for =A9 it's A9, thus the expected
value becomes %C3%A9.

Encoding =E9 -> =C3=A9 -> %C3%A9 :

  #!/usr/bin/perl -w
  my $posteddata =3D <STDIN>;
  print <<PAGE
  Content-type: text/html; charset=3DUTF-8

  <html><body>
  Posted data: $posteddata<hr>
  <form action=3D'f.pl' method=3D'post'>
  <textarea name=3D'msg'></textarea>
  <input type=3D'submit'>
  </form></body></html>
  PAGE

Whereas the "normal" form encoding would be =E9 -> %E9:

  #!/usr/bin/perl -w
  my $posteddata =3D <STDIN>;
  print <<PAGE
  Content-type: text/html

  <html><body>
  Posted data: $posteddata<hr>
  <form action=3D'f.pl' method=3D'post'>
  <textarea name=3D'msg'></textarea>
  <input type=3D'submit'>
  </form></body></html>
  PAGE

P=2ES. 'application/x-www-form-urlencoded' is the default form encoding
type anyhow, so there is actually no need to set this as a form
argument.

Recommended literature:
http://home.tiscali.nl/t876506/utf8tbl.html (search for string C3A9 on
that page)
Table CPs < 256: http://en.wikipedia.org/wiki/ISO_8859-1
And of course Perl FAQ/docs, as Gunnar pointed out.

--=20
 Bart



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

Date: Sun, 16 Jul 2006 04:42:06 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Jul 16 2006
Message-Id: <J2HBq6.1Gvu@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.

ASNMTAP-3.000.010
http://search.cpan.org/~asnmtap/ASNMTAP-3.000.010/
----
Album-Wretch-0.01
http://search.cpan.org/~gslin/Album-Wretch-0.01/
Grub Lists for www.wretch.cc
----
Cairo-0.90
http://search.cpan.org/~tsch/Cairo-0.90/
Perl interface to the cairo library
----
Class-MOP-0.31
http://search.cpan.org/~stevan/Class-MOP-0.31/
A Meta Object Protocol for Perl 5
----
Config-Tiny-2.08
http://search.cpan.org/~adamk/Config-Tiny-2.08/
Read/Write .ini style files with as little code as possible
----
FLV-Info-0.03
http://search.cpan.org/~clotho/FLV-Info-0.03/
Extract metadata from Flash Video files
----
HTML-TableExtract-2.10
http://search.cpan.org/~msisk/HTML-TableExtract-2.10/
Perl module for extracting the content contained in tables within an HTML document, either as text or encoded element trees.
----
Handel-0.99_04
http://search.cpan.org/~claco/Handel-0.99_04/
Simple commerce framework with AxKit/TT/Catalyst support
----
MDV-Repsys-0.02
http://search.cpan.org/~nanardon/MDV-Repsys-0.02/
----
Method-Alias-1.03
http://search.cpan.org/~adamk/Method-Alias-1.03/
Create method aliases (and do it safely)
----
Module-Build-0.2802
http://search.cpan.org/~kwilliams/Module-Build-0.2802/
Build and install Perl modules
----
Module-Build-0.2803
http://search.cpan.org/~kwilliams/Module-Build-0.2803/
Build and install Perl modules
----
Perl-Critic-Bangs-0.20
http://search.cpan.org/~petdance/Perl-Critic-Bangs-0.20/
A collection of handy Perl::Critic policies
----
Test-Dependencies-0.04
http://search.cpan.org/~zev/Test-Dependencies-0.04/
Ensure that your Makefile.PL specifies all module dependencies
----
Test-HasVersion-0.01
http://search.cpan.org/~ferreira/Test-HasVersion-0.01/
Check Perl modules have version numbers
----
Text-ASCIITable-0.18
http://search.cpan.org/~lunatic/Text-ASCIITable-0.18/
Create a nice formatted table using ASCII characters.
----
Text-MeCab-0.12
http://search.cpan.org/~dmaki/Text-MeCab-0.12/
Alternate Interface To libmecab
----
Text-TagTemplate-1.83
http://search.cpan.org/~matisse/Text-TagTemplate-1.83/
----
Tk-Tree-4.4
http://search.cpan.org/~reneeb/Tk-Tree-4.4/
Create and manipulate Tree widgets


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: Sun, 16 Jul 2006 02:00:06 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: Parse data structure
Message-Id: <G4hug.62455$W97.52959@twister.nyroc.rr.com>

Davidcollins001@gmail.com wrote:
> I am looking to parse data into a complex structure of hashes and
> arrays. I have been reading the data structures cookbook on the CPAN
> website
> (http://search.cpan.org/~nwclark/perl-5.8.7/pod/perldsc.pod#MORE_ELABORATE_RECORDS).
> At the bottom they say that it is sometimes easier to have the file as
> the data structure that would be used to create the structure in perl.
> 
> I was wondering how to do this? I have been playing around trying to
> learn how to use complex structures, but I can't figure out how to get
> perl to parse code into a hash? I did initially think of placing the
> data structure in a file and setting the hash equal to it, but that
> doesn't work. am I thinking too simplistic?
> 
> This is my data structure that I am playing around with in a separate
> file:
> 
> may  => [
>          [2,'train',20.00, 'expensive'],
>          [6,'train',15],
> 	  [19,'car',18,'best way']
> 	     ],
> june => [
> 	 [5,'car',2.00],
> 	 [9,'train',1],
> 	 [19,'cat',18,'best way']
> 	    ],
> july => [
>      	 [14,'plane',100],
> 	 [23,'boat',20]
> 	    ],
> 
> 
> And this is the code I have to read and print it out:
> 
> 
> ## read above from file into hash
> open(DATA, "<$file");
> my %HoLoL=<DATA>;
> close(DATA);
> 
> 
> ## print each element separately
> foreach my $date ( keys %HoLoL )
> {
>     print "$date";
>     for(my $i=0; $i<($#{@{$HoLoL{$date}}}+1); $i++)
>     {
> 	for(my $j=0; $j<($#{ $HoLoL{$date} [$i] }+1); $j++)
> 	{
> 	    print "\t ${ $HoLoL{$date} [$i]}[$j] ";
> 	}
> 	print "\n";
>     }
> }
> print "\n";
> 
> 
> (I know I can print it out easier and probably quicker with one less
> loop at least, I just wanted to know how to get to each element.)
> 
> Thanks in advance
> 

Well, if you want to make your data files be Perl code, make it 
valid Perl, something like:

$HoLoL={
may  => [
          [2,'train',20.00, 'expensive'],
          [6,'train',15],
	  [19,'car',18,'best way']
	     ],
june => [
	 [5,'car',2.00],
	 [9,'train',1],
	 [19,'cat',18,'best way']
	    ],
july => [
      	 [14,'plane',100],
	 [23,'boat',20]
	    ],
};

Then you can write a Perl program to execute this data file as 
follows, taking advantage of an already-written module to print 
the data structure (which module, incidentally, generates valid 
Perl code):

use strict;
use warnings;
our $HoLoL;
do 'junk566.txt';
use Data::Dumper;
print Dumper($HoLoL);

When run, this generates:

D:\junk>perl junk566.pl
$VAR1 = {
           'june' => [
                       [
                         5,
                         'car',
                         '2'
                       ],
                       [
                         9,
                         'train',
                         1
                       ],
                       [
                         19,
                         'cat',
                         18,
                         'best way'
                       ]
                     ],
           'may' => [
                      [
                        2,
                        'train',
                        '20',
                        'expensive'
                      ],
                      [
                        6,
                        'train',
                        15
                      ],
                      [
                        19,
                        'car',
                        18,
                        'best way'
                      ]
                    ],
           'july' => [
                       [
                         14,
                         'plane',
                         100
                       ],
                       [
                         23,
                         'boat',
                         20
                       ]
                     ]
         };

D:\junk>

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


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

Date: 16 Jul 2006 02:28:20 -0700
From: Davidcollins001@gmail.com
Subject: Re: Parse data structure
Message-Id: <1153042100.535707.296160@m73g2000cwd.googlegroups.com>

Hi Bob,

That is exactly what I was after. Thanks :)



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

Date: 15 Jul 2006 20:49:04 -0700
From: "forwax" <poubelles@gmail.com>
Subject: Re: Problem with ([\w ]+?)
Message-Id: <1153021744.454846.325680@m73g2000cwd.googlegroups.com>

I did what you told me and read a bit about HTML::Parser but think I'm
gonna go with HTML::TokeParser, I find it easier to comprehend but
there's one thing I'm not sure.

My HTML file have some url tag and some that do not. Which methode
would you choose ? Should I use like 2 while loop, one with the get_tag
and one with the get_text but with the get_text how I get to see if the
line as a reference to a url link and not do anything with it ?



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

Date: Sun, 16 Jul 2006 06:19:05 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: Problem with ([\w ]+?)
Message-Id: <tTkug.8783$PE1.1070@newsread2.news.pas.earthlink.net>

On 07/15/2006 06:49 PM, forwax wrote:
> [...]
> 2.
> <tr><td class="STHSSchedule_GameNumber">1</td><td
> class="STHSSchedule_ProLink"><a href="AHSQ2006-1.html">New York Rangers
> (1) vs Pittsburgh Penguins (2)</a> </td><td
> class="STHSSchedule_FarmLink">
> [...]

Where is all this data coming from? What are you trying to do 
with it?





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

Date: Sun, 16 Jul 2006 01:16:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Requirements for Perl on Windows XP?
Message-Id: <Xns9801D87A7D722asu1cornelledu@127.0.0.1>

"Sisyphus" <sisyphus1@nomail.afraid.org> wrote in
news:44b98e7d$0$25589$afc38c87@news.optusnet.com.au: 

> 
> "Teffy" <WGSGNUAYHTTE@spammotel.com> wrote in message
> news:1153008076.605295.280650@75g2000cwc.googlegroups.com...
>> A. Sinan Unur wrote:
>> >
>> > Please use PPM and solve your problem.
>> >
>>
>> >From the ppm command prompt I typed:

 ..
>> no pre-built PPM package for either HTML::LinkExtor or SOAP::Lite. 
>> Bummer. 
>>
> 
> Yep - they generally don't provide ppm's for modules that ship as
> standard with ActiveState perl.

Hey, I totally forgot about the fact that they are core. I just figured 
the OP's UTIL script did not run with the stock install and therefore he 
was looking for the modules.

I should have double-checked, but thanks for catching that.

BTW:

D:\UseNet\clpmisc> perl -v

This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 25 registered patches, see perl -V for more detail)

Copyright 1987-2006, Larry Wall

Binary build 817 [257965] provided by ActiveState 
http://www.ActiveState.com
Built Mar 20 2006 17:54:25

D:\UseNet\clpmisc> perl -MSOAP::Lite -e "print $SOAP::Lite::VERSION"
0.55

ppm> rep
Repositories:
[1] ActiveState PPM2 Repository
[2] ActiveState Package Repository
[3] University of Winnipeg
[4] Apache Organization

ppm> rep desc 3
Describing Active Repository 3:
    Name: University of Winnipeg
Location: http://theoryx5.uwinnipeg.ca/ppms/
    Type: Webpage

ppm> upgrade SOAP-Lite
SOAP-Lite 0.55.0.1: new version 0.67 available in University of Winnipeg
Use '-precious' to force precious packages to be upgraded.

Something to keep in mind if the OP has problems with the stock version.

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: Sun, 16 Jul 2006 18:08:30 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Requirements for Perl on Windows XP?
Message-Id: <44b9f4e5$0$25276$afc38c87@news.optusnet.com.au>


"A. Sinan Unur" <1usa@llenroc.ude.invalid>
 .
 .
>
> Hey, I totally forgot about the fact that they are core. I just figured
> the OP's UTIL script did not run with the stock install and therefore he
> was looking for the modules.
>

I've likewise been sucked in by the very same (on more than one occasion) in
the past ..... and there's no guarantee that it won't happen to me again :-)

Cheers,
Rob




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

Date: 16 Jul 2006 00:48:11 -0700
From: "Hobo Salesman" <hobosalesman@gmail.com>
Subject: THE END
Message-Id: <1153036091.536445.84510@p79g2000cwp.googlegroups.com>

Hobo Salesman wrote:
> Hahaha... oh lord this is insane. It fails because Archive::Tar isn't
> installed, in other words the method they have for satisfying
> dependencies fails due to missing dependencies.

And in the end I downloaded the cpan.pm package in 10 seconds.
Apparently it's replaced by cpanplus, which is like 5 years old and
still a worthless peice of shit? I don't get it, do I just have bad
luck, am I missing something...? I'll use cpan.pm I guess.



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

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


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