[17902] in Perl-Users-Digest
Perl-Users Digest, Issue: 62 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 15 09:05:44 2001
Date: Mon, 15 Jan 2001 06:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979567510-v10-i62@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 15 Jan 2001 Volume: 10 Number: 62
Today's topics:
Re: Apply XPath expression to XML::DOM <matt@sergeant.org>
Re: Can't associate .PL files in Win98 <johnroth@ameritech.net>
error code <l.hagen@HumanInference.com>
Re: error code (Martien Verbruggen)
Re: Help me append (Colin Watson)
Re: Help me append <jbuff1856@my-deja.com>
I/O buffers <Erik.Coopman@student.kuleuven.ac.be>
Re: I/O buffers (Tad McClellan)
LWP and RAS (with Win32::RASE) + ethernet connection snakedjip@yahoo.com
Re: LWP::UserAgent with HTTP::Cookies not keeping cooki <bart.lateur@skynet.be>
Re: LWP::UserAgent with HTTP::Cookies not keeping cooki snakedjip@yahoo.com
Re: moving files from directories <Michael.Schlueter@philips.com>
Re: moving files from directories (Tad McClellan)
Re: Perl's garbage collection (Anno Siegel)
Re: Perl's garbage collection <bart.lateur@skynet.be>
Re: Perl's garbage collection <ubl@schaffhausen.de>
Re: Price Comparison script? <stevec@ntlworld.com>
Re: Price Comparison script? <jbuff1856@my-deja.com>
Re: Price Comparison script? <stevec@ntlworld.com>
Re: Price Comparison script? <jbuff1856@my-deja.com>
Re: regex puzzler <richard.bragg.bsc@ntl.remove.com>
Re: Split problem (Tad McClellan)
Re: What do you call the => operator? (Villy Kruse)
Re: What do you call the => operator? (Abigail)
Re: What do you call the => operator? mexicanmeatballs@my-deja.com
Re: word combinations? (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 15 Jan 2001 11:42:03 +0000
From: Matt Sergeant <matt@sergeant.org>
Subject: Re: Apply XPath expression to XML::DOM
Message-Id: <3A62E20B.9020701@sergeant.org>
Bjoern Hoehrmann wrote:
> * Eric Bohlman wrote in comp.lang.perl.misc:
>
>>> I've got XML::DOM::Document or XML::DOM::Node object and i want to use
>>> XPath to get some nodes of this node-set. There is XML::XPath on CPAN,
>>> but it doesn't seem to support this. Is this correct? If yes, why and
>>> what can I do to reach my goal?
>>
>> XML::XPath uses its own object model for XML nodes rather than DOM.
>
>
> Due to what limitation of XML::DOM? Because it has no support for xml
> namespaces?
Yes. Bear in mind that XML::XPath's object model is actually DOM, its
just that people see XML::DOM and think that's what they need and that
XML::XPath isn't DOM, when in fact it is, its just not XML::DOM.
XML::XPath is missing some of the stuff XML::DOM provides you with, like
low level access to entities and the DTD, but otherwise its pretty complete.
> If so, will this change? Is there any work on a Perl
> implementation of the DOM Level 2?
Work on XML::DOM is pretty much dead. Someone has taken to fixing it for
working with XML::Parser 2.30, but other than that I can't see it going
further.
XML::XPath though is actively developed. I've just put out an alpha
version of a C based version, which should be many times faster (I
haven't benchmarked it yet).
However also note that XML::XPath will likely never support low level
features like access to the DTD or entities. If you want that sort of
information you may be better off using XML::Parser directly.
>> XML::XQL, which implements an older language that's basically a subset of
>> XPath, does work on DOM nodes; if you don't need to use arbitrary XPath
>> expressions coming from outside your program, it might do the job.
>
>
> I'd like to avoid the use of XQL.
Yes, its a dead standard, no longer in development from what I can tell.
Matt.
------------------------------
Date: Mon, 15 Jan 2001 05:42:44 -0600
From: "John Roth" <johnroth@ameritech.net>
Subject: Re: Can't associate .PL files in Win98
Message-Id: <t65o857e9l3a1a@news.supernews.com>
Here's what's going on:
You've got the association working correctly. What happens is that when you
double-click on
a .pl file, Windows launches ***DOS*** with the command you specify.
Unfortunately, you can't
get DOS to stop and let you look at the results when you launch it this
way - it always shuts down the
DOS window when the command returns. Thus the suggestion to put a SLEEP
command in the
stream.
Windows 9X (and ME) uses DOS as it's command line facility. Windows 2000
etc. uses something
else that integrates much better with the Windows environment. They're two
completely different
animals in this area.
Given your note below, it may not do that if it's running a .bat file
instead of a .EXE file.
Gary Burton <glburton@mindspring.com> wrote in message
news:3A620FC7.E154E053@mindspring.com...
> No, I can't figure out why one computer uses the current directory and the
other uses the perl directory. Perhaps you are using Windows NT, which I
know very little about.
>
> The association still would not work in Windows 98. An opinion on one
of the discussion groups was that it can't be done for shell (DOS) programs
in Win95 or Win98, although it works fine in Windows NT. Unfortunately,
that seems to be correct because I carefully reviewed the instructions in
ActiveState's perlwin32faq4 FAQ called "How do I associate Perl scripts with
Perl?" and followed them precisely.
>
> It acts like it isn't even finding the Perl executable. I tried
putting "Sleep 10" and <stdin> in my script, and neither kept the window
open.
If it isn't finding the executable, the directory with the Perl executable
isn't in your path, or the .lnk file for the DOS session doesn't specify the
correct command - it must specify executing Perl from the proper directory
with the .pl as it's object.
> I did find a solution, although I don't like it much. I created a
batch file called perl.bat in my c:\bat\ folder. Then I associated the .plx
extension with c:\bat\perl.bat. Perl.bat only contains one line:
> c:\Perl\bin\perl5.6.0.exe %1 %2
> That works, but I don't like it because I don't like throwing programs
in just to run programs, and the window doesn't close after the application
finishes.
I'm going to have to try this! As you've figured out by now, the real
problem is controlling whether the window closes when the program ends.
Micro$oft doesn't seem to have given us quite enough control there. Pity,
but then, we're talking about Micro$oft.
>
> Related questions:
> * Have you ever actually SEEN the association work in Windows 98?
If so, I will continue to fight the battle. By the way, I have the first
edition of Win98; but I don't think that matters.
It does work. The problem is with the DOS box, not with the association.
BTW - there's no way of making an association
work inside of the DOS box - it's just not part of the Windows
specification. DOS only looks for .BAT, .EXE and so forth when it's looking
for executables on the path. It completely ignores any associations.
> * My c:\Perl\bin folder contains both Perl.exe and perl5.6.0.exe.
Is there a difference? If so, what is it?
Did you install it twice without uninstalling?
> * "Learning Perl on Win32 Systems" recommends assigning a .PLX
extension to the scripts as opposed to the .PL extension to avoid confusion
with the Perl libraries. Yet, the FAQ "How do I associate Perl scripts with
Perl?" and all the examples show the .PL extension. What do you think?
ActiveState could do a better job. The PL extension is for "Perl Libraries,"
and shouldn't be overloaded for executables. Again, it doesn't really matter
if you keep things separated.
To put all of this together so it makes sense: What happens when you
double-click on a .pl file
in Windows 9x is as follows.
1. Windows looks up the .pl extension in the registry, and finds the
command, which is "perl %1".
2. Since perl is a DOS program, Windows builds a .lnk file for the .pl file.
This .lnk contains default parameters for DOS
3. Windows launches DOS, using the expanded "perl %1" command as the initial
command to execute.
4. The DOS box attempts to find perl.exe, either on the path or in the
working directory
5. If it finds it, it runs it.
6. When the command completes, the DOS box shuts down, preventing you from
seeing anything you've written to STDOUT.
John Roth
>
>
> dtbaker_dejanews@my-deja.com wrote:
> >
> > In article <3A60BD09.B0DAA9F6@mindspring.com>,
> > Gary Burton <glburton@mindspring.com> wrote:
> > > I am a newbie using Win98. I am using ActivePerl v5.6, and
> > working from the ActivePerl online documentation. I can run my example
> > programs from a DOS window by typing in "Perl filename"; but when I
> > associate the .PL extension as the literature suggest, all I get is a
> > DOS window that closes so quickly that I can't read the error message.
> > >
> > -----------------
> > this *probably* means you have it working correctly actually... try
> > putting a
> > sleep 10;
> > at the end of your script. when running a script by double-click, the
> > DOS window only stays open while the script runs, then closes.
> >
> > on a related note though, I have installed the same version of
> > ActivePerl on two different PCs, and one of them I have the double-click
> > working and it uses the dir the script is in as the current working dir,
> > and on the other it uses the dir where perl.exe is?!
> >
> > if you figure THAT one out, let me know!
> >
> > Dan
> >
> > Sent via Deja.com
> > http://www.deja.com/
------------------------------
Date: Mon, 15 Jan 2001 11:18:52 +0100
From: Lex Hagen <l.hagen@HumanInference.com>
Subject: error code
Message-Id: <04932F2B7E20D211856C00A0C9A060952D36D9@HIS03>
What does this mean?
[v:\perlnt5.519\bin]perl
C:\data\vbporteerprogramma\output\teln_script.pl
Ambiguous call resolved as CORE::open(), qualify as such or use & at
v:\perlnt5.
519\site\lib/Net/Telnet.pm line 1994.
Can't locate auto/Net/Telnet/ls.al in @INC (@INC contains:
v:\perlnt5.519\lib v:
\perlnt5.519\site\lib V:/perlnt5.519/lib V:/perlnt5.519/site/lib .) at
C:\data\v
bporteerprogramma\output\teln_script.pl line 20
------------------------------
Date: Mon, 15 Jan 2001 22:47:02 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: error code
Message-Id: <slrn965opm.fu5.mgjv@martien.heliotrope.home>
On Mon, 15 Jan 2001 11:18:52 +0100,
Lex Hagen <l.hagen@HumanInference.com> wrote:
> What does this mean?
>
> [v:\perlnt5.519\bin]perl
> C:\data\vbporteerprogramma\output\teln_script.pl
> Ambiguous call resolved as CORE::open(), qualify as such or use & at
> v:\perlnt5.
Did you mean to call $telnet->open(), but maybe you did something else?
Maybe you did
open $telnet, $hostname;
You called open in an ambiguous way. Hard to tell more unless you show
us some code.
> 519\site\lib/Net/Telnet.pm line 1994.
> Can't locate auto/Net/Telnet/ls.al in @INC (@INC contains:
> v:\perlnt5.519\lib v:
> \perlnt5.519\site\lib V:/perlnt5.519/lib V:/perlnt5.519/site/lib .) at
> C:\data\v
> bporteerprogramma\output\teln_script.pl line 20
Did you by any chance create a Net::Telnet object, and then do something
like:
$telnet->ls();
when you meant to do something like:
$telnet->cmd("ls");
Maybe, next time, you could accompany error messages with the code that
you have tried. That way we could, with a bit more certainty, explain
what is going on. ALl this guessing is a waste of time, and not very
productive, in general.
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: 15 Jan 2001 08:52:21 GMT
From: cjw44@flatline.org.uk (Colin Watson)
Subject: Re: Help me append
Message-Id: <93udo5$oad$1@riva.ucam.org>
David H. Adler <dha@panix6.panix.com> wrote:
>On 13 Jan 2001 23:28:43 GMT, Colin Watson <cjw44@flatline.org.uk> wrote:
>> Brian Foy
>
>That's 'brian d foy'. See <http://www.panix.com/~comdog/style.html>
>for details.
Oh. I habitually recast my posts into a canonical form, which has a
tendency to title-case proper names. I shall update the list of
exceptions I keep in my head to avoid precisely this problem. :)
--
Colin Watson [cjw44@flatline.org.uk]
checking for gethostbyname in -lresolv... yes
checking for a sense of humor... (cashed) Yep!
checking how to run the C preprocessor... gcc -E - gnutalk/configure
------------------------------
Date: Mon, 15 Jan 2001 09:36:57 GMT
From: jbuff <jbuff1856@my-deja.com>
Subject: Re: Help me append
Message-Id: <93ugbp$14m$1@nnrp1.deja.com>
In article <slrn964uqe.3d7.dha@panix6.panix.com>,
dha@panix6.panix.com (David H. Adler) wrote:
> On 13 Jan 2001 23:28:43 GMT, Colin Watson <cjw44@flatline.org.uk>
wrote:
> >
> > Brian Foy
>
> That's 'brian d foy'. See <http://www.panix.com/~comdog/style.html>
> for details.
>
> Thanks, though. It makes a change from chastising people for job
> posts. :-)
>
> dha, Sgt at arms
>
This begs the question "Is brian d foy a real person?".
Or is he a construct like Alan Smithee?
--jbuff
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Mon, 15 Jan 2001 13:11:24 +0100
From: Erik Coopman <Erik.Coopman@student.kuleuven.ac.be>
Subject: I/O buffers
Message-Id: <3A62E8EC.75BD916@student.kuleuven.ac.be>
Hi
I'm working on a perl script that has to process output from a prolog
program. This output is line driven, but it contains very long lines
(>1k) as wel as short ones (<20bytes). If I use the standard method for
reading in lines "$string = <FILEHANDLE>;", i get several long lines
incomplete. I suspect that there's a buffer problem. So I tried to
resolve it like this:
my left_over = "";
for (;;) {
my $string = "";
for (;;) {
if ($left_over =~ /(.+?)\n(.*)$/so) {
$string = $1;
$left_over = $2;
last;
}
else {
my $nb_bytes = read (RDR, $string, 512);
if ($nb_bytes == 0) {exit;} # EOF encountered
$left_over = $left_over . $string;
}
}
...
#some processing on $string...
...
}
In this way i read in my line in pieces till I get a "\n" in my string.
Then i process the first part and the second part is kept for the next
run. When the second part doesn't contains a "\n", i read again from
the input till it does. This works fine execpt on one thing: when a
short line is send, this script sees it only after a while, meaning only
after prolog has send enough data to fill 512 bytes. But i've to react
faster. So in order to be react just after the "\n" is send, i've have
to read byte by byte:
"my $nb_bytes = read (RDR, $string, 1);".
This works, but i'm wondering if there's no other way so i can avoid the
inner loop. It's rather time consuming.
Any suggestion is welcome.
Thx and greetings
Erik
------------------------------
Date: Mon, 15 Jan 2001 06:33:26 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: I/O buffers
Message-Id: <slrn965o06.c5k.tadmc@tadmc26.august.net>
Erik Coopman <Erik.Coopman@student.kuleuven.ac.be> wrote:
>Hi
>
>I'm working on a perl script that has to process output from a prolog
>program. This output is line driven, but it contains very long lines
>(>1k) as wel as short ones (<20bytes). If I use the standard method for
>reading in lines "$string = <FILEHANDLE>;", i get several long lines
>incomplete.
I have read lines that are several hundred Kb long, so that
isn't the problem.
>I suspect that there's a buffer problem.
Your problem is somewhere else.
>So I tried to
>resolve it like this:
>
>my left_over = "";
^^
^^
Please do not post pseudo code. Post real Perl code.
> if ($left_over =~ /(.+?)\n(.*)$/so) {
^
^
You should not include options that have no effect.
> $left_over = $left_over . $string;
You can write that:
$left_over .= $string;
>Any suggestion is welcome.
Show us some code where <FILEHANDLE> ( aka: readline() )
is not reading long lines.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 15 Jan 2001 13:29:11 GMT
From: snakedjip@yahoo.com
Subject: LWP and RAS (with Win32::RASE) + ethernet connection
Message-Id: <93utv0$ask$1@nnrp1.deja.com>
I've got what I hope is a stupid question, and I expect you to tell me
I'm an a**hole if the answer is trivial :-) (with the trivial answer
of course)...
I have a PC that has an ethernet connection to the internet, as well as
a modem.
I have a DUN connection set up in Windows.
I want to write a script that will use the modem, NOT MY NETWORK CARD,
to access the internet and extract a web page with LWP::UserAgent.
I can connect to the internet through my modem with Win32::RASE. That
part works fine.
Now, how do I make LWP::UserAgent use that modem connection, AND NOT MY
NETWORK CARD connection, to extract the HTML from the web page I'm
interested in ?
PS: Don't ask me why I want to use the modem instead of the network
card... I have my reasons :-)
Thanks for your replies :-)
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Mon, 15 Jan 2001 10:18:35 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: LWP::UserAgent with HTTP::Cookies not keeping cookies ???
Message-Id: <afj56tckqh49ps9ck2t8ii9kaogobol1nu@4ax.com>
snakedjip@yahoo.com wrote:
>When I access this default page with a browser for the first time,
>since this is a Microsoft ASP page, a cookie is sent to my browser to
>identify the session id. If I "reload" the page in the browser, that
>cookie is sent to the server upon its request for it... I verified in
>the server's log, and the cookie appears in it (with the W3C extended
>logging enabled in IIS, this is possible...)
>
>So far so good.
>
>Now, I want to reproduce this behaviour with LWP::UserAgent and
>HTTP::Cookies.
>The cookie is never sent to the server. In
>fact, the $cookie_jar->as_string method returns NOTHING !
>WHY ?
>
>I tried the same code on another site and it works just fine...
Just a sidenote. I once had a similar propblem with a browser, not code.
Here, too, the cookie wasn't sent to the server, and not stored either.
The problem turned out to be that the clock on my computer was too far
off (clock battery empty). Once the clock was adjusted, it worked fine.
I don't know how this could apply to your code, but it's definitely a
route worth investigating.
--
Bart.
------------------------------
Date: Mon, 15 Jan 2001 13:21:46 GMT
From: snakedjip@yahoo.com
Subject: Re: LWP::UserAgent with HTTP::Cookies not keeping cookies ???
Message-Id: <93uth4$agb$1@nnrp1.deja.com>
Thanks for your reply. Unfortunately, my clock is just fine :-(
In article <afj56tckqh49ps9ck2t8ii9kaogobol1nu@4ax.com>,
Bart Lateur <bart.lateur@skynet.be> wrote:
> snakedjip@yahoo.com wrote:
>
> >When I access this default page with a browser for the first time,
> >since this is a Microsoft ASP page, a cookie is sent to my browser to
> >identify the session id. If I "reload" the page in the browser, that
> >cookie is sent to the server upon its request for it... I verified
in
> >the server's log, and the cookie appears in it (with the W3C extended
> >logging enabled in IIS, this is possible...)
> >
> >So far so good.
> >
> >Now, I want to reproduce this behaviour with LWP::UserAgent and
> >HTTP::Cookies.
>
> >The cookie is never sent to the server. In
> >fact, the $cookie_jar->as_string method returns NOTHING !
> >WHY ?
> >
> >I tried the same code on another site and it works just fine...
>
> Just a sidenote. I once had a similar propblem with a browser, not
code.
> Here, too, the cookie wasn't sent to the server, and not stored
either.
> The problem turned out to be that the clock on my computer was too far
> off (clock battery empty). Once the clock was adjusted, it worked
fine.
>
> I don't know how this could apply to your code, but it's definitely a
> route worth investigating.
>
> --
> Bart.
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Mon, 15 Jan 2001 14:03:48 +0100
From: "Michael Schlueter" <Michael.Schlueter@philips.com>
Subject: Re: moving files from directories
Message-Id: <3a62f536$0$8783$4dbef881@businessnews.de.uu.net>
For the first part of your question check out the Unix find command (man
find). From Perl you envoke it by the backticks, e.g:
`find * -exec mv {} dir \;` ;
Second part: there are many ways to find out the first letter of the file
name, like using a regular expression or returning a substring.
In general: why do you need to do all this? What is your final objective?
------------------------------
Date: Mon, 15 Jan 2001 06:43:18 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: moving files from directories
Message-Id: <slrn965oim.c7q.tadmc@tadmc26.august.net>
Michael Schlueter <Michael.Schlueter@philips.com> wrote:
>For the first part of your question check out the Unix find command (man
>find). From Perl you envoke it by the backticks, e.g:
>
> `find * -exec mv {} dir \;` ;
I don't see anything in the problem description about recursive
filesystem searching.
If that _had_ been mentioned, then the thing to point to would be:
use File::Find; # works even on systems that do not have find(1)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 15 Jan 2001 11:34:30 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Perl's garbage collection
Message-Id: <93un86$p0j$1@mamenchi.zrz.TU-Berlin.DE>
Malte Ubl <ubl@schaffhausen.de> wrote in comp.lang.perl.misc:
>Hi,
>
>I know that one should never rely on when an object's
>DESTROY method is called. However, by definition, END
>blocks are called as late as possible. That's why I
>wonder whether one can rely one an DESTROY method of an
>object which has no references inside an END block being
>called before any END block?
Uh... how would you determine whether a block (END or otherwise) "has a
reference" to some object? If the block mentions any variable at all
it can point directly or indirectly to anything whatsoever at the time
the block is called. A glance at the code just won't tell.
Anno
------------------------------
Date: Mon, 15 Jan 2001 12:43:30 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl's garbage collection
Message-Id: <mir56tgq4l9vctvjtcqcbfosr2r5vuernq@4ax.com>
Malte Ubl wrote:
>I know that one should never rely on when an object's
>DESTROY method is called. However, by definition, END
>blocks are called as late as possible. That's why I
>wonder whether one can rely one an DESTROY method of an
>object which has no references inside an END block being
>called before any END block?
Gee.
When in doubt, you can get rid of objects yourself, beore exiting the
script -- thus invoking the END blocks.
Also, END blocks are invoked in reverse sequence (see perlmod). So in
theory, you can even do the above in an END block.
--
Bart.
------------------------------
Date: Mon, 15 Jan 2001 14:45:56 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Perl's garbage collection
Message-Id: <3A62FF14.FAA1F4E0@schaffhausen.de>
Anno Siegel schrieb:
>
> Malte Ubl <ubl@schaffhausen.de> wrote in comp.lang.perl.misc:
> >Hi,
> >
> >I know that one should never rely on when an object's
> >DESTROY method is called. However, by definition, END
> >blocks are called as late as possible. That's why I
> >wonder whether one can rely one an DESTROY method of an
> >object which has no references inside an END block being
> >called before any END block?
>
> Uh... how would you determine whether a block (END or otherwise) "has a
> reference" to some object? If the block mentions any variable at all
> it can point directly or indirectly to anything whatsoever at the time
> the block is called. A glance at the code just won't tell.
Here is a concrete example:
This is my only END block:
{
$dbh->disconnect
}
My object automatically syncs itself with the database on DESTROY. Thus
I wanted to know whether the DESTROY always takes place before the
database is disconnected.
Bye,
->malte
------------------------------
Date: Mon, 15 Jan 2001 09:51:50 -0000
From: "stevec" <stevec@ntlworld.com>
Subject: Re: Price Comparison script?
Message-Id: <XIz86.2994$cv6.78292@news6-win.server.ntlworld.com>
Sorry Rich, you'll have to help me out with that one!! What do you mean?
Steve
"Rich Lafferty" <rich@bofh.concordia.ca> wrote in message
news:slrn964brd.mde.rich@bofh.concordia.ca...
> In comp.lang.perl.misc,
> stevec <stevec@ntlworld.com> wrote:
> > Has anyone worked on or knows of a perl (or any other) script that will
> > search other web sites and compare prices, amalgamate them and list the
> > different prices on a web page?
>
> Yes, I have. I can't help but think you meant to ask more than that,
> though.
>
> -Rich
>
> --
> Rich Lafferty ----------------------------------------
> Nocturnal Aviation Division, IITS Computing Services
> Concordia University, Montreal, QC
> rich@bofh.concordia.ca -------------------------------
------------------------------
Date: Mon, 15 Jan 2001 10:38:29 GMT
From: jbuff <jbuff1856@my-deja.com>
Subject: Re: Price Comparison script?
Message-Id: <93ujv5$3mr$1@nnrp1.deja.com>
<<Jeopardy style posting rearranged, please read
http://www.jbuff.org/clpmisc_guidelines.htm >>
> "Rich Lafferty" <rich@bofh.concordia.ca> wrote in message
> news:slrn964brd.mde.rich@bofh.concordia.ca...
> > In comp.lang.perl.misc,
> > stevec <stevec@ntlworld.com> wrote:
> > > Has anyone worked on or knows of a perl (or any other) script
that will
> > > search other web sites and compare prices, amalgamate them and
list the
> > > different prices on a web page?
> >
> > Yes, I have. I can't help but think you meant to ask more than that,
> > though.
> >
In article <XIz86.2994$cv6.78292@news6-win.server.ntlworld.com>,
"stevec" <stevec@ntlworld.com> wrote:
> Sorry Rich, you'll have to help me out with that one!! What do you
mean?
>
What he means is pretty much what he said, "Do you need to ask more?".
If you are satisfied with knowing that someone else has worked on, or
knows of such a perl program, then the thread is finished.
If you need to know more about the construction of such a program, or
where to locate one, then you should have asked. Folks here don't seem
to care if you ask your question straight out, but they do seem to get
irritated when you don't state your point in your initial post.
--jbuff
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Mon, 15 Jan 2001 11:02:11 -0000
From: "stevec" <stevec@ntlworld.com>
Subject: Re: Price Comparison script?
Message-Id: <ZKA86.3064$cv6.80158@news6-win.server.ntlworld.com>
Sorry everyone for not stating my requirements in a more direct form. I
wanted to know if anyone knows how to construct a price comparison script or
can point me in the direction of a tutorial showing how to construct such a
program.
Thanks
Steve
"jbuff" <jbuff1856@my-deja.com> wrote in message
news:93ujv5$3mr$1@nnrp1.deja.com...
> <<Jeopardy style posting rearranged, please read
> http://www.jbuff.org/clpmisc_guidelines.htm >>
>
> > "Rich Lafferty" <rich@bofh.concordia.ca> wrote in message
> > news:slrn964brd.mde.rich@bofh.concordia.ca...
> > > In comp.lang.perl.misc,
> > > stevec <stevec@ntlworld.com> wrote:
> > > > Has anyone worked on or knows of a perl (or any other) script
> that will
> > > > search other web sites and compare prices, amalgamate them and
> list the
> > > > different prices on a web page?
> > >
> > > Yes, I have. I can't help but think you meant to ask more than that,
> > > though.
> > >
>
> In article <XIz86.2994$cv6.78292@news6-win.server.ntlworld.com>,
> "stevec" <stevec@ntlworld.com> wrote:
> > Sorry Rich, you'll have to help me out with that one!! What do you
> mean?
> >
>
> What he means is pretty much what he said, "Do you need to ask more?".
>
> If you are satisfied with knowing that someone else has worked on, or
> knows of such a perl program, then the thread is finished.
>
> If you need to know more about the construction of such a program, or
> where to locate one, then you should have asked. Folks here don't seem
> to care if you ask your question straight out, but they do seem to get
> irritated when you don't state your point in your initial post.
>
> --jbuff
>
>
> Sent via Deja.com
> http://www.deja.com/
------------------------------
Date: Mon, 15 Jan 2001 11:52:12 GMT
From: jbuff <jbuff1856@my-deja.com>
Subject: Re: Price Comparison script?
Message-Id: <93uo9b$6qt$1@nnrp1.deja.com>
<<Jeopardy style posting rearranged for the final time. Read
http://www.jbuff.org/clpmisc_guidelines.htm or no one else here (more
knowledgeable than I) will be likely to respond to you.>>
In article <ZKA86.3064$cv6.80158@news6-win.server.ntlworld.com>,
"stevec" <stevec@ntlworld.com> wrote:
> Sorry everyone for not stating my requirements in a more direct form.
I
> wanted to know if anyone knows how to construct a price comparison
script or
> can point me in the direction of a tutorial showing how to construct
such a
> program.
>
Your problem is primarily one of reading other web sites and extracting
information. The first thing you need to learn is how to read other web
sites. Start with "perldoc LWP" to learn how to fetch the pages you
need. Then you'll need to know how to extract the information from the
HTML coded pages. Use perldoc HTML::Parser (or the simpler to
understand HTML::TokeParser) to get you over that hurdle. Since every
site that you wish to check prices on is likely to be coded
differently, you're not likely to find a prewritten script that is of
any use to you. Expect to learn a lot of perl before you can accomplish
your desired goal. It's taken me several months to learn enough to give
you this bare-bones answer to your question.
--jbuff
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Mon, 15 Jan 2001 13:12:26 +0000
From: Richard J Bragg <richard.bragg.bsc@ntl.remove.com>
Subject: Re: regex puzzler
Message-Id: <3A62F73A.B10BE6AB@ntl.remove.com>
This one works. Ta very much
"Richard J. Rauenzahn" wrote:
>
> richard.bragg.bsc@ntl.remove.com writes:
> >I am trying to be very lazy and have another way to do this but what I
> >am looking for is something on the lines of
> >
> >$_ = some_input;
> >/regex(.*)/;
> >print "$+\n"; # or something
> >
> >rule is that if input contains ": " (colonspace) then I want what
> >follows the ": " else
> >I want the whole string.
> >
> >e.g.
> >hello: world ---> world
> >hello world ---> hello world
>
> How about this:
>
> my @data = <DATA>;
>
> for(@data) { /^(.*?: )?(.*)/ && print "$2\n"; }
>
> # or... nongreedy, depending on how you want "hello: cruel: world"
> # to work out...
>
> for(@data) { /^(.*: )?(.*)/ && print "$2\n"; }
>
> __DATA__
> hello: world
> hello world
> hello: cruel: world
>
> $ perl5 -Mstrict -w ./foo
> world
> hello world
> cruel: world
> world
> hello world
> world
>
> Rich
> --
> Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
> Technical Consultant | I speak for me, | 19055 Pruneridge Ave.
> Development Alliances Lab| *not* HP | MS 46TU2
> ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014
------------------------------
Date: Mon, 15 Jan 2001 06:16:58 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Split problem
Message-Id: <slrn965n1a.c5k.tadmc@tadmc26.august.net>
Jeff Helman <jhelman@wsb.com> wrote:
>On Mon, 15 Jan 2001 02:17:33 GMT, "What A Man !" <whataman@home.com>
>wrote:
>
>>I have 0 03-21-00 15:53 MyFile/ in $list[3] but just
>>want to pull out MyFile/ and put it into another scalar.
>$_ = list[3];
>@lis = split(/ /);
>print "$lis[3]";
>
>'Course, this also only works if there aren't any leading spaces in
>your line. If there are, and if you decide you want to get rid of
>them, just put the following line before your split() call:
>
>$list[3] =~ s/^\s+//;
Or, skip the s/// and use instead:
$_ = $list[3];
@lis = split();
or
$_ = $list[3];
@lis = split( ' ' );
or, probably best:
@lis = split( ' ', $list[3] ); # no copying to $_ needed
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 15 Jan 2001 09:27:47 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: What do you call the => operator?
Message-Id: <slrn965gkj.4n1.vek@pharmnl.ohout.pharmapartners.nl>
On Sun, 14 Jan 2001 20:10:38 GMT, Henry <usequity@mindspring.com> wrote:
>It is also called the arrow operator and the arrow comma in Perl in a
>Nutshell
>
If => is an arrow operator, then what is -> ?
Villy
------------------------------
Date: 15 Jan 2001 10:40:52 GMT
From: abigail@foad.org (Abigail)
Subject: Re: What do you call the => operator?
Message-Id: <slrn965ktk.1ej.abigail@tsathoggua.rlyeh.net>
Villy Kruse (vek@pharmnl.ohout.pharmapartners.nl) wrote on MMDCXCIV
September MCMXCIII in <URL:news:slrn965gkj.4n1.vek@pharmnl.ohout.pharmapartners.nl>:
__ On Sun, 14 Jan 2001 20:10:38 GMT, Henry <usequity@mindspring.com> wrote:
__ >It is also called the arrow operator and the arrow comma in Perl in a
__ >Nutshell
__ >
__
__ If => is an arrow operator, then what is -> ?
IDO.
Abigail
--
``infix dereference operator'' (from man perlop)
------------------------------
Date: Mon, 15 Jan 2001 11:59:23 GMT
From: mexicanmeatballs@my-deja.com
Subject: Re: What do you call the => operator?
Message-Id: <93uomp$6v1$1@nnrp1.deja.com>
In article <x7bstj6uz2.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
<snip>
> another suggestion is 'fat arrow' which is ok IMO. another is 'equal
> greater' (the two chars used) but i don't like that.
Actually that reminds me of another place it creates confusion:
bash$ perl -e '$a= (3>=4) ? "t\n" : "f\n"; print $a;'
f
bash$ perl -e '$a= (3=>4) ? "t\n" : "f\n"; print $a;'
t
bash$
That one'll have got a few of us, and so subtly too..
I propose calling it the 'cockup' operator.
--
Jon
perl -e 'print map {chr(ord($_)-3)} split //, "MrqEdunhuClqdph1frp";'
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 15 Jan 2001 10:44:02 GMT
From: abigail@foad.org (Abigail)
Subject: Re: word combinations?
Message-Id: <slrn965l3i.1ej.abigail@tsathoggua.rlyeh.net>
Nico F Zigouras (zigouras@mail.med.upenn.edu) wrote on MMDCXCIII
September MCMXCIII in <URL:news:Pine.OSF.4.10.10101140147580.14142-100000@dolphin.upenn.edu>:
-- Can anyone give me or point me to Perl code on how to find all possible
-- combinations of a word? i.e. I have a word:
--
-- hello
--
-- I want to find all words like:
-- helol
-- ehllo
-- ...
--
--
-- I know there are (number of letters)! possible combinations but how would
-- I find those exact words?
Actually there aren't, as both letters `l's are the same.
-- I am writing this in Perl but any code would be fine.
Smells like a home work problem to me...
Abigail
--
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 62
*************************************