[25874] in Perl-Users-Digest
Perl-Users Digest, Issue: 8104 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 23 06:05:27 2005
Date: Mon, 23 May 2005 03:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 23 May 2005 Volume: 10 Number: 8104
Today's topics:
Error Handler in Embedded Perl <guenther.sohler@newlogic.com>
Re: Fw: evidence john bokma al jazeera programmer ? <josef.moellers@fujitsu-siemens.com>
Re: Fw: evidence john bokma al jazeera programmer ? (Anno Siegel)
Re: Fw: evidence john bokma al jazeera programmer ? <tassilo.von.parseval@rwth-aachen.de>
Re: Fw: evidence john bokma al jazeera programmer ? <tassilo.von.parseval@rwth-aachen.de>
Re: Fw: evidence john bokma al jazeera programmer ? (Anno Siegel)
Re: Fw: evidence proving john bokma al jazeera programm (remove withoutspam to e-mail)
Re: How do I pattern match variables in Perl? <joe@inwap.com>
Re: HTML::TableExtract punctuation parsing <see.sig@rochester.rr.com>
Regex help: delete text only if not within quotation ma <usenet739_yahoo_com_au>
Replace substring in all values of a hash array? <spam@noreply.org>
Re: Replace substring in all values of a hash array? <nobull@mail.com>
Re: Replace substring in all values of a hash array? (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 23 May 2005 11:54:14 +0200
From: Guenther Sohler <guenther.sohler@newlogic.com>
Subject: Error Handler in Embedded Perl
Message-Id: <pan.2005.05.23.09.54.14.13344@newlogic.com>
Hallo,
I have a embedded perl in my c program.
Whenever perl creates an error(eg function not found)
it quits my whole program. i dont want this.
I want a callbackfunction to be called instead.
How can I register such a callback function ?
Where can I find documentation on that ?
------------------------------
Date: Mon, 23 May 2005 08:41:01 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Fw: evidence john bokma al jazeera programmer ?
Message-Id: <d6rtph$42j$1@nntp.fujitsu-siemens.com>
Hendrik Maryns wrote:
> William Baker uitte de volgende tekst op 21/05/2005 17:38:
>=20
>>
>>
>>
>> please add forward to alt.security.terrorism if information
>=20
>=20
> lol!
>=20
> Als ik hier nu even iets in het Nederlands schrijf, ben ik dan ook=20
> verdacht?
Of course, but if you post in English, you are even more suspect, since=20
the terrorists have been known to operate (and, before, get their=20
knowlege to do so) in the US.
At least _I_ won't be suspected to be a islamistic fundamentalist=20
terrorist, I'm most likely already marked to be a nazi B-{(
OTOH, since a lot of the i.f.t. hid in Germany, I may qualify for being=20
a left-wing RAF terrorist, a right wing nazi and an islamistic=20
fundamentalist terrorist all in one person!
ROTFLMAO,
Josef
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: 23 May 2005 07:30:27 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Fw: evidence john bokma al jazeera programmer ?
Message-Id: <d6s0qj$ei7$2@mamenchi.zrz.TU-Berlin.DE>
Josef Moellers <josef.moellers@fujitsu-siemens.com> wrote in comp.lang.perl.misc:
[...]
> a left-wing RAF terrorist, a right wing nazi and an islamistic
> fundamentalist terrorist all in one person!
Horst Mahler!
Anno
------------------------------
Date: Mon, 23 May 2005 09:44:50 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: Fw: evidence john bokma al jazeera programmer ?
Message-Id: <slrnd932fi.14i.tassilo.von.parseval@localhost.localdomain>
["Followup-To:" header set to comp.lang.perl.modules.]
Also sprach Anno Siegel:
> Josef Moellers <josef.moellers@fujitsu-siemens.com> wrote in comp.lang.perl.misc:
>
> [...]
>
>> a left-wing RAF terrorist, a right wing nazi and an islamistic
>> fundamentalist terrorist all in one person!
>
> Horst Mahler!
I was aware of him having a history both in the RAF scene as well as
recently in certain right-wing parties (NPD as far as I recall). But he
has now become an islamic terrorist as well?
Impressive. ;-)
Tassilo
PS: F'up set due to off-topicness.
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
Date: Mon, 23 May 2005 09:48:10 +0200
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: Fw: evidence john bokma al jazeera programmer ?
Message-Id: <slrnd932lq.14i.tassilo.von.parseval@localhost.localdomain>
Also sprach Tassilo v. Parseval:
> ["Followup-To:" header set to comp.lang.perl.modules.]
This is nonsense. I don't know why slrn put that in.
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
Date: 23 May 2005 08:56:34 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Fw: evidence john bokma al jazeera programmer ?
Message-Id: <d6s5s2$h8h$1@mamenchi.zrz.TU-Berlin.DE>
Tassilo v. Parseval <tassilo.von.parseval@rwth-aachen.de> wrote in comp.lang.perl.misc:
> ["Followup-To:" header set to comp.lang.perl.modules.]
> Also sprach Anno Siegel:
> > Josef Moellers <josef.moellers@fujitsu-siemens.com> wrote in comp.lang.perl.misc:
> >
> > [...]
> >
> >> a left-wing RAF terrorist, a right wing nazi and an islamistic
> >> fundamentalist terrorist all in one person!
> >
> > Horst Mahler!
>
> I was aware of him having a history both in the RAF scene as well as
> recently in certain right-wing parties (NPD as far as I recall). But he
> has now become an islamic terrorist as well?
>
> Impressive. ;-)
He spent three or four months in a Palestinian guerrilla training
camp (1970, with Meinhoff, Ensslin and Baader). Close enough for
a quip.
I never liked the guy, even when he and I were in the same political
camp.
Anno
------------------------------
Date: Mon, 23 May 2005 10:27:53 +0200
From: "Stefan Koopmanschap (remove withoutspam to e-mail)" <stefan@stefankoopmanschapwithoutspam.nl>
Subject: Re: Fw: evidence proving john bokma al jazeera programmer?
Message-Id: <d6s51q$26$1@reader11.wxs.nl>
William Baker wrote:
> nonsense and much humor
MUAHAHAHAHAHAHAHAHA
------------------------------
Date: Sun, 22 May 2005 18:32:02 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: How do I pattern match variables in Perl?
Message-Id: <mt-dnVVAuP0GrwzfRVn-iQ@comcast.com>
Graham wrote:
> I want to match $variable in an array. My script is as follows:-
> The array definitely contains $variable, but I get no match.
Are you trying to match "dollar-sign vee ay ar eye ay bee el ee"
or are you trying to match the string held in the variable $variable
or are you trying to match a regex which is stored in $variable?
$line =~ /$variable/; # $variable holds a regex
$line =~ /\$variable\b/; # Looking for dollar-sign vee ...
$line =~ /\Q$variable/; # $variable hold text with punctuation
> Can someone put me out of my misery, please?
First you have to tell us exactly what you're trying to do.
It sounds like you yourself are not sure what you want.
-Joe
------------------------------
Date: Mon, 23 May 2005 02:25:28 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: HTML::TableExtract punctuation parsing
Message-Id: <sabke.15920$tM3.4680@twister.nyroc.rr.com>
Maqo wrote:
> Is there any way to prevent HTML::TableExtract from mangling punctuation
> in parsed text? For example, the below code is parsing “don’t come” in
> the target URL as “don’t come”. Is it something about the
> document encoding, or a limitation of the module?
...
>$URL =
"http://www.pimco.com/LeftNav/Late+Breaking+Commentary/IO/2005/IO+May-June+2005.htm";
My browser says that web page is Unicode with UTF-8 encoding. If
you process it as Unicode with UTF-8 encoding, you'll probably be
fine. Otherwise, as you noted, you'll get gibberish. If you
view the results of your print() with a Unicode with UTF-8
viewer, you should be OK, as you are doing nothing that should
alter the non-ASCII characters.
Your web browser is probably a good candidate for such a viewer,
providing you set the right character code/encoding.
...
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Mon, 23 May 2005 18:40:17 +1000
From: "Scott Bass" <usenet739_yahoo_com_au>
Subject: Regex help: delete text only if not within quotation marks
Message-Id: <429196f2$0$15240$5a62ac22@per-qv1-newsreader-01.iinet.net.au>
my $string1 = 'titles "statement";';
my $string2 = 'titles "statement"; * comment ;';
my $string3 = "titles '* ; statement';";
my $string4 = "titles '* ; statement'; * comment ;";
$_ = $string4;
s#\*\s*(.+?)\s*\; (?!(["'])(.+?)\1)##;
print "$_\n";
I want to delete text delimited by * ;, but only if * ; does not occur
within quotation marks.
After substitution, strings 1&3 should remain unmodified, strings 2&4 should
equal strings 1&3 respectively. Additional testcase (not listed) is comment
string at the beginning of the string.
I thought I was on the right track with negative lookahead assertion???
Regards,
Scott
------------------------------
Date: Mon, 23 May 2005 08:16:11 +0000
From: michael <spam@noreply.org>
Subject: Replace substring in all values of a hash array?
Message-Id: <d6rsfc$v8n$03$1@news.t-online.com>
I would like to replace substrings in hash values, for example:
%flora_and_fauna =
('z0.html' => 'flora_and_fauna_green.gif alt=flora and fauna',
'z1.html' => 'pretty_flower_green.gif alt=pretty flowers',
'z2.html' => 'deadly_vines_green.gif alt=deadly vines');
# the above values being linked images rather than text links
# sometime later in the script I run an if statement to check
# if filename is in array for setting relevant CSS html class
if(exists($flora_and_fauna{$current::page})){
$class::value = "yellow";
}
else {
$class::value = "green";
}
Depending on the outcome of above if block, I would like to modify the
substring "_green.gif" to become "_yellow.gif" in all values of the
%flora_and_fauna array. How by using regex and replace can this be done?
Thanks,
Michael
--
Your object is to save the world, while still leading a pleasant life.
------------------------------
Date: Mon, 23 May 2005 08:11:18 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Replace substring in all values of a hash array?
Message-Id: <d6rvmp$eo3$1@redhat2.bham.ac.uk>
michael wrote:
> I would like to replace substrings in hash values, for example:
>
> %flora_and_fauna =
> ('z0.html' => 'flora_and_fauna_green.gif alt=flora and fauna',
> 'z1.html' => 'pretty_flower_green.gif alt=pretty flowers',
> 'z2.html' => 'deadly_vines_green.gif alt=deadly vines');
>
> # the above values being linked images rather than text links
>
> # sometime later in the script I run an if statement to check
> # if filename is in array for setting relevant CSS html class
>
> if(exists($flora_and_fauna{$current::page})){
> $class::value = "yellow";
> }
> else {
> $class::value = "green";
> }
Abusing package variables like this is bad.
> Depending on the outcome of above if block, I would like to modify the
> substring "_green.gif" to become "_yellow.gif" in all values of the
> %flora_and_fauna array. How by using regex and replace can this be done?
A regex is just a way of describing a pattern to match. To do a
substution you need the sustitution operator s/// or you can use substr().
s/_green\.gif/_yellow.gif/;
To apply this to all the values in %flora_and_fauna:
s/_green\.gif/_yellow.gif/ for values %flora_and_fauna;
------------------------------
Date: 23 May 2005 07:25:11 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Replace substring in all values of a hash array?
Message-Id: <d6s0gn$ei7$1@mamenchi.zrz.TU-Berlin.DE>
michael <spam@noreply.org> wrote in comp.lang.perl.misc:
> I would like to replace substrings in hash values, for example:
>
> %flora_and_fauna =
> ('z0.html' => 'flora_and_fauna_green.gif alt=flora and fauna',
> 'z1.html' => 'pretty_flower_green.gif alt=pretty flowers',
> 'z2.html' => 'deadly_vines_green.gif alt=deadly vines');
>
> # the above values being linked images rather than text links
Irrelevant.
> # sometime later in the script I run an if statement to check
> # if filename is in array for setting relevant CSS html class
>
> if(exists($flora_and_fauna{$current::page})){
> $class::value = "yellow";
$flora_and_fauna{$current::page} =~ s/green\.gif/yellow.gif/;
> }
> else {
> $class::value = "green";
> }
>
> Depending on the outcome of above if block, I would like to modify the
> substring "_green.gif" to become "_yellow.gif" in all values of the
All values? In your code you are only considering one value at a
time.
> %flora_and_fauna array. How by using regex and replace can this be done?
Add the line as indicated.
If you have a list @pages of all pages, this is more compact than
your loop:
s/green\.gif/yellow.gif/ for
@flora_and_fauna{ grep exists $flora_and_fauna{ $_}, @pages};
(Code untested)
Anno
------------------------------
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 8104
***************************************