[26948] in Perl-Users-Digest
Perl-Users Digest, Issue: 8911 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 1 18:05:39 2006
Date: Wed, 1 Feb 2006 15:05:12 -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 Wed, 1 Feb 2006 Volume: 10 Number: 8911
Today's topics:
eval-Question <kigar@gmx.net>
Re: eval-Question <1usa@llenroc.ude.invalid>
How to create a regexp reference <news@chaos-net.de>
Re: How to create a regexp reference <jgibson@mail.arc.nasa.gov>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 1 Feb 2006 22:46:44 +0100
From: "Reinhard Glauber" <kigar@gmx.net>
Subject: eval-Question
Message-Id: <43e12c46$0$16303$9b4e6d93@newsread4.arcor-online.net>
SSBoYXZlIGEgc3ViIGNhbGxlZCAiaW5zZXJ0Ii4NCkluIHRoZSBtYWluIC0gUHJvZ3JhbW0gSSBj
YWxsIHRoaXMgc3Vicm91dGluZS4gVGhlIFByb2JsZW0gaXMsIHRoYXQgSSBnZXQgYW4gIERCLUVy
cm9ybWVzc2FnZS4NClRoYXQncyBzb21ldGhpbmcgSSBkb24ndCB3YW50LiBUaGF0J3MgdGhlIHJl
YXNvbiB3aHkgSSB0cmllZCB0byB3cml0ZSB0aGUgY29kZSB3aXRoICJldmFsIi4NClRoZSBlcnJv
ciBvY2N1cmVzLCB3aGVuIHRoZXJlIGlzIGEgIGR1cGxpY2F0ZSB2YWx1ZS4NClRoZSBlcnJvciBp
cyBub3QgdGhlIFByb2JsZW0uIFRoZSBQcm9ibGVtIGlzLCB0aGF0IEkgZG9udCB3YW50IFBlcmwg
dG8gd3JpdGUgbWUgYWxsIHRoZSB0aW1lIHRoaXMgRXJyb3Jjb2RlLg0KQSBzaW1wbGUgIkVycm9y
IiBpcyBlbm91Z2ggZm9yIG1lLi4uDQpTbyBsb29rIGF0IHRoZSBDb2RlLi4uDQoNCnN1YiBpbnNl
cnQNCnsNCiAuLi4uLi4uLg0KDQogZXZhbCB7DQoNCiRkYmggPSBEQkktPmNvbm5lY3QoJ0RCSTpt
eXNxIGJsYWJsYScpOw0KbXkgJHNxbCA9ICJJTlNFUlQgSU5UTyBibGFibGEiOyANCm15ICRzdGgg
PSAkZGJoLT5wcmVwYXJlKCAkc3FsICk7IA0KJHN0aC0+ZXhlY3V0ZSgpOw0KICAgICAgICAgIA0K
ICAgICB9Ow0KDQppZiAoISRAKSB7ICRpc29rID0gIi4uLiBva1xuIjt9DQppZiAoJEApICB7JGlz
b2sgPSAiRXJyb3JcbiI7fQ0KDQp9ICMgZW5kIG9mIHN1Yg0KDQoNCiAkcmVzID0gaW5zZXJ0ICgk
dmFsdWUpOw0KIHByaW50ICRpc29rOw0KDQoNCg0KQW55IEhpbnRzIGZvciBhIFBlcmwtTmV3Ymll
ID8/DQoNClRoYW5rcyBhIGxvdA==
------------------------------
Date: Wed, 01 Feb 2006 22:02:13 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: eval-Question
Message-Id: <Xns975DAD633A6C7asu1cornelledu@127.0.0.1>
"Reinhard Glauber" <kigar@gmx.net> wrote in
news:43e12c46$0$16303$9b4e6d93@newsread4.arcor-online.net:
> I have a sub called "insert".
> In the main - Programm I call this subroutine. The Problem is, that I
> get an DB-Errormessage. That's something I don't want. That's the
> reason why I tried to write the code with "eval". The error occures,
> when there is a duplicate value. The error is not the Problem. The
> Problem is, that I dont want Perl to write me all the time this
> Errorcode. A simple "Error" is enough for me...
> So look at the Code...
>
> sub insert
> {
> ........
>
> eval {
>
> $dbh = DBI->connect('DBI:mysq blabla');
What is the specific blabla you use in this instance?
Have you read the posting guidelines posted here regularly? They contain
invaluable information on how to compose a post that conveys information
that helps us diagnose the problem.
Have you read the DBI documentation?
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Wed, 1 Feb 2006 21:01:09 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: How to create a regexp reference
Message-Id: <slrndu24s5.k0g.news@maki.homeunix.net>
hello together,
how do I create a regexp reference?
I checked perldoc perlref and perldoc -q 'reference' but I could not
find anything appropriate.
I want to use WWW::Google::SiteMap::Robot and the documentation is not
very detailed.
The url restrictions can be given as regexp reference but there are no
examples.
Any help will be appreciated.
Best regards
Martin
--
perl -e '$S=[[73,116,114,115,31,96],[108,109,114,102,99,112],
[29,77,98,111,105,29],[100,93,95,103,97,110]];
for(0..3){for$s(0..5){print(chr($S->[$_]->[$s]+$_+1))}}'
------------------------------
Date: Wed, 01 Feb 2006 13:05:10 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: How to create a regexp reference
Message-Id: <010220061305101919%jgibson@mail.arc.nasa.gov>
In article <slrndu24s5.k0g.news@maki.homeunix.net>, Martin Kissner
<news@chaos-net.de> wrote:
> hello together,
>
> how do I create a regexp reference?
> I checked perldoc perlref and perldoc -q 'reference' but I could not
> find anything appropriate.
>
> I want to use WWW::Google::SiteMap::Robot and the documentation is not
> very detailed.
> The url restrictions can be given as regexp reference but there are no
> examples.
>
> Any help will be appreciated.
The documentation for WWW::Google::SiteMap::Robot contains this example:
my $robot = WWW::Google::SiteMap::Robot->new(
domain => 'www.jasonkohles.com',
restrict => qr{^http://www.jasonkohles.com/},
...
);
and some confusing descriptions about what the restrict entry may
contain:
"restrict();
Get/Set the url restrictions. The restriction list can be any of
the following:
A list reference (or a list
A list reference is assumed to contain a list of any of
the following types.
A regexp reference
If you give it a regexp reference, then the regexp will be
applied to the URL about to be spidered, if the regexp matches,
then the URL will be skipped."
Since the example only contains a single item, a regexp, you can try
that. Either put in a literal regexp as shown in the example or a
variable containging a regexp:
my $regexp = qr{^http://www.jasonkohles.com/};
I don't know why the author refers to "regexp references". Apparently,
if you want to have more than one restrict clause, you would supply a
list reference:
my $robot = WWW::Googl::SiteMap::Robot->new(
domain => '...',
restrict => [ $regexp1, $regexp2, sub coderef{...} ],
);
If you really need a reference to a regexp, you can try using a
reference to a regexp value or variable:
my $regexp_ref = \qr{...};
my $regexp_ref = \$regexp;
See 'perldoc perlop' and search for 'Quote' for the qr{} operator.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
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 8911
***************************************