[31918] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3181 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 19 00:09:22 2010

Date: Mon, 18 Oct 2010 21:09:07 -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           Mon, 18 Oct 2010     Volume: 11 Number: 3181

Today's topics:
    Re: perl curl get data from website sln@netherlands.com
    Re: please help with creating a special iterator <glex_no-spam@qwest-spam-no.invalid>
    Re: please help with creating a special iterator sln@netherlands.com
    Re: reading LWP in chunks <ben@morrow.me.uk>
    Re: where to install cpan modules <john@example.invalid>
    Re: where to install cpan modules <john@example.invalid>
    Re: where to install cpan modules <willem@turtle.stack.nl>
    Re: where to install cpan modules <jimsgibson@gmail.com>
    Re: where to install cpan modules <glex_no-spam@qwest-spam-no.invalid>
    Re: where to install cpan modules <ben@morrow.me.uk>
    Re: where to install cpan modules <john@example.invalid>
    Re: where to install cpan modules <john@example.invalid>
    Re: where to install cpan modules <ben@morrow.me.uk>
    Re: where to install cpan modules <ben@morrow.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 18 Oct 2010 12:26:23 -0700
From: sln@netherlands.com
Subject: Re: perl curl get data from website
Message-Id: <t47pb61qmcoed8hdcfep74bf2h3n06kql9@4ax.com>

On Mon, 18 Oct 2010 05:58:42 -0700 (PDT), SVCitian <emailsrvr-groups@yahoo.com> wrote:

>On Oct 17, 10:21 pm, Tad McClellan <ta...@seesig.invalid> wrote:
>> SVCitian <emailsrvr-gro...@yahoo.com> wrote:
>> > I even tried to user "tamper data" firefox add to get behind the
>> > scenes of GET, POST, etc... but I can't proceed any further than the
>> > URLs given above.
>>
>> > why? that may be something to do with ajax, cookie, user agent, or
>> > whatever.
>>
>> You might want to try it with the Web Scraping Proxy:
>>
>>    http://www2.research.att.com/sw/tools/wsp/
>>
>> which is nice because it logs the traffic in the form of
>> Perl code that you can copy/paste/modify to suit your needs.
>>
>> --
>> Tad McClellan
>> email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
>> The above message is a Usenet post.
>> I don't recall having given anyone permission to use it on a Web site.
>
>I have tried this long time back, and I couldn't make it work and also
>failed with the attempt.
>
>This in itself generated a whole search in forums for making it work.
>
>If anyone out there who has used wsp (and still have it on their
>computers), could you run my site through it and advise your findings.
>I think it just takes few minutes of your time if you have already
>made the wsp work for you.
>
>Will appreciate your assistance.
>
>Thank you.
>

I think the key to using a buggy wsp.pl is to install openssl. Even then,
its buggy as there's so much dependency on browser settings and caches.
Might have to use a seperate machine for the proxy. I used it locally 127.0.0.1
and enabled browser lowest security/privacy, disabled all advanced options.
Still buggy, have to end process in task manager.

After disabling everything in advanced options in IE6 (it had problems with
png file downloads), this was captured with obtuse line breaks and possible
unknown encoding (probably utf-8).

I'm sure this won't help.

-sln

 --- Proxy server running on rcx port: 5364 

# Request: 
http://www.bangkokflightservices.com/TrackTrace/showc_track.php?m_prefix=176&m_s
n=75064953&h_prefix=HWB&h_sn=&ecy=e076438db64c6190f7b9689a379b7f7093368f1652d14d
b65fee1ab916713f3f5f4030f53369cb1f669614312c4748899c272f4d976a2b299274a21ad80fc0
72b1bab2ab1c181d08c670188722e51ec162f9ae337e3f2f132c88d249133815558d241ce8a4e9b3
fa75c144268b9e901037c2c7257142ee42ff9b2bf2767f57ed62b94fd938ea4dd2b28c53fea6af74
be&ch=%A0%A0%A0%A0 
# Cookie (NO Set-Cookie): 'PHPSESSID', '1831c0a805050e73bff5a54e0fa017d5
'
$request = new HTTP::Request('GET' => 
"http://www.bangkokflightservices.com/TrackTrace/showc_track.php?m_prefix=176&m_
sn=75064953&h_prefix=HWB&h_sn=&ecy=e076438db64c6190f7b9689a379b7f7093368f1652d14
db65fee1ab916713f3f5f4030f53369cb1f669614312c4748899c272f4d976a2b299274a21ad80fc
072b1bab2ab1c181d08c670188722e51ec162f9ae337e3f2f132c88d249133815558d241ce8a4e9b
3fa75c144268b9e901037c2c7257142ee42ff9b2bf2767f57ed62b94fd938ea4dd2b28c53fea6af7
4be&ch=%A0%A0%A0%A0");
# Table 1: 11 rows; table nesting: 5
# Saving web page as w4

# Request: 
http://www.bangkokflightservices.com/TrackTrace/search_awb.php?m_prefix=176&m_sn
=75064953&h_prefix=HWB&h_sn=&ch=    &id=0.015485021941311072 
# Referer: 
http://www.bangkokflightservices.com/TrackTrace/showc_track.php?m_prefix=176&m_s
n=75064953&h_prefix=HWB&h_sn=&ecy=e076438db64c6190f7b9689a379b7f7093368f1652d14d
b65fee1ab916713f3f5f4030f53369cb1f669614312c4748899c272f4d976a2b299274a21ad80fc0
72b1bab2ab1c181d08c670188722e51ec162f9ae337e3f2f132c88d249133815558d241ce8a4e9b3
fa75c144268b9e901037c2c7257142ee42ff9b2bf2767f57ed62b94fd938ea4dd2b28c53fea6af74
be&ch=%A0%A0%A0%A0
# Cookie: 'PHPSESSID', '1831c0a805050e73bff5a54e0fa017d5
'
$request = new HTTP::Request('GET' => 
"http://www.bangkokflightservices.com/TrackTrace/search_awb.php?m_prefix=176&m_s
n=75064953&h_prefix=HWB&h_sn=&ch=    &id=0.015485021941311072");
# Table 1: 5 rows
# Table 2: 9 rows
# Saving web page as w5




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

Date: Mon, 18 Oct 2010 13:14:28 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: please help with creating a special iterator
Message-Id: <4cbc7dcd$0$2508$815e3792@news.qwest.net>

J. Gleixner wrote:
[...]
> my ( $prev_f1, $prev_f2, @data );
> while( my $line = <> )
> {
>     chomp( $line );
>     my ( $f1, $f2, @fields ) = parse-line-somehow();
>     

FYI: Just looking at this again..

Dumb bug here, which will cause it to always go to the
else, on the first line read.. so you'll have to modify
this if() accordingly.

>     if( $f1 eq $prev_f1 && $f2 eq $prev_f2 )
>     {
>         push( @data, \@fields );
>     }
>     else
>     {


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

Date: Mon, 18 Oct 2010 18:11:40 -0700
From: sln@netherlands.com
Subject: Re: please help with creating a special iterator
Message-Id: <mqrpb6lkd9v9hr75eevqbjmuvkcgmmtcdm@4ax.com>

On Mon, 18 Oct 2010 11:09:11 -0500, "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid> wrote:

>Mathematisch wrote:
>> Hi,
>> 
>> The problem: I would like to create an iterator to iterate through a
>> csv file with the following structure:
>> 
>> 
>> field_1,field_2,...field_14
>> field_1,field_2,...field_14
>> (...)
>> 
>> 
>> 
>> Note that this is a csv file with 14 fields and it is already sorted
>> by field_1 and then by field_2. There are usually only 5-10 lines
>> having the same field_1 and field_2 value.
>> 
>> There could be up to hundreds of millions of lines in the file. The
>> desired iterator should work like this: At each "next_entry" call, the
>> iterator should return a reference to an array of the lines having the
>> identical field_1 and field_2 values.
>> 
>> Because of my lack of understanding the iterator concept, I could not
>> come up with a solution yet. The file is too big to use the field_1
>> and field_2 as a hash key to achieve the same goal of grouping the
>> entries.
>
>You don't say what you want to do with the data, however
>you could store everything into a database, then using
>group by, order by, you could process your data easily.
>
>However, since you say that everything is already sorted
>by those keys, you could process things as you read the
>file, keeping track of when those fields change.  Throwing a
>next_entry around this and having it return the data
>of calling process_data, would be simple enough, I rarely
>bother with creating an 'iterator'.. but that's just me.. :-)
>
>Hopefully you're using Text::CSV or some other module to
>parse the CSV file.
>
>my ( $prev_f1, $prev_f2, @data );
>while( my $line = <> )
>{
>	chomp( $line );
>	my ( $f1, $f2, @fields ) = parse-line-somehow();
>	
>	if( $f1 eq $prev_f1 && $f2 eq $prev_f2 )
>	{
>		push( @data, \@fields );
>	}
>	else
>	{
>		process_data( $prev_f1, $prev_f2, \@data );
>		$prev_f1 = $f1;
>		$prev_f2 = $f2;
>		undef @data;
>		push( @data, \@fields );
>	}
>}
>process_data( $prev_f1, $prev_f2, \@data ) if @data;
>
>sub process_data
>{
>	my $f1 = shift;
>	my $f2 = shift;
>	my $data_aref = shift;
>
>	# do whatever you want...
>}

Since it's set up to process_data() on every
non-match (including the first line), the check could
be in the function.

----------

my ( $prev_f1, $prev_f2, @data );
while( my $line = <> )
{
    ...
}
process_data( $prev_f1, $prev_f2, \@data ); # if @data;

sub process_data
{
    my ( $f1, $f2, $data_aref ) = @_;
    return unless @{$data_ref};

    if ( @{$data_ref} > 1 ) {
        # process multiple records (all with same f1 f2 val's) 
    }
    else {
        # process single record (or not)
    }
}

-sln


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

Date: Mon, 18 Oct 2010 22:20:24 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: reading LWP in chunks
Message-Id: <o9quo7-pqp.ln1@osiris.mauzo.dyndns.org>


Quoth Jim Gibson <jimsgibson@gmail.com>:
> In article
> <03b109e7-41b3-4471-95cb-72a6e7833fda@i21g2000yqg.googlegroups.com>,
> Klaus <klaus03@gmail.com> wrote:
> 
> > > > > Quoth Klaus <klau...@gmail.com>:
> > > > > > I am trying to write a Module (its name will be LWP::Chunk) to
> > > > > > read arbitrarily big http-files sequentially in small chunks.
> > 
> > > Quoth Klaus <klau...@gmail.com>:
> > > > At this point, I want to go ** deep ** into the guts of LWP::UserAgent-
> > > > >get ( -- that could be inside LWP::UserAgent, inside HTTP::Request,
> > > > inside HTTP::Response, etc... -- )  to find that loop, rip out that
> > > > line that says "read_chunk()" and stick it into my new module
> > > > "LWP::Chunk")
> > 
> > On 18 oct, 16:09, Ben Morrow <b...@morrow.me.uk> wrote:
> > > Why? What is wrong with using the existing API?
> > 
> > Nothing, it's just yet another TIMTOWTDI for reading LWP. I personally
> > prefer reading in chunks using my own while-construct, while others
> > might prefer a simple call to LWP::UserAgent->get(...) using
> > callbacks.
> 
> I believe Ben is suggesting that you implement your LWP::Chunk module
> and its while-construct by using the existing add_handler method of
> LWP::UserAgent, rather than extracting the code from there and putting
> it into your own module. This is known as adding a "layer", and is
> commonly done to make using some complicated interface easier to use
> for some commonly-used purpose.

Yes, precisely. It would also be rather difficult to extract that bit of
functionality without losing a lot of the flexibility of LWP.

> The disadvantage is that you are then dependent upon that module. If
> the API ever changes, you will need to change your module. If support
> for the module is ever dropped, you may need to rewrite your own
> module. However, since LWP::UserAgent is a widely-used, mature module,
> neither of these circumstances is likely.

We're talking about open-source CPAN modules here, so if support is ever
dropped the worst case is that you need to step up and maintain it
yourself. API changes can be harder, but, again, in the worst case you
can always fork the module under a different name.

> > I simply want to provide an LWP-module for those who prefer writing
> > their own while-construct, but to be honest, apart from myself, I
> > don't know how many there are amongst the perl user community who
> > prefer writing their own while-construct.
> 
> Nobody is suggesting that you do not write a module, just that you use
> existing code as is, rather than extracting it and copying it.

Well, I kinda was suggesting Klaus didn't write a module :). I'm not
sure I see that

    $UA->get($url, :read_size_hint => 1024, :content_cb => sub {
        ...
    });

is that much less clear than

    while ($CH->get($url, :chunk => 1024)) {
        ...
    }

but, certainly, if you (Klaus) do there's no harm in a wrapper. In
particular, if you care that the chunks *always* the right size then,
since LWP doesn't guarantee that, a wrapper that does its own buffering
would be necessary.

Ben



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

Date: Mon, 18 Oct 2010 13:34:20 -0600
From: John Smith <john@example.invalid>
Subject: Re: where to install cpan modules
Message-Id: <PqCdncgC67ihPCHRnZ2dnUVZ5oGdnZ2d@giganews.com>

Ben Morrow wrote:

> Yes. You should now have a successful installation of local::lib, and if
> you try to install something straightforward (like, say, an upgrade of
> Scalar::Util) it should go into your ~/perl5/lib directory.

Alright, thx ben, I think I'm doing some damage now:

$ pwd
/home/ron/perl
$ ls
Digest-MD5-2.51            local-lib-1.006007
Digest-MD5-2.51.tar.gz     local-lib-1.006007.tar.gz
Inline-0.46                Parse-RecDescent-1.965001
Inline-0.46.tar.gz         Parse-RecDescent-1.965001.tar.gz
Inline-Python-0.37         Wiki-Gateway-0.001991.tar.gz
Inline-Python-0.37.tar.gz
$ cd Parse-RecDescent-1.965001/
$ ls
Build.PL  demo  Makefile.PL  META.yml  t
Changes   lib   MANIFEST     README    tutorial
$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for Parse::RecDescent
$ make
cp lib/Parse/RecDescent.pm blib/lib/Parse/RecDescent.pm
Manifying blib/man3/Parse::RecDescent.3pm
$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" 
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00.load.................ok 1/1# Testing Parse::RecDescent 1.965001 

t/00.load.................ok 

t/basics..................ok 

t/leftop_cap..............ok 

t/pod.....................skipped
         all skipped: Test::Pod 1.14 required for testing POD
t/re_capture_return.......ok 

t/separated_repetition....ok 

All tests successful, 1 test skipped.
Files=6, Tests=28,  1 wallclock secs ( 0.83 cusr +  0.05 csys =  0.88 CPU)
$ make install
Installing /home/ron/perl5/lib/perl5/Parse/RecDescent.pm
Installing /home/ron/perl5/man/man3/Parse::RecDescent.3pm
Writing 
/home/ron/perl5/lib/perl5/i486-linux-gnu-thread-multi/auto/Parse/RecDescent/.packlist
Appending installation info to 
/home/ron/perl5/lib/perl5/i486-linux-gnu-thread-multi/perllocal.pod
$

 ...

$ ls
RecDescent.pm
$ pwd
/home/ron/perl/Parse-RecDescent-1.965001/lib/Parse
$


By the looks of it, do I have local::lib configured correctly?

> 
>> What more must I do, because it fails 751 out of 752 tests every time?
> 
> Given your other post, I presume you mean Inline::Python fails these
> tests? I can't tell what's going wrong here without seeing the test
> output from Inline::Python. Since the installation got as far as 'make
> test', it sounds like you've installed all the right headers, but
> something else important is going wrong.


There's simply a fair amount of elbow grease in this task.  This thread 
really isn't about python at all, but what one must do to have a proper 
cpan facility.

Is there a way with a browser on CPAN to download a module along with 
its dependencies without having to chase them down?
-- 
John Smith


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

Date: Mon, 18 Oct 2010 13:54:26 -0600
From: John Smith <john@example.invalid>
Subject: Re: where to install cpan modules
Message-Id: <kaWdnYPDwMhvOCHRnZ2dnUVZ5rOdnZ2d@giganews.com>

luser-ex-troll wrote:
> On Oct 16, 4:16 pm, John Smith <j...@example.invalid> wrote:

>> Second, what is the difference between these two?
>> # ls -l perl
>> total 12
>> lrwxrwxrwx  1 root root     6 2009-12-13 18:06 5.10 -> 5.10.0
>> drwxr-xr-x 50 root root 12288 2010-10-08 23:11 5.10.0
> 
> 5.10 is a symbolic link (a shortcut) to 5.10.0
> 

Why does 'perl' not appear in the output of the ls command?
-- 
John Smith


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

Date: Mon, 18 Oct 2010 19:57:17 +0000 (UTC)
From: Willem <willem@turtle.stack.nl>
Subject: Re: where to install cpan modules
Message-Id: <slrnibp9kt.fjo.willem@turtle.stack.nl>

John Smith wrote:
) luser-ex-troll wrote:
)> On Oct 16, 4:16 pm, John Smith <j...@example.invalid> wrote:
)
)>> Second, what is the difference between these two?
)>> # ls -l perl
)>> total 12
)>> lrwxrwxrwx  1 root root     6 2009-12-13 18:06 5.10 -> 5.10.0
)>> drwxr-xr-x 50 root root 12288 2010-10-08 23:11 5.10.0
)> 
)> 5.10 is a symbolic link (a shortcut) to 5.10.0
)> 
)
) Why does 'perl' not appear in the output of the ls command?

Why should it ?  It's a directory, and you're viewing the contents.
Perhaps you should find a 'unix for beginners' book or tutorial.


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT


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

Date: Mon, 18 Oct 2010 13:44:42 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: where to install cpan modules
Message-Id: <181020101344425038%jimsgibson@gmail.com>

In article <kaWdnYPDwMhvOCHRnZ2dnUVZ5rOdnZ2d@giganews.com>, John Smith
<john@example.invalid> wrote:

> luser-ex-troll wrote:
> > On Oct 16, 4:16 pm, John Smith <j...@example.invalid> wrote:
> 
> >> Second, what is the difference between these two?
> >> # ls -l perl
> >> total 12
> >> lrwxrwxrwx  1 root root     6 2009-12-13 18:06 5.10 -> 5.10.0
> >> drwxr-xr-x 50 root root 12288 2010-10-08 23:11 5.10.0
> > 
> > 5.10 is a symbolic link (a shortcut) to 5.10.0
> > 
> 
> Why does 'perl' not appear in the output of the ls command?

Because 'ls' on a directory lists the contents of that directory. If
you want to view information on the directory file itself, use the '-d'
flag.

-- 
Jim Gibson


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

Date: Mon, 18 Oct 2010 16:56:28 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: where to install cpan modules
Message-Id: <4cbcc28c$0$89385$815e3792@news.qwest.net>

John Smith wrote:
[...]
> $ make install
> Installing /home/ron/perl5/lib/perl5/Parse/RecDescent.pm

              ^^^^^^^^^^^^^^^^^
This is where the module is now installed.

[...]
> $ ls
> RecDescent.pm
> $ pwd
> /home/ron/perl/Parse-RecDescent-1.965001/lib/Parse

Not this.  This is where it built (compiled, tested, etc.) the module 
and has nothing to do with where it's installed.  Once it's installed
there's generally no need for that Parse-RecDescent-1.965001 directory.

> By the looks of it, do I have local::lib configured correctly?

If you wanted to install Parse::RecDescent into 
/home/ron/perl5/lib/perl5, then yes, if you wanted
to install it somewhere else, then no.


> There's simply a fair amount of elbow grease in this task.  This thread 
> really isn't about python at all, but what one must do to have a proper 
> cpan facility.

Learn how to use CPAN.  perldoc CPAN and/or perldoc perlmodinstall
or look online for how to use it. Usually you configure it once,
and then you do the same thing to install a module every time.

> 
> Is there a way with a browser on CPAN to download a module along with 
> its dependencies without having to chase them down?

CPAN does that for you, so stop trying to use a browser to do anything, 
unless you find something that isn't in CPAN.  Your OS might also have
a package manager, e.g. yum, rpm, etc. If so, maybe that's what you
should be using instead of CPAN.  It depends on how you manage what's
installed on your system.


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

Date: Mon, 18 Oct 2010 22:50:39 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: where to install cpan modules
Message-Id: <f2suo7-f1q.ln1@osiris.mauzo.dyndns.org>


Quoth John Smith <john@example.invalid>:
> Ben Morrow wrote:
> 
> > Yes. You should now have a successful installation of local::lib, and if
> > you try to install something straightforward (like, say, an upgrade of
> > Scalar::Util) it should go into your ~/perl5/lib directory.
> 
> Alright, thx ben, I think I'm doing some damage now:
> 
<snip>
> $ cd Parse-RecDescent-1.965001/
> $ ls
> Build.PL  demo  Makefile.PL  META.yml  t
> Changes   lib   MANIFEST     README    tutorial
> $ perl Makefile.PL

You should generally prefer Build.PL over Makefile.PL if both are
present. This is what CPAN.pm does unless you tell it otherwise.

<snip>
> $ make install
> Installing /home/ron/perl5/lib/perl5/Parse/RecDescent.pm
> Installing /home/ron/perl5/man/man3/Parse::RecDescent.3pm
> Writing 
> /home/ron/perl5/lib/perl5/i486-linux-gnu-thread-multi/auto/Parse/RecDescent/.packlist
> Appending installation info to 
> /home/ron/perl5/lib/perl5/i486-linux-gnu-thread-multi/perllocal.pod
> $
> 
> ...
> 
> $ ls
> RecDescent.pm
> $ pwd
> /home/ron/perl/Parse-RecDescent-1.965001/lib/Parse
> $
> 
> 
> By the looks of it, do I have local::lib configured correctly?

Yes. Note that
/home/ron/perl/Parse-RecDescent-1.965001/lib/Parse/RecDescent.pm is
*not* the installed version of that module. That file was in the
tarball, and the whole Parse-RecDescent-1.965001 directory can now be
deleted. The installed module is in
/home/ron/perl5/lib/perl5/Parse/RecDescent.pm, and that is where perl
will find it.

> >> What more must I do, because it fails 751 out of 752 tests every time?
> > 
> > Given your other post, I presume you mean Inline::Python fails these
> > tests? I can't tell what's going wrong here without seeing the test
> > output from Inline::Python. Since the installation got as far as 'make
> > test', it sounds like you've installed all the right headers, but
> > something else important is going wrong.
> 
> 
> There's simply a fair amount of elbow grease in this task.  This thread 
> really isn't about python at all, but what one must do to have a proper 
> cpan facility.
> 
> Is there a way with a browser on CPAN to download a module along with 
> its dependencies without having to chase them down?

No, that's what the CPAN command-line client is for. You *should* now be
able to run

    cpan -i Inline::Python

and get at least as far as your previous failure, with all the
dependancies installed. You should then be able to run

    ~$ cpan
    cpan[1]> look Inline::Python

and find yourself in an unpacked Inline::Python directory. From here you
can attempt a build by hand and see what goes wrong.

If you want help with that you will need to post the *first* few error
messages from 'make test', and any warnings you get during 'make'. If
you just get a whole lot of test failures with no diagnostics, you can
run an individual test script like this

    perl -Mblib t/whatever.t 2>&1

and see what it's *actually* saying. Any line starting with 'not ok' is
a failure, any line starting with '#' is a diagnostic, and anything ele
probably indicates a real problem :).

Ben



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

Date: Mon, 18 Oct 2010 18:10:05 -0600
From: John Smith <john@example.invalid>
Subject: Re: where to install cpan modules
Message-Id: <rdCdnZeAlKpDfCHRnZ2dnUVZ5oudnZ2d@giganews.com>

Ben Morrow wrote:

> No, that's what the CPAN command-line client is for. You *should* now be
> able to run
> 
>     cpan -i Inline::Python
> 
> and get at least as far as your previous failure, with all the
> dependancies installed. You should then be able to run
> 
>     ~$ cpan
>     cpan[1]> look Inline::Python
> 
> and find yourself in an unpacked Inline::Python directory. From here you
> can attempt a build by hand and see what goes wrong.
> 
> If you want help with that you will need to post the *first* few error
> messages from 'make test', and any warnings you get during 'make'. If
> you just get a whole lot of test failures with no diagnostics, you can
> run an individual test script like this
> 
>     perl -Mblib t/whatever.t 2>&1
> 
> and see what it's *actually* saying. Any line starting with 'not ok' is
> a failure, any line starting with '#' is a diagnostic, and anything ele
> probably indicates a real problem :).

Ok, Ben, I've got local::lib, Inline, YAML, Inline::Python and I think 
this is the last of the dependancies.

To my way of thinking, this would be a bad place to ignore warnings.

$ pwd
/home/ron/perl/Digest-MD5-2.51
$ ls *
Changes   Makefile.PL  MD5.pm  META.yml  rfc1321.txt
Makefile  MANIFEST     MD5.xs  README    typemap

hints:
dec_osf.pl  irix_6.pl  MacOS.pl

t:
align.t  badfile.t  bits.t  clone.t  files.t  md5-aaa.t  utf8.t
$ cat README
The Digest::MD5 module allows you to use the RSA Data Security
Inc. MD5 Message Digest algorithm from within Perl programs.  The
algorithm takes as input a message of arbitrary length and produces as
output a 128-bit "fingerprint" or "message digest" of the input.
MD5 is described in RFC 1321.

You will need perl version 5.8 or better to install this module.

Copyright 1998-2003 Gisle Aas.
Copyright 1995-1996 Neil Winton.
Copyright 1990-1992 RSA Data Security, Inc.

This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
$ perl Makefile.PL
Perl's config says that U32 access must not be aligned.
Writing Makefile for Digest::MD5
$

I'm concerned about the penultimate sentence.  What is U32 access?  Does 
a person with a robust perl installation want to have this "aligned?" 
How do I achieve this?

Again, thx for your comment.  I wish I had more time to spend with this, 
but I gotta be out after that legal tender on such a nice day.
-- 
John Smith


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

Date: Mon, 18 Oct 2010 18:39:54 -0600
From: John Smith <john@example.invalid>
Subject: Re: where to install cpan modules
Message-Id: <grmdnTR594xGdSHRnZ2dnUVZ5j-dnZ2d@giganews.com>

Willem wrote:
> John Smith wrote:
> ) luser-ex-troll wrote:
> )> On Oct 16, 4:16 pm, John Smith <j...@example.invalid> wrote:
> )
> )>> Second, what is the difference between these two?
> )>> # ls -l perl
> )>> total 12
> )>> lrwxrwxrwx  1 root root     6 2009-12-13 18:06 5.10 -> 5.10.0
> )>> drwxr-xr-x 50 root root 12288 2010-10-08 23:11 5.10.0
> )> 
> )> 5.10 is a symbolic link (a shortcut) to 5.10.0
> )> 
> )
> ) Why does 'perl' not appear in the output of the ls command?
> 
> Why should it ?  It's a directory, and you're viewing the contents.
> Perhaps you should find a 'unix for beginners' book or tutorial.

Did you have one in mind, or were you just taking the opportunity to 
proclaim your superior knowledge?

I was thinking I'd pick up 5 titles:

1)  Programmieren in Perl
2)  Learning Perl
3)  A C title to replace H&S V.
4)  James Joyce, _Portrait of an Artist ..._
5)  Another unix title.

$ ls -ald perl*
drwxr-xr-x  3 root root 4096 2009-04-20 07:59 perl
drwxr-xr-x 38 root root 4096 2010-10-06 17:15 perl5
$ pwd
/usr/share
$

Am I correct to think that execution went through the above directory 2 
weeks ago and now goes through the below directory?

What happens on unix when one commands
perl anything
?
-- 
John Smith


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

Date: Tue, 19 Oct 2010 03:26:37 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: where to install cpan modules
Message-Id: <t7cvo7-m9t.ln1@osiris.mauzo.dyndns.org>


Quoth John Smith <john@example.invalid>:
> 
> To my way of thinking, this would be a bad place to ignore warnings.
> 
<snip>
> $ perl Makefile.PL
> Perl's config says that U32 access must not be aligned.
> Writing Makefile for Digest::MD5
> $
> 
> I'm concerned about the penultimate sentence.  What is U32 access?  Does 
> a person with a robust perl installation want to have this "aligned?" 
> How do I achieve this?

That message would be better worded 'Perl's config says that U32 access
does not have to be aligned', and it's not a warning, simply a piece of
information. (In general, if a Makefile.PL succeeds in producing a
Makefile it worked.) 

U32 is the perl name for an unsigned 32bit integer, which is a quantity
used a lot calculating MD5s. Some processors (Sparc and I think PPC in
particular) require any C code manipulating U32s to be sure to keep them
aligned in memory: that is, since a U32 is four bytes long, each U32
must start at an address that is a multiple of four. Some, like the
Intel processors, do not. Digest::MD5 is simply checking how careful it
needs to be in the C part of the code, and telling you what it found
(just in case you care :) ).

Ben



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

Date: Tue, 19 Oct 2010 03:53:07 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: where to install cpan modules
Message-Id: <jpdvo7-m9t.ln1@osiris.mauzo.dyndns.org>


Quoth John Smith <john@example.invalid>:
> Willem wrote:
> > John Smith wrote:
> > ) luser-ex-troll wrote:
> > )> On Oct 16, 4:16 pm, John Smith <j...@example.invalid> wrote:
> > )
> > )>> Second, what is the difference between these two?
> > )>> # ls -l perl
> > )>> total 12
> > )>> lrwxrwxrwx  1 root root     6 2009-12-13 18:06 5.10 -> 5.10.0
> > )>> drwxr-xr-x 50 root root 12288 2010-10-08 23:11 5.10.0
> > )> 
> > )> 5.10 is a symbolic link (a shortcut) to 5.10.0
> > )
> > ) Why does 'perl' not appear in the output of the ls command?
> > 
> > Why should it ?  It's a directory, and you're viewing the contents.
> > Perhaps you should find a 'unix for beginners' book or tutorial.
> 
> Did you have one in mind, or were you just taking the opportunity to 
> proclaim your superior knowledge?

Proclaiming one's superiour knowledge is one of the primary functions of
Usenet. It's not wise to take offence at it. Also, questions about
general Unix usage that do not pertain directly to using Perl are OT
here, and likely to be badly received.

> I was thinking I'd pick up 5 titles:
> 
> 1)  Programmieren in Perl
> 2)  Learning Perl
> 3)  A C title to replace H&S V.

I here that the only correct book to learn C from is K&R. (I must
confess I first learned C from a book called 'Using Microsoft Visual C++
v1.0', but I hope I've forgotten most of it...)

> $ ls -ald perl*
> drwxr-xr-x  3 root root 4096 2009-04-20 07:59 perl
> drwxr-xr-x 38 root root 4096 2010-10-06 17:15 perl5
> $ pwd
> /usr/share
> $
> 
> Am I correct to think that execution went through the above directory 2 
> weeks ago and now goes through the below directory?

No. Perl will (probably) search both directories when looking for a
module. You can see which directories perl searches, and in what order,
with

    perl -le'print for @INC'

> What happens on unix when one commands
> perl anything

How much detail do you want?

In simple terms: the shell tells the kernel to execute 'perl anything';
the kernel starts perl, passing it the command line; perl opens the file
'anything' and reads it; perl compiles the Perl in the file; perl
executes the compiled program. If the program contains a 'use' or
'require' statement, perl will look for the named module or file in each
directory in @INC, in order. 

Usually you would install modules that can be shared between machines in
one directory and modules with compiled C components that cannot in
another, to make it easier to share module directories on a network of
different machines. Usually these directories are called something like

    /usr/local/lib/perl5/site_perl/5.12.2
    /usr/local/lib/perl5/site_perl/5.12.2/i386-freebsd-64int

respectively, but many distribution-provided perls have added extra
entries to @INC for /usr/lib/perl and /usr/share/perl since these fit in
better with the various filesystem-hierarchy standards. Probably what
has happened here is that since you installed some modules using the
CPAN shell they went into the perl5 directory, but it's not clear what
went in there or why from here.

Ben



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

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 3181
***************************************


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