[28862] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 106 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 9 22:16:04 2007

Date: Fri, 9 Feb 2007 19:15:30 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 9 Feb 2007     Volume: 11 Number: 106

Today's topics:
        How to get table from some html <ldolan@bigpond.net.au>
    Re: How to get table from some html <nobull67@gmail.com>
    Re: How to get table from some html <bik.mido@tiscalinet.it>
    Re: How to get table from some html <tadmc@augustmail.com>
    Re: How to get table from some html <ldolan@bigpond.net.au>
    Re: How to get table from some html <greg.ferguson@icrossing.com>
    Re: How to get table from some html <greg.ferguson@icrossing.com>
    Re: How to get table from some html <ldolan@bigpond.net.au>
    Re: How to get table from some html <ldolan@bigpond.net.au>
    Re: How to get table from some html <ldolan@bigpond.net.au>
    Re: How to get table from some html <greg.ferguson@icrossing.com>
    Re: How to get table from some html <bik.mido@tiscalinet.it>
    Re: How to get table from some html <ldolan@bigpond.net.au>
    Re: How to get table from some html <ldolan@bigpond.net.au>
    Re: How to get table from some html <jgibson@mail.arc.nasa.gov>
        how to install/use MP3::Tag in Windows environment? <Ozmodiar@springBOBBITTlake.net>
    Re: how to install/use MP3::Tag in Windows environment? <john@castleamber.com>
    Re: how to install/use MP3::Tag in Windows environment? <sisyphus1@nomail.afraid.com>
    Re: how to install/use MP3::Tag in Windows environment? <anonymous@127.0.0.1>
    Re: how to install/use MP3::Tag in Windows environment? <Ozmodiar@springBOBBITTlake.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 05 Feb 2007 05:48:34 GMT
From: dysgraphia <ldolan@bigpond.net.au>
Subject: How to get table from some html
Message-Id: <Syzxh.3011$sd2.1498@news-server.bigpond.net.au>

I am new to Perl and also to the Mechanize module.
So far I have obtained a table, table[4] below, with
useful text I would like to put into a tabular format like:

List Position	Patient Name	Weight Height	Clinic	Doctor

but I am unsure as to how to proceed.
I will want to send the data to an Access db later so hopefully this 
format will be amenable to this.

Any suggestions or assistance appreciated!

Below is my code followed by the relevant portion of html.
In practice the daily list may vary in length up to about 30 patients.

     #!/usr/bin/perl
      use strict;
      use warnings;
      use WWW::Mechanize;
      use HTTP::Cookies;

      my $mech = WWW::Mechanize->new(
      agent => 'Mozilla/4.0',
      cookie_jar => {}
      );

      $url = 'http://www.somemedicaldata'; # not a real page

      $mech->get($url);
      unless ($mech->success) {
      die "Cannot get login page $url: ",
      $mech->response->status_line;
      }

      my $content = $mech->content();

      print "Content is: \"$content\"\n";

     # get table data
      my @table;
      my $tmp = $content;
      my $tablecount=0;

      while (my $result=$tmp=~/(?=\x3CTABLE).*?(?=\x3C\/TABLE\x3E)/igsm)
     {
       $tablecount++;
       $table[$tablecount]= $&;
     }

      print "Number of tables: \"$tablecount\"\n";

     # table4 has the useful data
      my ($dd1,$dd2) = split('<tr class="texttab" ',$table[4]);
      $table[4] = $dd2;

     # Save table4 raw to see what is collected
      open(FH, ">table4raw.txt");
      print FH $table[4];
      close(FH);
# end of code

This is the table4 html:

<table width="741" border="0" cellpadding="2" cellspacing="1"> 
           <tr bgcolor="#CC9966"

class="texttab">                       <td><div align="center"><font 
color="#663300"><strong>List
                   Position</strong></font></div></td> 
     <td><div align="center"><font

color="#663300"><strong>Patient Name</strong></font></div></td> 
              <td><div
align="center"><font 
color="#663300"><strong>Weight</strong></font></div></td> 

<td><div align="center"><font 
color="#663300"><strong>Height</strong></font></div></td>
    <td><div align="center"><font 
color="#663300"><strong>Clinic</strong></font></div></td>
       <td><div align="center"><font 
color="#663300"><strong>Doctor</strong></font></div></td>
        </tr>                                            <tr 
class="texttab"   >                       <td
align="center">1</td>                      <td  align="center">A Smith 
              </td>
       <td align="center">78.0</td>                      <td 
align="center">185</td>
<td align="center">AM</td>                       <td align="center">F 
Magoo</td>                    </tr>	
	                            <tr class="texttab" bgcolor=#FFFFFF  > 
                   <td
align="center">2</td>                      <td  align="center">B 
Smith</td>                      <td
align="center">56.0</td>                      <td 
align="center">165</td>                      <td
align="center">PM</td>                       <td align="center">L 
Magee</td>                    </tr>		
                             <tr class="texttab"   > 
    <td align="center">3</td>
                <td  align="center">C Smith            </td> 
           <td
align="center">66.0</td>                      <td 
align="center">171</td>                      <td
align="center">RM</td>                        <td align="center">R 
Magaa</td>                    </tr>		



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

Date: 5 Feb 2007 00:47:09 -0800
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: How to get table from some html
Message-Id: <1170665229.465359.140280@j27g2000cwj.googlegroups.com>

On Feb 5, 5:48 am, dysgraphia <ldo...@bigpond.net.au> wrote:
> I am new to Perl and also to the Mechanize module.
> So far I have obtained a table, table[4] below, with
> useful text I would like to put into a tabular format like:
>
> List Position   Patient Name    Weight Height   Clinic  Doctor
>
> but I am unsure as to how to proceed.
> I will want to send the data to an Access db later so hopefully this
> format will be amenable to this.
>
> Any suggestions or assistance appreciated!

I suggest you parse HTML with a HTML parser. Looking for a module with
"HTML" and "Parser" in its name would be a good start.  Since you are
specifically looking for parsing tables you may want to see if there's
on with "Table" in its name too.



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

Date: Mon, 05 Feb 2007 11:05:51 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How to get table from some html
Message-Id: <g60es25mfkt66hnkn5ts0saneanqq4em6o@4ax.com>

On Mon, 05 Feb 2007 05:48:34 GMT, dysgraphia <ldolan@bigpond.net.au>
wrote:

>I am new to Perl and also to the Mechanize module.
>So far I have obtained a table, table[4] below, with
>useful text I would like to put into a tabular format like:

You will have to parse it. So use some HTML parsing module. One such
module that gets mentioned frequently here is HTML::TokeParser. There
are others though, and you may want to check some of them to find the
best one for you.

>List Position	Patient Name	Weight Height	Clinic	Doctor

Do you mean in pure text? Then use some pure text table formatting
module, like Text::Table or Perl6::Form.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Mon, 5 Feb 2007 06:07:28 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to get table from some html
Message-Id: <slrnese7g0.9l1.tadmc@tadmc30.august.net>

dysgraphia <ldolan@bigpond.net.au> wrote:

> So far I have obtained a table, table[4] below, with
> useful text I would like to put into a tabular format like:


> Any suggestions or assistance appreciated!


   use HTML::TableExtract;


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


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

Date: Mon, 05 Feb 2007 12:40:25 GMT
From: dysgraphia <ldolan@bigpond.net.au>
Subject: Re: How to get table from some html
Message-Id: <ZAFxh.3178$sd2.2900@news-server.bigpond.net.au>

Brian McCauley wrote:
> 
> I suggest you parse HTML with a HTML parser. Looking for a module with
> "HTML" and "Parser" in its name would be a good start.  Since you are
> specifically looking for parsing tables you may want to see if there's
> on with "Table" in its name too.
> 

Thanks Brian, I will look through the modules based on your suggestions.
Your help is appreciated!...cheers, Peter


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

Date: 5 Feb 2007 08:07:05 -0800
From: "gf" <greg.ferguson@icrossing.com>
Subject: Re: How to get table from some html
Message-Id: <1170691625.605627.314220@v45g2000cwv.googlegroups.com>

I am partial to HTML::TreeBuilder for my parsing.

After a tree has been built from the HTML you use the methods in
HTML::Element to traverse the tree. look_down() is very powerful and
is my go-to routine.

You can easily find the location of your target table in the tree with
look_down(), then loop through the rows and cells, extracting the
contents of the cells using as_text().

Use an array to mimic the table structure. This is untested and
doesn't check for all errors, but I'd loop through the table with
something like:

use warnings;
use strict;
use LWP::Simple;
use HTML::TreeBuilder;

my $html = get('the URL you want to retrieve') or die "Can't get URL.
\n";
my $tree = HTML::TreeBuilder->new_from_content($html);

my @table_data;
foreach my $table ( $tree->look_down( '_tag' => 'table' ) )
{
    foreach my $tr ( $table->look_down( '_tag' => 'tr' ) )
    {
        my @row_data;
        foreach my $td ( $table->look_down( '_tag' => 'td' ) )
        {
            push @row_data, $td->as_text();
        }
        push @table_data, [@row_data];
    }
}

foreach my $r (@table_data)
{
    print join( "\t", @$r ), "\n";
}

You might have to flesh out the look_down() calls to narrow your table
selections, but for a single table embedded in a page it should
suffice.



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

Date: 5 Feb 2007 08:13:05 -0800
From: "gf" <greg.ferguson@icrossing.com>
Subject: Re: How to get table from some html
Message-Id: <1170691984.834773.39020@s48g2000cws.googlegroups.com>

>         foreach my $td ( $table->look_down( '_tag' => 'td' ) )
>         {
>             push @row_data, $td->as_text();
>         }

OOPS, that should be

          foreach my $td ( $tr->look_down( '_tag' => 'td' ) )
          {
              push @row_data, $td->as_text();
          }



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

Date: Tue, 06 Feb 2007 13:45:55 GMT
From: dysgraphia <ldolan@bigpond.net.au>
Subject: Re: How to get table from some html
Message-Id: <nE%xh.3697$sd2.504@news-server.bigpond.net.au>

gf wrote:
> I am partial to HTML::TreeBuilder for my parsing.
> 
> After a tree has been built from the HTML you use the methods in
> HTML::Element to traverse the tree. look_down() is very powerful and
> is my go-to routine.

Thanks gf!
I have had a look at your suggestion of HTML::TreeBuilder and can see
it is most likely worth me learning. I have installed the module and 
given it some trial runs on example code and your code. Comments of mine 
below.

> You can easily find the location of your target table in the tree with
> look_down(), then loop through the rows and cells, extracting the
> contents of the cells using as_text().
> 
> Use an array to mimic the table structure. This is untested and
> doesn't check for all errors, but I'd loop through the table with
> something like:
> 
> use warnings;
> use strict;
> use LWP::Simple;
> use HTML::TreeBuilder;
> 
> my $html = get('the URL you want to retrieve') or die "Can't get URL.
> \n";
> my $tree = HTML::TreeBuilder->new_from_content($html);
> 
> my @table_data;
> foreach my $table ( $tree->look_down( '_tag' => 'table' ) )
> {
>     foreach my $tr ( $table->look_down( '_tag' => 'tr' ) )
>     {
>         my @row_data;
>         foreach my $td ( $table->look_down( '_tag' => 'td' ) )
>         {
>             push @row_data, $td->as_text();
>         }
>         push @table_data, [@row_data];
>     }
> }
> 
> foreach my $r (@table_data)
> {
>     print join( "\t", @$r ), "\n";
> }
> 
> You might have to flesh out the look_down() calls to narrow your table
> selections, but for a single table embedded in a page it should
> suffice.
> 

I tried your code and it ran perfectly. My project has a 
table-within-tables structure. The HTML has a lot of dross that I want 
to  avoid.
I did a bit of digging and found some articles and links of Sean M. 
Burke eg 
http://aspn.activestate.com/ASPN/docs/ActivePerl-5.6/site/lib/HTML/Tree/Scanning.html
and tried to use his suggestion for rejecting certain tables.
He wrote:

$h1 = $tree->look_down('_tag', 'h1');
returns the first element at-or-under $tree whose "_tag" attribute has 
the value "h1".......
you could exclude ``h1'' elements that contain the word ``visit'' under 
them:

   my $real_h1 = $tree->look_down(
     '_tag', 'h1',
     sub {
       $_[0]->as_text !~ m/\bvisit/i
     }
   );

I adapted and tried this code but could not get the table to be excluded.
In my case the HTML has a large (approx 700 line) table I don't want. 
This table has tags like <option>....</option> to identify it but 
putting this in the above code did not work.
Any comments or suggestions of yours are welcome...thanks again for your 
help so far....cheers, Peter





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

Date: Tue, 06 Feb 2007 13:47:07 GMT
From: dysgraphia <ldolan@bigpond.net.au>
Subject: Re: How to get table from some html
Message-Id: <vF%xh.3698$sd2.2338@news-server.bigpond.net.au>

Tad McClellan wrote:
>>Any suggestions or assistance appreciated!
> 
>    use HTML::TableExtract;
> 
Thanks Tad I will check this module out.


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

Date: Tue, 06 Feb 2007 14:00:35 GMT
From: dysgraphia <ldolan@bigpond.net.au>
Subject: Re: How to get table from some html
Message-Id: <7S%xh.3713$sd2.3075@news-server.bigpond.net.au>

Michele Dondi wrote:
> You will have to parse it. So use some HTML parsing module. One such
> module that gets mentioned frequently here is HTML::TokeParser. There
> are others though, and you may want to check some of them to find the
> best one for you.

Thanks for your input Michele, I will have a look at TokeParser.
> 
>>List Position	Patient Name	Weight Height	Clinic	Doctor
> 
> Do you mean in pure text? Then use some pure text table formatting
> module, like Text::Table or Perl6::Form.
> 
> Michele

I am using Perl 5.8 from ActiveState. My initial requirement was to see 
the text in either a text editor or spreadsheet format. This was just to 
ensure I am getting the data correctly as I will have a need to download 
many files on a weekly basis. When the parsing looks OK I will then send 
it to a db.

Again, thanks for your help Michele...appreciated...cheers, Peter


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

Date: 6 Feb 2007 09:44:11 -0800
From: "gf" <greg.ferguson@icrossing.com>
Subject: Re: How to get table from some html
Message-Id: <1170783851.289629.34270@v45g2000cwv.googlegroups.com>

On Feb 6, 6:45 am, dysgraphia <ldo...@bigpond.net.au> wrote:

> I tried your code and it ran perfectly.

That occasionally happens. :-)

[...]

>    my $real_h1 = $tree->look_down(
>      '_tag', 'h1',
>      sub {
>        $_[0]->as_text !~ m/\bvisit/i
>      }
>    );
>

You're on the right track, just keep following it. Because you're so
close to the answer I'm just going to say "keep going".

sub {} calls in look_down() are your friends - they're really
powerful. Sometimes I've needed to use multiple embedded subs to chain
together the results of the look_down(). In effect this causes the
test to drill down into the HTML deeper and deeper to determine if the
child nodes contain what you want.

And, remember that the parameters to a look_down() constitute an OR
condition, and the embedded sub {} conditions act as ANDs.

Also, the use of qr// regexp patterns can be powerful OR tests.

Stylistically I like to use the '=>' operator to separate my argument
pairs in the look_down() parameter list rather than plain commas.

OK, I lied. Here's an (untested) example of drilling in farther.

[...]
foreach my $_tr (
    $tree->look_down(
        '_tag'  => 'tr',
        'class' => qr/row[123]/,
        sub {
            $_[0]->look_down(
                '_tag' => 'td',
                'id'   => qr/^datafield_(?:name|date|age)/,
                sub {
                    $_[0]->as_text() =~ /\bfoo\b/;
                }
            );
        }
    )
  )
{
    ;    # ...do something revolutionary here
}



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

Date: Tue, 06 Feb 2007 20:52:33 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How to get table from some html
Message-Id: <ovmhs2dqmm1ddhqk3vkuf789b8uneh4opn@4ax.com>

On Tue, 06 Feb 2007 14:00:35 GMT, dysgraphia <ldolan@bigpond.net.au>
wrote:

>> Do you mean in pure text? Then use some pure text table formatting
>> module, like Text::Table or Perl6::Form.
>
>I am using Perl 5.8 from ActiveState. My initial requirement was to see 
>the text in either a text editor or spreadsheet format. This was just to 
>ensure I am getting the data correctly as I will have a need to download 
>many files on a weekly basis. When the parsing looks OK I will then send 
>it to a db.

If you want to export to a spreadsheet probably the best way would be
to write your data to CSV, in which case Text::CSV_XS comes as a
precious tool.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Wed, 07 Feb 2007 04:50:17 GMT
From: dysgraphia <ldolan@bigpond.net.au>
Subject: Re: How to get table from some html
Message-Id: <dUcyh.3959$sd2.533@news-server.bigpond.net.au>

Michele Dondi wrote:
> If you want to export to a spreadsheet probably the best way would be
> to write your data to CSV, in which case Text::CSV_XS comes as a
> precious tool.
> 
> 
> Michele

Thanks again Michele! I will install the Text::CSV_XS module...cheers, Peter


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

Date: Fri, 09 Feb 2007 18:41:11 GMT
From: dysgraphia <ldolan@bigpond.net.au>
Subject: Re: How to get table from some html
Message-Id: <bf3zh.5290$sd2.2957@news-server.bigpond.net.au>

gf wrote:
> You're on the right track, just keep following it. Because you're so
> close to the answer I'm just going to say "keep going".
> 
> sub {} calls in look_down() are your friends - they're really
> powerful. Sometimes I've needed to use multiple embedded subs to chain
> together the results of the look_down(). In effect this causes the
> test to drill down into the HTML deeper and deeper to determine if the
> child nodes contain what you want.
> 
> And, remember that the parameters to a look_down() constitute an OR
> condition, and the embedded sub {} conditions act as ANDs.
> 
> Also, the use of qr// regexp patterns can be powerful OR tests.
> 
> Stylistically I like to use the '=>' operator to separate my argument
> pairs in the look_down() parameter list rather than plain commas.
> 
> OK, I lied. Here's an (untested) example of drilling in farther.
> 
> [...]
> foreach my $_tr (
>     $tree->look_down(
>         '_tag'  => 'tr',
>         'class' => qr/row[123]/,
>         sub {
>             $_[0]->look_down(
>                 '_tag' => 'td',
>                 'id'   => qr/^datafield_(?:name|date|age)/,
>                 sub {
>                     $_[0]->as_text() =~ /\bfoo\b/;
>                 }
>             );
>         }
>     )
>   )
> {
>     ;    # ...do something revolutionary here
> }
> 

Thanks gf!...A carton of cyber-beer is on its way!!
After wrestling with this code of yours I now am getting closer to the 
finishing line. In order to better see what I am getting I
write to an Excel sheet for now....a hangover from the time when I 
generated this data using web queries and VBA, a method that fell over 
recently due to changes in the web page.
I am still not sure I understand how your code does its magic yet but 
the output to the spreadsheet is very close to what I want. All the text 
from both tables is coming through OK but I would like a different final 
layout.
Basically the first table has general data about a group of 
patients/tests whilst the second table has specific data about each 
patient within the group. At present my output is coming out as:
Table_1 field headings (one row)
Table_1 data (one row)
Table_2 field headings (one row)
Table_2 data (many rows)

My objective is a table format like:
Table_1 field headings	Table_2 field headings
Table_1 data		Table_2 data row 1
Table_1 data		Table_2 data row 2
Table_1 data		Table_2 data row 3
	etc			etc

That is, the Table_1 data is repeated for each row of Table_2 data.
This final output will be sent to a relational db.
I have been looking at building this table from array elements of 
Table_1 and Table_2 but so far without success.
Any pointers?
Cheers, Peter


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

Date: Fri, 09 Feb 2007 12:16:32 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: How to get table from some html
Message-Id: <090220071216324856%jgibson@mail.arc.nasa.gov>

In article <bf3zh.5290$sd2.2957@news-server.bigpond.net.au>, dysgraphia
<ldolan@bigpond.net.au> wrote:

> gf wrote:
> > You're on the right track, just keep following it. Because you're so
> > close to the answer I'm just going to say "keep going".

[suggested approach snipped]

> Thanks gf!...A carton of cyber-beer is on its way!!
> After wrestling with this code of yours I now am getting closer to the 
> finishing line. In order to better see what I am getting I
> write to an Excel sheet for now....a hangover from the time when I 
> generated this data using web queries and VBA, a method that fell over 
> recently due to changes in the web page.
> I am still not sure I understand how your code does its magic yet but 
> the output to the spreadsheet is very close to what I want. All the text 
> from both tables is coming through OK but I would like a different final 
> layout.
> Basically the first table has general data about a group of 
> patients/tests whilst the second table has specific data about each 
> patient within the group. At present my output is coming out as:
> Table_1 field headings (one row)
> Table_1 data (one row)
> Table_2 field headings (one row)
> Table_2 data (many rows)
> 
> My objective is a table format like:
> Table_1 field headings  Table_2 field headings
> Table_1 data    Table_2 data row 1
> Table_1 data    Table_2 data row 2
> Table_1 data    Table_2 data row 3
>   etc     etc
> 
> That is, the Table_1 data is repeated for each row of Table_2 data.
> This final output will be sent to a relational db.
> I have been looking at building this table from array elements of 
> Table_1 and Table_2 but so far without success.
> Any pointers?
> Cheers, Peter

Yes. Show us some code. How can anybody help you without knowing what
you have done so far. 

I suggest you divide your problem into two parts:

1. Parsing the web page, extracting the data, and storing every piece
of data you need into internal Perl structures (arrays, hashes,
arrays-of-hashes, etc.)

2. Transforming the extracted data into the form you need.

Let us know with which of these parts are you having trouble.

Use Data::Dumper to confirm that part 1 is working the way you want. If
you want help with part 2, write a test program that starts with simple
versions of your data structures generated from assignment statements
and post the entire program. That way, anybody can run your program for
themselves and suggest fixes or improvements.

Good luck.

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


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

Date: Tue, 06 Feb 2007 23:57:53 GMT
From: "Ozmodiar" <Ozmodiar@springBOBBITTlake.net>
Subject: how to install/use MP3::Tag in Windows environment?
Message-Id: <5C8yh.18442$VY5.17820@trnddc08>

ahoy:

i am working on a project in Windows XP where i must read MP3 file ID3v2 
information (particularly long (>30 char) Artist and Title)

(This is perl, v5.8.0 built for MSWin32-x86-multi-thread)


i was able to install and use MP3::Info, by downloading the source to 
mp3-info.ppm and doing
C:\Perl> ppm install mp3-info

i could access this from my perl code and it seemed to work as advertised, 
but this module does not let me get at the long artist/title information.


it looks like the module i really want is MP3::Tag
http://search.cpan.org/~ilyaz/MP3-Tag-0.9709/Tag.pm

i'm not a windows/perl heavy and don't understand how to go from the 
downloadable
modules/MP3-Tag-0.9709.tar.gz
file, to getting this installed from DOS command prompt (C:\Perl>)

i used Stuffit to extract the contents into my Perl dir
then did
C:\Perl> perl Makefile.pl
(got back:
Writing Makefile for MP3::Tag
Writing Makefile for MP3::Tag
)

then i did
C:\Perl> ppm install Tag
(got back:
Error: 'Tag' not found. Please 'search' for it first.
)

Tag.pm is in my working dir, as are folders: /examples, /Tag, /tk-tag
don't know why "not found" (or what i'm really doing).

can anyone baby-talk me through this?


thanks very much,
-rr




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

Date: 7 Feb 2007 00:23:30 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: how to install/use MP3::Tag in Windows environment?
Message-Id: <Xns98CFBB16F675Bcastleamber@130.133.1.4>

"Ozmodiar" <Ozmodiar@springBOBBITTlake.net> wrote:


> i used Stuffit to extract the contents into my Perl dir
> then did
> C:\Perl> perl Makefile.pl
> (got back:
> Writing Makefile for MP3::Tag
> Writing Makefile for MP3::Tag
> )
> 
> then i did
> C:\Perl> ppm install Tag
> (got back:
> Error: 'Tag' not found. Please 'search' for it first.
> )

Yup, wrong.

See http://johnbokma.com/perl/make-for-windows.html
for baby steps :-)


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

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


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

Date: Wed, 7 Feb 2007 14:26:09 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.com>
Subject: Re: how to install/use MP3::Tag in Windows environment?
Message-Id: <45c94750$0$5744$afc38c87@news.optusnet.com.au>


"Ozmodiar" <Ozmodiar@springBOBBITTlake.net> wrote in message 
news:5C8yh.18442$VY5.17820@trnddc08...
 .
 .
> then i did
> C:\Perl> ppm install Tag
> (got back:
> Error: 'Tag' not found. Please 'search' for it first.
> )

All you need do is (while connected to the internet) run:
ppm install MP3-Tag

For ppm installations there's no need to download the CPAN source (or 
anything else ftm).

Cheers,
Rob




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

Date: Tue, 6 Feb 2007 23:35:37 -0500
From: "Jim Carlock" <anonymous@127.0.0.1>
Subject: Re: how to install/use MP3::Tag in Windows environment?
Message-Id: <45c95728$0$8961$4c368faf@roadrunner.com>

"John Bokma" <john@castleamber.com> wrote:
: See http://johnbokma.com/perl/make-for-windows.html
: for baby steps :-)

I noticed a link on that page there. It uses the long version of the kbid
link.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q132084

Pretty much ALL kbid (scid) links at microsoft can be compressed
and made workable. Drop the Q before the number and delete all
up to the 'question mark' (?). Then delete the page name itself, they
typically are named default.asp or default.aspx these days. The end
result, the links get quite a bit shorter and the same content gets
delivered to the end user. This makes your own pages smaller and
faster. The link presented at the website (as listed above) can be
shortened to the following...

http://support.microsoft.com/?kbid=132084

It's been that way since 1999 (and possibly earlier).

Don't know if such things interest anyone, but if they set up a lot
of links to Microsoft...

-- 
Jim Carlock
Post replies to the group.




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

Date: Wed, 07 Feb 2007 04:57:42 GMT
From: "Ozmodiar" <Ozmodiar@springBOBBITTlake.net>
Subject: Re: how to install/use MP3::Tag in Windows environment?
Message-Id: <a%cyh.65094$WI6.30569@trnddc04>


"Sisyphus" <sisyphus1@nomail.afraid.com> wrote in message 
news:45c94750$0$5744$afc38c87@news.optusnet.com.au...
>
> "Ozmodiar" <Ozmodiar@springBOBBITTlake.net> wrote in message 
> news:5C8yh.18442$VY5.17820@trnddc08...
> .
> .
>> then i did
>> C:\Perl> ppm install Tag
>> (got back:
>> Error: 'Tag' not found. Please 'search' for it first.
>> )
>
> All you need do is (while connected to the internet) run:
> ppm install MP3-Tag
>
> For ppm installations there's no need to download the CPAN source (or 
> anything else ftm).
>
> Cheers,
> Rob
>

that was sweet!
got it all working in no time after that.

thank you *very* much!
-rr





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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

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


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


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