[26720] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8815 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 1 14:05:29 2006

Date: Sun, 1 Jan 2006 11:05:04 -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           Sun, 1 Jan 2006     Volume: 10 Number: 8815

Today's topics:
        any ideas as to why this isn't working? <nospam@home.com>
    Re: any ideas as to why this isn't working? <noreply@gunnar.cc>
    Re: any ideas as to why this isn't working? <nospam@home.com>
    Re: any ideas as to why this isn't working? <jkeen_via_google@yahoo.com>
    Re: any ideas as to why this isn't working? <noreply@gunnar.cc>
    Re: any ideas as to why this isn't working? <matthew.garrish@sympatico.ca>
    Re: any ideas as to why this isn't working? <noreply@gunnar.cc>
    Re: Ordering string of commands in a file (Raghuramaiah Gompa)
        Term::ReadLine::GNU problem <agw@cs.columbia.edu>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 01 Jan 2006 12:19:10 GMT
From: "Nospam" <nospam@home.com>
Subject: any ideas as to why this isn't working?
Message-Id: <2NPtf.14613$r4.4026@newsfe1-gui.ntli.net>

#! Perl\bin\perl -w

use WWW::Search;


open FILE1, "> url1.txt" or die "$!";

my $oSearch = new WWW::Search('Yahoo::UK');

my $sQuery = WWW::Search::escape_query("world cup 2006");

$oSearch->native_query($sQuery);

while ( my $oResult = $oSearch->next_result() ) {
    print "Adding: ", $oResult->url, "\n";
    print FILE1 $oResult->url, "\n";


I am  on activeperl 5.8X




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

Date: Sun, 01 Jan 2006 13:24:30 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: any ideas as to why this isn't working?
Message-Id: <41q03qF1fr5n5U1@individual.net>

Nospam wrote:
> Subject: any ideas as to why this isn't working?

<code snipped>

I have no idea, and since you didn't explain in which way it "isn't 
working", nor am I inclined to help you figure it out.

Please make it easy to help you by studying and following the posting 
guidelines for this group: 
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sun, 01 Jan 2006 12:57:39 GMT
From: "Nospam" <nospam@home.com>
Subject: Re: any ideas as to why this isn't working?
Message-Id: <7lQtf.9663$W4.1312@newsfe4-gui.ntli.net>

My apologies the program is meant to search yahoo, and print the results to
a text file.  It compiles ok and generates the text file but the text file
is empty, it is using the www::search module


"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:41q03qF1fr5n5U1@individual.net...
> Nospam wrote:
> > Subject: any ideas as to why this isn't working?
>
> <code snipped>
>
> I have no idea, and since you didn't explain in which way it "isn't
> working", nor am I inclined to help you figure it out.
>
> Please make it easy to help you by studying and following the posting
> guidelines for this group:
> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
>
> -- 
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl




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

Date: Sun, 01 Jan 2006 15:37:55 GMT
From: James E Keenan <jkeen_via_google@yahoo.com>
Subject: Re: any ideas as to why this isn't working?
Message-Id: <43B7F763.6010805@yahoo.com>

Nospam wrote:

> #! Perl\bin\perl -w
> 
> use WWW::Search;
> 
> 
> open FILE1, "> url1.txt" or die "$!";
> 
> my $oSearch = new WWW::Search('Yahoo::UK');
> 
> my $sQuery = WWW::Search::escape_query("world cup 2006");
> 
> $oSearch->native_query($sQuery);
> 
> while ( my $oResult = $oSearch->next_result() ) {
>     print "Adding: ", $oResult->url, "\n";
>     print FILE1 $oResult->url, "\n";
> 
> 
> I am  on activeperl 5.8X
> 
> 
As Gunnar has already indicated, you need to do more than simply ask 
"why isn't this working" when posting to this list.  Among other things, 
you need to check the syntax of the code you post:  your code lacks a 
closing curly bracket on the 'while' loop and so won't compile as written.

More to the point, you should at least post the error message you got 
when it "didn't work."  After installing WWW::Search (a somewhat tedious 
process, as it sits on a mountain of prerequisites), I got this error:

unknown search engine backend Yahoo::UK (Can't locate 
WWW/Search/Yahoo/UK.pm in @INC (@INC contains: 
/usr/local/lib/perl5/site_perl/5.8.7/darwin-2level 
/usr/local/lib/perl5/site_perl/5.8.7 
/usr/local/lib/perl5/site_perl/5.8.4/darwin-2level 
/usr/local/lib/perl5/site_perl/5.8.4 /usr/local/lib/perl5/site_perl 
/usr/local/lib/perl5/5.8.7/darwin-2level /usr/local/lib/perl5/5.8.7 
/usr/local/lib/perl5/site_perl/5.8.7/darwin-2level 
/usr/local/lib/perl5/site_perl/5.8.7 
/usr/local/lib/perl5/site_perl/5.8.4/darwin-2level 
/usr/local/lib/perl5/site_perl/5.8.4 /usr/local/lib/perl5/site_perl .) 
at (eval 9) line 2.
BEGIN failed--compilation aborted at (eval 9) line 2.
) at search.pl line 11

shell returned 2

I checked the MANIFEST for WWW::Search and found that 
WWW::Search::Yahoo::UK was not included in the distribution.  Checking 
the author's CPAN home page, I was initially surprised to find out that 
this package was contained in a *separate* CPAN distribution, 
WWW::Search::Yahoo.

I tried to install that distribution, but its test suite failed for me. 
  Apparently because of its need to send test pages, 'make test' ran for 
47 minutes!  It then failed as follows:

Failed Test    Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/bug1.t          1   256     7    1  14.29%  6
t/japan-news.t    1   256    20    1   5.00%  18
  (93 subtests UNEXPECTEDLY SUCCEEDED).
Failed 2/10 test scripts, 80.00% okay. 2/270 subtests failed, 99.26% okay.
make: *** [test_dynamic] Error 255
   /usr/bin/make test -- NOT OK
Running make install
   make test had returned bad status, won't install without force

Frankly, the only distribution whose code I would tolerate having a 
47-minute test run is perl itself.  So I leave it to you to decide 
whether it's worthwhile trying to get WWW::Search to work.

Jim Keenan


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

Date: Sun, 01 Jan 2006 18:08:34 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: any ideas as to why this isn't working?
Message-Id: <41qgjjF1fb9q2U1@individual.net>

[ Please do not top post - see the posting guidelines. Also, for next 
time, please choose an appropriate subject line - see the posting 
guidelines about that, too. ]

Nospam wrote:
> My apologies the program is meant to search yahoo, and print the results to
> a text file.  It compiles ok and generates the text file but the text file
> is empty, it is using the www::search module

<snip>

> I am  on activeperl 5.8X

Are all the dependencies really available at ActiveState? Since you say 
that the script compiles, I suppose you have been able to install them 
somehow.

After having failed to find all the required modules at ActiveState, I 
installed WWW::Search and WWW::Search::Yahoo (successfully, unlike for 
Jim) on my Linux box. For me, after having added the missing right 
curly, the script did produce output. However, it took an inexcusably 
long time - after half an hour or so I interrupted the process...

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sun, 1 Jan 2006 12:14:22 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: any ideas as to why this isn't working?
Message-Id: <K5Utf.67$H37.16180@news20.bellglobal.com>


"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message 
news:41qgjjF1fb9q2U1@individual.net...
>[ Please do not top post - see the posting guidelines. Also, for next time, 
>please choose an appropriate subject line - see the posting guidelines 
>about that, too. ]
>
> Nospam wrote:
>> My apologies the program is meant to search yahoo, and print the results 
>> to
>> a text file.  It compiles ok and generates the text file but the text 
>> file
>> is empty, it is using the www::search module
>
> <snip>
>
>> I am  on activeperl 5.8X
>
> Are all the dependencies really available at ActiveState?
>

Add the University of Winnipeg site to your list of repositories. It's 
always a better source for modules than the default ActiveState 
repositories. (I had no problem downloading and installing all the 
requirements.)

Matt 




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

Date: Sun, 01 Jan 2006 19:38:55 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: any ideas as to why this isn't working?
Message-Id: <41qlsiF1g76paU1@individual.net>

Matt Garrish wrote:
> Gunnar Hjalmarsson wrote:
>>Are all the dependencies really available at ActiveState?
> 
> Add the University of Winnipeg site to your list of repositories. It's 
> always a better source for modules than the default ActiveState 
> repositories.

Thanks for the tip, but in that case I'm afraid I failed in finding the 
right place. At http://theoryx5.uwinnipeg.ca/ppms/ I only see a small 
subset of the packages available at ActiveState. Maybe I'm missing 
something...

> (I had no problem downloading and installing all the requirements.)

One package I remember I couldn't find is HTML-Tree.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sun, 1 Jan 2006 04:54:26 +0000 (UTC)
From: rgompa@steel.ucs.indiana.edu (Raghuramaiah Gompa)
Subject: Re: Ordering string of commands in a file
Message-Id: <dp7na2$8ri$1@rainier.uits.indiana.edu>

In article <43b506a6$0$898$db0fefd9@news.zen.co.uk>,
Dave Weaver  <zen13097@zen.co.uk> wrote:
>
>Interesting (to me) sidenote: I noticed that when I
>added the lc()
>calls to the sort, the warnings about use of undefined
>variables
>(because Title isn't defined for some elements) went
>away. Shouldn't
>lc() warn if it's passed undef?
>
>
>#!/usr/bin/perl
>use warnings;
>use strict;
>
>my %items;
>while(<DATA>) {
>    $items{$2}{$1} = $3 if /^(\w+?)(\d+)=(.+)/;
>}
>
>my $n = 1;
>for my $idx (
>     sort {
>	    lc $items{$a}{Title} cmp lc $items{$b}{Title}
>	} keys %items)
>{
>    print map {
>		"$_$n=$items{$idx}{$_}\n";
>	    } keys %{$items{$idx}};
>    print "----\n";
>    ++$n;
>}
>
>__DATA__
>Title1=B2a


Thank you all very much.  I was able to get the results I 
wanted.  (I posted  code and Xicheng pointed out my 
mistake in ignoring the necessary \ before [ and ]).  As 
you noticed, group of commands with no title was 
processed with no title.  I do not know how to fix (this 
minor) problem.  I am very happy with the present code.  
But could it be improved?  Thank you once again. .. Raghu



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

Date: 01 Jan 2006 11:57:09 -0500
From: Art Werschulz <agw@cs.columbia.edu>
Subject: Term::ReadLine::GNU problem
Message-Id: <ylafyo7ga3e.fsf@sobolev.cs.columbia.edu>

Hi.

This problem has been plaguing me for a while now.

We're running Fedora Core 4 on a bunch of i686 boxes.  On exactly one of
these, Term::ReadLine::GNU is broken:

  $ perl -MCPAN -e shell
  Cannot do `initialize' in Term::ReadLine::Gnu at
  /usr/lib/perl5/5.8.6/CPAN.pm line 105 
 
We're running version 5.8.6 of Perl, found in the RPM perl-5.8.6-22.

Does anybody know why this is happening, and how to fix it?  Note that I
can't use the CPAN shell to fix anything (i.e., to reinstall the module).

Thanks.

-- 
Art Werschulz (8-{)}   "Metaphors be with you."  -- bumper sticker
GCS/M (GAT): d? -p+ c++ l u+(-) e--- m* s n+ h f g+ w+ t++ r- y? 
Internet: agw STRUDEL cs.columbia.edu
ATTnet:   Columbia U. (212) 939-7060, Fordham U. (212) 636-6325


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

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


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