[23928] in Perl-Users-Digest
Perl-Users Digest, Issue: 6129 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 13 14:05:43 2004
Date: Fri, 13 Feb 2004 11:05:08 -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, 13 Feb 2004 Volume: 10 Number: 6129
Today's topics:
API for import? <nomail@please.com>
Re: API for import? <usenet@morrow.me.uk>
Re: if for... (Aaron Sherman)
Re: if for... <nobull@mail.com>
Re: Include data in a perl program? <me@privacy.net>
Re: Include data in a perl program? <me@privacy.net>
Re: Is Windows running <leeg@teaching.physics.ox.ac.uk.valid>
Re: Is Windows running <Petri_member@newsguy.com>
Re: Is Windows running <ceo@nospan.on.net>
open pipe vs signals causing problems ? (funtoosh)
Re: open pipe vs signals causing problems ? <nobull@mail.com>
Re: open pipe vs signals causing problems ? <usenet@morrow.me.uk>
Re: parsing out all data between two words with multipl (KP)
Re: parsing out all data between two words with multipl <usenet@morrow.me.uk>
pattern mattching (Pascal)
Re: perl and db-module (Dan Bent)
Re: perl and db-module <usenet@morrow.me.uk>
Perl for processing XML (Ross Clement)
Re: Perl for processing XML <mirod@xmltwig.com>
Re: Perl usage these days? <apollock11@hotmail.com>
Re: Problem opening sed pipe <bik.mido@tiscalinet.it>
Reading html into a source file (Chris)
Re: Reading html into a source file <nospam@bigpond.com>
Re: Reading html into a source file <dwall@fastmail.fm>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 13 Feb 2004 15:54:19 +0000 (UTC)
From: kj <nomail@please.com>
Subject: API for import?
Message-Id: <c0irvb$i1l$1@reader2.panix.com>
Where can one find good documetation on the API for the import
function and whatever other information one must know to write
one's own import function? (Neither 'perldoc -f import' and pointers
therein, nor reading the Export.pm source code were particularly
illuminating on this question.)
Thanks!
kj
------------------------------
Date: Fri, 13 Feb 2004 18:44:16 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: API for import?
Message-Id: <c0j5u0$7jq$1@wisteria.csv.warwick.ac.uk>
kj <nomail@please.com> wrote:
>
> Where can one find good documetation on the API for the import
> function and whatever other information one must know to write
> one's own import function? (Neither 'perldoc -f import' and pointers
> therein, nor reading the Export.pm source code were particularly
^^ er
> illuminating on this question.)
perldoc -f use
perldoc perlmod
Think carefully before you start though: is it *really* necessary to
write your own? Exporter covers most cases...
Ben
--
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else * ben@morrow.me.uk
------------------------------
Date: 13 Feb 2004 08:15:22 -0800
From: ajs@ajs.com (Aaron Sherman)
Subject: Re: if for...
Message-Id: <eaa2c627.0402130815.30b38f2a@posting.google.com>
Brian McCauley <nobull@mail.com> wrote:
> I think you really meant to ask why can't I say:
>
> .... if m/str/ for @arr;
[...]
> All I can find are:
>
> [1] Because you can't, so there!
> [2] Because you could abuse it to produce unreadable code
> [3] Because using for without an explicit loop variable is bad
> [4] For well known reasons I won't repeat
>
> You'll note that [1] and [4] are no sort of explaintion. [2] applies
> to pretty much everyting in Perl. [3] is an argument against the
> "for" statement modifier per-se, not an argument against being able to
> chain statement modifiers.
Ok, so here are some more:
1. It brings up the arguments that happened in p6l over
if/unless/for/foreach/while/until/map/grep/do
2. Parser reasons
3. postfix if is much less flexible than low-precedence logic anyway
(and, or)
Number 2 breaks down like this:
If your grammar is generic, you want to be able to string:
print if /\d/ for @{$_} for @stuff;
but then you lose the ability to access the $_ from the outer loop. In
this case, that's not too bad, but there are plenty of cases where you
would want to.
So, you have to restrict for to a single instance, and that seems
non-intuitive to many users, so you really haven't gained much clarity
in the language.
------------------------------
Date: 13 Feb 2004 17:52:33 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: if for...
Message-Id: <u9r7wykgta.fsf@wcl-l.bham.ac.uk>
ajs@ajs.com (Aaron Sherman) writes:
> Brian McCauley <nobull@mail.com> wrote:
>
> > I think you really meant to ask why can't I say:
> >
> > .... if m/str/ for @arr;
> [...]
> > All I can find are:
> >
> > [1] Because you can't, so there!
> > [2] Because you could abuse it to produce unreadable code
> > [3] Because using for without an explicit loop variable is bad
> > [4] For well known reasons I won't repeat
> >
> > You'll note that [1] and [4] are no sort of explaintion. [2] applies
> > to pretty much everyting in Perl. [3] is an argument against the
> > "for" statement modifier per-se, not an argument against being able to
> > chain statement modifiers.
>
> Ok, so here are some more:
I'm not convinced that these are more.
> 1. It brings up the arguments that happened in p6l over
> if/unless/for/foreach/while/until/map/grep/do
Isn't your [1] my [4]?
> 2. Parser reasons
Do you mean _real_ parser problems as in "it would be difficult to
make the Perl parser cope"? People seem to claim these exist these
exist but I've never seen anyone present hard facts. Whenever they
are challenged to explain what they mean they end up falling back on
my [2,3].
> 3. postfix if is much less flexible than low-precedence logic anyway
> (and, or)
This is true, but it is often more readable. Being able to choose a
more readable way to say something is good.
> Number 2 breaks down like this:
>
> If your grammar is generic, you want to be able to string:
>
> print if /\d/ for @{$_} for @stuff;
Yes I do often want to do things like that because it is clear and
concise. At the moment I usually write the above as:
print for grep { /\d/ } map { @$_ } @stuff;
This is just as clear, almost as concise, but more memory hungy.
> but then you lose the ability to access the $_ from the outer loop.
That is not a _real_ parser problem. Perl would have no problem
knowing which $_ was in scope at any point. If the code them
complicated enough the programmer could loose track, but them
> In this case, that's not too bad, but there are plenty of cases
> where you would want to.
So, like I said above, whenever people put forward your [2] usually
when they try to explain it fall back on some varient of my [2,3] as
you have done.
You'll also note the fact that chaining or nesting multiple map and
grep within a single expression there are also multiple different $_
and you can only ever get at the innermost one at any point. The
problem that you say would be introduced by allowing multiple for
postfix already exists. If this ever becomes an issue I usually stop
trying to do the whole lot in one statement.
> So, you have to restrict for to a single instance,
No you don't.
> and that seems non-intuitive to many users
So don't do it.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 13 Feb 2004 07:03:37 -0800
From: "davido@codethought.nospamforme.com" <me@privacy.net>
Subject: Re: Include data in a perl program?
Message-Id: <egpp2092nkbgqbe7dkh8m0otg3fggmo8kl@4ax.com>
On Thu, 12 Feb 2004 23:18:29 +0000 (UTC), Ben Morrow
<usenet@morrow.me.uk> wrote:
>
>"davido@codethought.nospamforme.com" <me@privacy.net> wrote:
>>
>> Well, so far I keep running into the same problem. I get my hash
>> reference and all that gets written to the registy is a 'text'
>> representation of the TieRegistry data. Any other ideas would be
>> appreciated...
>>
>> Example: Win32::TieRegistry=HASH(0x207d420)
>>
>>
>> Code:
>> my $eol = undef $/;
>
>Let Perl remember the old value for you. It's much more reliable.
>
> {
> local $/; # by default set to undef
>
>> eval <DATA>;
>
> }
>
Oh cool! Thanks for that tip!
>>
>> $Registry->{"CUser/Software/VanDyke/SecureFX/File
>> Types"}=\%filetypes
>> or die "Can't set the File Types: $^E\n";
>
>Try
> $Registry->{...}{$_} = $filetypes{$_}
> for keys %filetypes;
>
>If %filetypes is a deep structure, then you'll probably have to
>recurse over it: it looks like the tied hash stringifies everything,
>so references will be destroyed.
Er... You might have something there... He's a sample:
%filetypes = bless( (
'Access.Fragment/' => bless( {
'/Default Icon Path' => '',
'/Default Icon Index' => '0x00000000',
'/Application' => '',
'/Extensions' => '',
'/Transfer Type' => '0x00000002',
'/Remote File Open Action' => '0x00000001'
}, 'Win32::TieRegistry' )
),'Win32::TieRegistry' );
>
>Alternatively, you could take your binary dump that you had before and
>Base64 encode it. Stick that at the end of your module, then load it
>from DATA, decode it and use TieRegistry's load function (with
>IO::Scalar if necessary).
>
I like this idea better. Would the MIME::Base64 module be the one I'd
use to encode the original binary file?
It's looking like I might end up just 'punting' and including the SAV
file has a binary - tho I'd rather *not* since that creates another
distributable that needs to be managed...
Ben/Thomas - I just wanted to say thank you for your help thus far.
While this is a deliverable that I have to finish, you guys have
helped me learn some cool stuff and I appreciate that.
------------------------------
Date: Fri, 13 Feb 2004 10:54:54 -0800
From: "davido@codethought.nospamforme.com" <me@privacy.net>
Subject: Re: Include data in a perl program?
Message-Id: <677q20pid299pi3fln0u60er6d6deek718@4ax.com>
In the spirit of "There's more than one way to do it." I decided to
find another way, and I did.
In WinXP/Win2k3 (the platforms this tool is targeted for) there is a
command-line version of RegEdit - simply called REG. It does the work
for me and I just pass a call to it from my perl script. The registry
data itself is in a __DATA__ block that I write to a temporary file
and then use for the REG IMPORT command.
Another problem solved. Thank you for taking the time to help me tho!
*returns to lurk and interject mode*
------------------------------
Date: Fri, 13 Feb 2004 14:32:54 +0000
From: leeg <leeg@teaching.physics.ox.ac.uk.valid>
Subject: Re: Is Windows running
Message-Id: <c0in6m$bqf$1@news.ox.ac.uk>
Sandman wrote:
> In article <slrnc2pbij.hc7.sholden@flexal.cs.usyd.edu.au>,
> sholden@flexal.cs.usyd.edu.au (Sam Holden) wrote:
>
>> > I've written a perl script which connects to the machines in our domain
>> > and creates a software installed type report. The problem is some of
>> > our users have dual boot laptops, win2k/linux, and if the user is in
>> > linux the script fails.
>> >
>> > So, does anyone know of a good way to determine if Windows is not the
>> > present operating system on a running machine.
>>
>>
>> Which part of the answer to that FAQ did you not understand?
>
> Sarcasm and insults aside, my interpretation of the problem was that he
> wanted to run a script on machine A that connects to machine B, C and D,
> but only if they are running Windows.
>
Grokking the results of nmap -O (http://www.insecure.org/nmap) may be
useful, in that case.
--
I am leeg, for we are many.
http://users.ox.ac.uk/~wadh1342
------------------------------
Date: 13 Feb 2004 06:17:46 -0800
From: Petri <Petri_member@newsguy.com>
Subject: Re: Is Windows running
Message-Id: <c0imaa01hfp@drn.newsguy.com>
In article <Gz1Xb.6$8G.55@psinet-eu-nl>, Chris Arnott says...
> I've written a perl script which connects to the machines in
> our domain and creates a software installed type report.
> The problem is some of our users have dual boot laptops,
> win2k/linux, and if the user is in linux the script fails.
> So, does anyone know of a good way to determine if Windows is
> not the present operating system on a running machine.
One way that's fast (no protocol timeouts), is by checking against a listening
tcp socket on the various computers.
You could try by connecting to shared Windows resources like c$, but that would
have a timeout delay if the host happened to be running Linux (assuming SAMBA
isn't running and even sharing something with the same name).
A TCP socket will die instantly* if no one is listening at the socket, since the
other host will return a TCP RST immediately in that case.
I hope your computers aren't behind portfiltering firewalls or anything, though.
:)
* My Win32 still tries 3 times before giving up, which takes 1 second in total.
Someone already suggested testing against the ssh port.
This assumes you are not running an ssh-server on your Windows systems, and that
you ARE on your Linux systems.
Here's an example:
---8<---
#!/usr/bin/perl -w
use strict;
use warnings;
use IO::Socket;
$_ = shift;
my $s= IO::Socket::INET->new($_ . ':22') ?
print "'$_' has sshd running (Linux?)\n" :
print "'$_' does not have sshd running (Win32?)\n";
---8<---
Try it like this:
test.pl host1
Hope this helps!
Petri
------------------------------
Date: Fri, 13 Feb 2004 16:22:01 GMT
From: Chris <ceo@nospan.on.net>
Subject: Re: Is Windows running
Message-Id: <JQ6Xb.34288$cf6.12612@newssvr33.news.prodigy.com>
Chris Arnott wrote:
> Hello and thanks for any help in advance.
>
> I've written a perl script which connects to the machines in our domain and
> creates a software installed type report. The problem is some of our users
> have dual boot laptops, win2k/linux, and if the user is in linux the script
> fails.
>
> So, does anyone know of a good way to determine if Windows is not the
> present operating system on a running machine.
>
Querying an IP port on the target machine may be your best way. You
might try looking at the source code for the *nix util called 'nmap' and
see if it provides any clues on how it determines machine types based on
port querying. Even if the remote machine is Linux running Samba, there
are ports open and running by default as well as responses on a true
Windows machine that aren't on a Linux machine running Samba. If you
know your Linux targets AREN'T running Samba, then the job is greatly
simplified: query the known SMB port(s) and see if you get a response.
Universal PnP (universal plug 'n pry-open) is one that comes to mind as
an example if for instance you know your true Windows machines are all
running XP, etc. (and haven't run Steve Gibson's excellent "unPnP"
program -- highly recommended if you are forced to run Windows XP at
all.) Only you know your site well enough to decide, but querying IP
ports sounds like about the best way to me.
Windows Messenger Service is another port you can try. I don't think
that is used in Samba (pre 3.0 anyway). Port 135 I believe. The "spam
port."
Chris
-----
Chris Olive
chris -at- --spammers-are-________-- technologEase -dot- com
http://www.technologEase.com
(pronounced "technologies")
------------------------------
Date: 13 Feb 2004 10:24:22 -0800
From: a_gilotra@yahoo.com (funtoosh)
Subject: open pipe vs signals causing problems ?
Message-Id: <5fe73253.0402131024.64ce8151@posting.google.com>
Hi
I am using latest PERL provided with REDHAT 9.
I use this snippet of perl in t.pl
$SIG{'TERM'}=\&doItNow ;
$anotherProgram=$ARGV[0];
open (AP,"$anotherProgram |") or die "$_ \n" ;
sub doItNow {
print "called doItNow \n ";
}
and I run it as follows at xterm prompt :
perl t.pl "../working/nameoftheprogram" &
So, I put it under background.
Now I do ps at the same prompt and I see the process id of perl script
and the anotherProgram.
Now, when I send signal SIGTERM to the perl script, it DOES NOT call
the installed handler
kill -15 <process-id of the perl script>
Any clue ?
Sorry, for dumb question :( but this post is the only hope left to me.
thx
------------------------------
Date: 13 Feb 2004 18:42:54 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: open pipe vs signals causing problems ?
Message-Id: <u9hdxukefn.fsf@wcl-l.bham.ac.uk>
a_gilotra@yahoo.com (funtoosh) writes:
> I am using latest PERL
It's Perl not PERL.
> provided with REDHAT 9.
Perhaps it would help those of us who use SuSE or a different version
of RedHat even some other *nix is you were to say what version of Perl
that is since this is marginally more likely to be a Perl issue than
an OS issue.
At least show us the first line form "perl -v" and maybe even selected
highlights of "perl -V" if you suspect this could be platform-related
(and that wouldn't be a ureasonable supposition),
> I use this snippet of perl in t.pl
>
> $SIG{'TERM'}=\&doItNow ;
> $anotherProgram=$ARGV[0];
>
> open (AP,"$anotherProgram |") or die "$_ \n" ;
>
> sub doItNow {
> print "called doItNow \n ";
> }
> perl t.pl "../working/nameoftheprogram" &
> Now, when I send signal SIGTERM to the perl script, it DOES NOT call
> the installed handler
Your test script works OK for me on 5.6.1 and 5.8.0 on SuSE Linux
(albeit with an old glibc).
The newsgroup comp.lang.perl does not exist (see FAQ). Please do not
start threads there.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 13 Feb 2004 18:55:59 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: open pipe vs signals causing problems ?
Message-Id: <c0j6jv$89c$1@wisteria.csv.warwick.ac.uk>
[comp.lang.perl removed: it has been defunct for a long time]
a_gilotra@yahoo.com (funtoosh) wrote:
> I am using latest PERL provided with REDHAT 9.
perldoc -q difference
> I use this snippet of perl in t.pl
>
> $SIG{'TERM'}=\&doItNow ;
> $anotherProgram=$ARGV[0];
>
> open (AP,"$anotherProgram |") or die "$_ \n" ;
You mean $!.
Don't put "\n" on the end od die messages: it removes valuable data.
> sub doItNow {
> print "called doItNow \n ";
Fix your indenting.
Don't put a space after the newline: that's just silly.
> }
>
> and I run it as follows at xterm prompt :
> perl t.pl "../working/nameoftheprogram" &
This will exit immediately: as soon as it has opened the file, it
falls of the end of the program and stops.
> So, I put it under background.
>
> Now I do ps at the same prompt and I see the process id of perl script
> and the anotherProgram.
>
> Now, when I send signal SIGTERM to the perl script, it DOES NOT call
> the installed handler
Well,
~% perl -le'
$SIG{TERM} = sub { print "got SIGTERM" };
open my $AP, "cat /etc/passwd |" or die $!;
sleep 99999;
' &
[1] 24236
~% kill -TERM 24236
~% got SIGTERM
[1] + done perl
works for me... what does the *rest* of your script say?
Ben
--
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else * ben@morrow.me.uk
------------------------------
Date: 13 Feb 2004 08:41:33 -0800
From: kprunell@microsoft.com (KP)
Subject: Re: parsing out all data between two words with multiple instances in a file.
Message-Id: <5ffb95e0.0402130841.454fd8ad@posting.google.com>
my $file;
my $fileinfo;
open (FILE, $FileHandle) || die;
while ($file = <FILE> )
{
if ($file =~ /.*<junk>.*/)
{
while ($fileinfo = <FILE>)
{
if ($fileinfo =~ /.*<pre>(.*)<\/pre>)
{
$FileList = $FileList .';'. $1;
}
}last;
}
}
print $FileList;
I'm trying to find a way to parse out all data between two words
within a file that contains multiple instances where important data
would be extracted out. The data file would look like such.
<blah>
<junk>
<pre>
...importantdata1
...importantdata2
...importantdata3
</pre>
<blah>
<junk>
<morejunk)
<pre>
...importantdata1
...importantdata2
...importantdata3
</pre>
</morejunk>
<blah>
Note: So afterwords the script would print something out to the
console like such.
...importantdata1
...importantdata2
...importantdata3
;
...importantdata1
...importantdata2
...importantdata3
Note: I would seprate those instances with a semi-colon. So later down
the road I could parse this data into seperate files.
------------------------------
Date: Fri, 13 Feb 2004 17:46:50 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: parsing out all data between two words with multiple instances in a file.
Message-Id: <c0j2ia$5d6$1@wisteria.csv.warwick.ac.uk>
kprunell@microsoft.com (KP) wrote:
> my $file;
> my $fileinfo;
>
> open (FILE, $FileHandle) || die;
Put $! and the name of the file in the error message.
> while ($file = <FILE> )
This reads FILE a line at a time. This means you will get at most one
of your <pre> tags at once... so it isn't going to work.
> {
> if ($file =~ /.*<junk>.*/)
> {
> while ($fileinfo = <FILE>)
> {
> if ($fileinfo =~ /.*<pre>(.*)<\/pre>)
> {
> $FileList = $FileList .';'. $1;
> }
> }last;
> }
> }
> print $FileList;
You want something more like (untested):
my $semi;
while (<FILE>) {
if (/<pre>/ .. m|</pre>|) {
if ($semi) {
print ";\n";
undef $semi;
}
print;
}
$semi = m|</pre>|;
}
Hmmm... I feel it should be possible to make than more elegant. Ah
well.
Ben
--
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ben@morrow.me.uk ~ Jorge Luis Borges, 'The Babylon Lottery'
------------------------------
Date: 13 Feb 2004 10:59:47 -0800
From: p805@yahoo.com (Pascal)
Subject: pattern mattching
Message-Id: <6850020.0402131059.51f51c0a@posting.google.com>
I'm try to match a pattern which doesn't really work for me kuz I just
want the pattern to appear once for example I have this line:
int x=0;x<=100;x++
I only what this: =, <=, ++
but I get all of these: =,<,=,<=,+,+,++
because In an other line I could have this: y=x+y then I would like to
have:=,+
but I can't seem to figure out what pattern to use That would work for
all situation.
------------------------------
Date: 13 Feb 2004 07:51:44 -0800
From: dbent@benefit-systems.com (Dan Bent)
Subject: Re: perl and db-module
Message-Id: <410b6b6e.0402130751.116b78ec@posting.google.com>
<snip>
> Right, what was the *exact* error message you got? Usually it's
> something like (example taken from a module I'm working on at the
> moment)
>
> Can't load '.../auto/Hook/CallStack/CallStack.so' for module
> Hook::CallStack: .../auto/Hook/CallStack/CallStack.so: undefined
> symbol: SvSetSv_nosteal at .../DynaLoader.pm line 229.
>
> If it is like this, the name of the undefined symbol is a big clue as
> to where the problem lies.
>
> Ben
Right on! Here's my error message.
Can't load '/usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/auto/Cyrus/IMAP/IMAP.so'
for module Cyrus::IMAP:
/usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/auto/Cyrus/IMAP/IMAP.so:
Undefined symbol "db_version" at
/usr/local/lib/perl5/5.8.3/i386-freebsd/DynaLoader.pm line 229.
at /usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Admin.pm
line 44
Compilation failed in require at
/usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Admin.pm
line 44.
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Admin.pm
line 44.
Compilation failed in require at
/usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Shell.pm
line 60.
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd/Cyrus/IMAP/Shell.pm
line 60.
Compilation failed in require.
BEGIN failed--compilation aborted.
I've been discussing this with a fellow who solved a similar problem
on Suse 7.1. He says:
i have de-installed berkeley 3.1 devel-packages (comes with suse
standard-install). after that - cyradm runs fine. i think it was the
additional installation of an different berkeley-version that course
the problem. the devel-pkg make some sym-links for berkeley < 3.1 ->
and that's the prob!
So, we're clearly on the trail. I just need to learn how to identify,
and un-install the offending berkeley db libraries. I installed
Berkeley 4.2 earlier in this process, and I'm afraid I might break
something if I am not careful.
Thanks for your help in this, by the way. I have a Camel book (it's
good read for a technical manual), and I'm learning about perl
------------------------------
Date: Fri, 13 Feb 2004 17:31:48 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: perl and db-module
Message-Id: <c0j1m4$4s0$1@wisteria.csv.warwick.ac.uk>
dbent@benefit-systems.com (Dan Bent) wrote:
> Can't load '/.../auto/Cyrus/IMAP/IMAP.so' for module Cyrus::IMAP:
> /.../auto/Cyrus/IMAP/IMAP.so: Undefined symbol "db_version" at
> /.../DynaLoader.pm line 229.
>
> I've been discussing this with a fellow who solved a similar problem
> on Suse 7.1. He says:
> i have de-installed berkeley 3.1 devel-packages (comes with suse
> standard-install). after that - cyradm runs fine. i think it was the
> additional installation of an different berkeley-version that course
> the problem. the devel-pkg make some sym-links for berkeley < 3.1 ->
> and that's the prob!
>
> So, we're clearly on the trail. I just need to learn how to identify,
> and un-install the offending berkeley db libraries. I installed
> Berkeley 4.2 earlier in this process, and I'm afraid I might break
> something if I am not careful.
It certainly looks like the db libs are the problem... on my machine,
I have 3 versions installed: libdb-1.so with no symbol db_version,
libdb-3.2.so with db_version, libdb-4.0.so with db_version_4000, and a
bunch of symlinks. The headers for db4 have
#define db_version db_version_4000
so I wonder if this may be part of your problem... What versions do
you have installed, and what db_version symbols do they define (nm -D
/usr/lib/libdb-1.so | grep db_version)? Also, which libs is IMAP.so
trying to load (ldd /.../Cyrus/IMAP/IMAP.so | grep db)?
I suspect that in your friend's case, IMAP.so was built against db <
3.1 and thus it failed, whereas yours is built against db-3.*, and
thus is looking for a db_version rather than a db_version_4000 symbol;
the answer if this is the case is to rebuild IMAP.so against the
currently installed libraries.
Ben
--
If you put all the prophets, | You'd have so much more reason
Mystics and saints | Than ever was born
In one room together, | Out of all of the conflicts of time.
ben@morrow.me.uk |----------------+---------------| The Levellers, 'Believers'
------------------------------
Date: 13 Feb 2004 08:01:19 -0800
From: clemenr@wmin.ac.uk (Ross Clement)
Subject: Perl for processing XML
Message-Id: <e5b5d377.0402130801.24bb0bf9@posting.google.com>
Hi. I'm going to add a lecture on XML processing in Perl to my
(university) Perl course. I was just wondering if anyone would like to
recommend their favourite modules and libraries for XML. I assure
people that I'm not as lazy as I sound, and will be surveying the
libraries myself, but will probably not consider everything. No
guarantees that I'll cover what people recommend (there being only
limited time in a single lecture), but I would appreciate any
suggestions.
Cheers,
Ross-c
------------------------------
Date: Fri, 13 Feb 2004 20:37:36 +0100
From: Michel Rodriguez <mirod@xmltwig.com>
Subject: Re: Perl for processing XML
Message-Id: <c0j3lq$e2o$1@news-reader1.wanadoo.fr>
Ross Clement wrote:
> Hi. I'm going to add a lecture on XML processing in Perl to my
> (university) Perl course. I was just wondering if anyone would like to
> recommend their favourite modules and libraries for XML. I assure
> people that I'm not as lazy as I sound, and will be surveying the
> libraries myself, but will probably not consider everything. No
> guarantees that I'll cover what people recommend (there being only
> limited time in a single lecture), but I would appreciate any
> suggestions.
You can have a look at those:
The perl-XML FAQ: http://perl-xml.sourceforge.net/faq/
Kip Hampton's column on XML.com: http://www.xml.com/pub/au/83
The "Ways to Rome" series: http://xmltwig.com/article/index_wtr.html
And of course you can guess what my favourite module is from my .sig ;--)
--
Michel Rodriguez
Perl & XML
http://www.xmltwig.com
------------------------------
Date: Fri, 13 Feb 2004 10:49:24 -0800
From: Arvin Portlock <apollock11@hotmail.com>
Subject: Re: Perl usage these days?
Message-Id: <c0j67o$re4$2@agate.berkeley.edu>
Anecdotally, I tend to rely on new programming books hitting
the book stores. There are more new perl books nowdays than
there ever were. Lots more C# and .NET. Lots more Java. But
a LOT less C and C++.
> On Wed, 11 Feb 2004, Brian wrote:
>
>
> >Sites listing the popularity of Perl and other languages:
> >
> >http://www.faqs.org/docs/artu/ch14s05.html
> >http://www.tiobe.com/tpci.htm
> >http://www.thebobo.com/language_popularity.php
> >
>
>
> IANAS, but http://www.tiobe.com/tiobe_index/images/tpci_trends.gif, for
> example, doesn't strike me as an indication that Perl is particularly
> losing ground.
>
> Thanks, for the links. Obviously, I could search these out myself, too.
> I personally don't, however, particularly see a point in it. :-)
>
> Regards,
>
> Brad
------------------------------
Date: Fri, 13 Feb 2004 16:48:53 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Problem opening sed pipe
Message-Id: <rbsp205p7vn0eq8u3imueo7vp3unh8r54o@4ax.com>
On 12 Feb 2004 17:41:39 -0800, bill.standke@medica.com (freewilly3d)
wrote:
>I'm trying to open the following pipe in perl open(SASPS,"ps -
>ef|sed 's/^\(.\{32\}\) /\1/; s/^ *$/*/'|grep sas| sort +0 -1 -d +7 -
>8 -d +4 -5 -d +6 -7 -d |") and get a sed error returned. The command
Grrrr! What the f**king point is there in using sed in a pipe in a
perl script?!? Do it all in perl, period!
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: 13 Feb 2004 06:40:58 -0800
From: chris.tunnecliff@markelintl.com (Chris)
Subject: Reading html into a source file
Message-Id: <b8146f1.0402130640.4ea9625@posting.google.com>
Apologies for the mail but this is driving me crazy. I'm trying to
read an external html file into an array and then check for a sub
string in the array. The only problem is that the html file is not
getting loaded into either the array or a text file. I have tried the
following:
#!/usr/local/bin/perl
print "Content-Type: text/plain\n\n";
use LWP::Simple;
$content = get ("http://www.webbuyeruk.co.uk/index.htm");
print " This is Content:\n\n $content \n\n";
exit;
(above as seen in google postings) but no contents appear on my
screen? Any help appreciated! I'm using perl 5.8 on windows 2K.
Regards,
Chris.
------------------------------
Date: Sat, 14 Feb 2004 01:22:42 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Reading html into a source file
Message-Id: <c0iq4u$16uva3$1@ID-202028.news.uni-berlin.de>
Chris wrote:
> #!/usr/local/bin/perl
Unix shebang line
>I'm using perl 5.8 on windows 2K.
Windows operating system??
gtoomey
------------------------------
Date: Fri, 13 Feb 2004 17:16:00 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: Reading html into a source file
Message-Id: <Xns948E7CC9158C9dkwwashere@216.168.3.30>
chris.tunnecliff@markelintl.com (Chris) wrote:
> Apologies for the mail but this is driving me crazy. I'm trying to
> read an external html file into an array and then check for a sub
> string in the array. The only problem is that the html file is not
> getting loaded into either the array or a text file. I have tried the
> following:
>
> #!/usr/local/bin/perl
If you're running this as CGI under Apache this might be a problem. Apache
actually uses the #! line. perl.exe will process any switches on the #!
line but will otherwise ignore it IIRC.
> print "Content-Type: text/plain\n\n";
> use LWP::Simple;
> $content = get ("http://www.webbuyeruk.co.uk/index.htm");
> print " This is Content:\n\n $content \n\n";
> exit;
>
> (above as seen in google postings) but no contents appear on my
> screen? Any help appreciated! I'm using perl 5.8 on windows 2K.
Runs fine for me at the command line under Windows XP Pro. It's not your
program, so it must be something with your web server, i.e; not a Perl
problem.
--
David Wall
------------------------------
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 6129
***************************************