[30020] in Perl-Users-Digest
Perl-Users Digest, Issue: 1263 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 7 16:09:43 2008
Date: Thu, 7 Feb 2008 13:09: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 Thu, 7 Feb 2008 Volume: 11 Number: 1263
Today's topics:
Re: eval EXPR with maximum execution time? alx__21@hotmail.com
Re: eval EXPR with maximum execution time? alx__21@hotmail.com
Re: eval EXPR with maximum execution time? alx__21@hotmail.com
Re: eval EXPR with maximum execution time? alx__21@hotmail.com
Re: eval EXPR with maximum execution time? alx__21@hotmail.com
Re: eval EXPR with maximum execution time? xhoster@gmail.com
Re: eval EXPR with maximum execution time? <ced@blv-sam-01.ca.boeing.com>
Re: moving binary data from one RDBMS to Other <m@rtij.nl.invlalid>
Re: problem with '>' character <jd@somewhere.com>
Re: problem with '>' character <abigail@abigail.be>
Re: problem with '>' character <jd@somewhere.com>
Re: problem with '>' character <tadmc@seesig.invalid>
Re: problem with '>' character <peter@makholm.net>
Re: problem with '>' character <jimsgibson@gmail.com>
Re: problem with '>' character <uri@stemsystems.com>
ssh using system call <seema_coma@yahoo.co.in>
Re: ssh using system call <glennj@ncf.ca>
XS code <robert.henniger@googlemail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 7 Feb 2008 06:23:56 -0800 (PST)
From: alx__21@hotmail.com
Subject: Re: eval EXPR with maximum execution time?
Message-Id: <2ae964b1-b8dc-4be0-a640-01931c30a01d@i7g2000prf.googlegroups.com>
> I don't think that that would be a problem for IO. OS-level IO calls
> will get interrupted, and perl will then either not resume them (having the
> Perl-level call set $! and return failure) or perl will execute the sig
> handler and then try to resume the call. In either case, a sig handler
> that dies should break out of the eval promptly. It is things
> that spent a long time at the perl level (as opposed to the system level,
> or the Perl level), like sorts and large regex, that have the problem with
> safe signals.
>
> Xho
How much of a problem? For my application a second either way won't
matter much, but it definitely needs to be stopped at some point
(infinite loop issues).
------------------------------
Date: Thu, 7 Feb 2008 06:24:03 -0800 (PST)
From: alx__21@hotmail.com
Subject: Re: eval EXPR with maximum execution time?
Message-Id: <40691d01-02c4-428e-8815-f2ff29abf3e1@u10g2000prn.googlegroups.com>
> I don't think that that would be a problem for IO. OS-level IO calls
> will get interrupted, and perl will then either not resume them (having the
> Perl-level call set $! and return failure) or perl will execute the sig
> handler and then try to resume the call. In either case, a sig handler
> that dies should break out of the eval promptly. It is things
> that spent a long time at the perl level (as opposed to the system level,
> or the Perl level), like sorts and large regex, that have the problem with
> safe signals.
>
> Xho
How much of a problem? For my application a second either way won't
matter much, but it definitely needs to be stopped at some point
(infinite loop issues).
------------------------------
Date: Thu, 7 Feb 2008 06:25:07 -0800 (PST)
From: alx__21@hotmail.com
Subject: Re: eval EXPR with maximum execution time?
Message-Id: <71c0b478-eac2-4848-9391-a708d54568dd@q77g2000hsh.googlegroups.com>
> I don't think that that would be a problem for IO. OS-level IO calls
> will get interrupted, and perl will then either not resume them (having the
> Perl-level call set $! and return failure) or perl will execute the sig
> handler and then try to resume the call. In either case, a sig handler
> that dies should break out of the eval promptly. It is things
> that spent a long time at the perl level (as opposed to the system level,
> or the Perl level), like sorts and large regex, that have the problem with
> safe signals.
>
> Xho
How much of a problem? For my application a second either way won't
matter much, but it definitely needs to be stopped at some point
(infinite loop issues).
------------------------------
Date: Thu, 7 Feb 2008 07:47:04 -0800 (PST)
From: alx__21@hotmail.com
Subject: Re: eval EXPR with maximum execution time?
Message-Id: <f5782b8f-2ebe-4ed9-b025-a2647d05d52c@h11g2000prf.googlegroups.com>
> I don't think that that would be a problem for IO. OS-level IO calls
> will get interrupted, and perl will then either not resume them (having the
> Perl-level call set $! and return failure) or perl will execute the sig
> handler and then try to resume the call. In either case, a sig handler
> that dies should break out of the eval promptly. It is things
> that spent a long time at the perl level (as opposed to the system level,
> or the Perl level), like sorts and large regex, that have the problem with
> safe signals.
>
> Xho
How much of a problem? For my application a second either way won't
matter much, but it definitely needs to be stopped at some point
(infinite loop issues).
------------------------------
Date: Thu, 7 Feb 2008 07:49:43 -0800 (PST)
From: alx__21@hotmail.com
Subject: Re: eval EXPR with maximum execution time?
Message-Id: <be7a3f83-0a66-4fcf-a8eb-d3b14d683b7f@s13g2000prd.googlegroups.com>
heh . . . my refreshing to see if anybody responded caused a new
message to be tacked on each time -- new post data to the server.
Sorry. Poor design, Google.
------------------------------
Date: 07 Feb 2008 16:11:20 GMT
From: xhoster@gmail.com
Subject: Re: eval EXPR with maximum execution time?
Message-Id: <20080207111122.222$7G@newsreader.com>
alx__21@hotmail.com wrote:
> > I don't think that that would be a problem for IO. OS-level IO calls
> > will get interrupted, and perl will then either not resume them (having
> > the Perl-level call set $! and return failure) or perl will execute the
> > sig handler and then try to resume the call. In either case, a sig
> > handler that dies should break out of the eval promptly. It is things
> > that spent a long time at the perl level (as opposed to the system
> > level, or the Perl level), like sorts and large regex, that have the
> > problem with safe signals.
> >
> > Xho
>
> How much of a problem? For my application a second either way won't
> matter much, but it definitely needs to be stopped at some point
> (infinite loop issues).
I don't think perl is likely to have any infinite loops in its internals.
Presumably the infinite loop is in your Perl code, not in the C code which
implements perl. So an alarm with a handler that dies should work.
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Thu, 7 Feb 2008 08:41:35 -0800 (PST)
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: eval EXPR with maximum execution time?
Message-Id: <02df8384-7a19-4e16-821a-919b0d062e9c@s37g2000prg.googlegroups.com>
On Feb 7, 7:47 am, alx_...@hotmail.com wrote:
> > I don't think that that would be a problem for IO. OS-level IO calls
> > will get interrupted, and perl will then either not resume them (having the
> > Perl-level call set $! and return failure) or perl will execute the sig
> > handler and then try to resume the call. In either case, a sig handler
> > that dies should break out of the eval promptly. It is things
> > that spent a long time at the perl level (as opposed to the system level,
> > or the Perl level), like sorts and large regex, that have the problem with
> > safe signals.
>
> > Xho
>
> How much of a problem? For my application a second either way won't
> matter much, but it definitely needs to be stopped at some point
> (infinite loop issues).
Maybe Xho or someone else is more informed on this issue but itseems
to me that there shouldn't be a problem. An alarm will still be
delivered even if the opcode sequence is lengthy. Maybe the delivery
will occur a bit after the alarm. The exact timing of safe signals is
still murky to me. There's a many-to-one ratio of opcodes to actual
high level code so I suspect the alarm signal is unlikely to be
delayed excessively. Dunno for sure. Still only the first of multiple
same-type signals occurring during a delay is delivered (others are
lost). I could see that being problematic in the case of child signals
for instance but not an alarm. Any other potential problems...?
--
Charles DeRykus
------------------------------
Date: Thu, 7 Feb 2008 18:14:32 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: moving binary data from one RDBMS to Other
Message-Id: <pan.2008.02.07.17.14.32@rtij.nl.invlalid>
On Thu, 07 Feb 2008 01:50:31 -0800, Perl Lover wrote:
> In article <pan.2008.02.06.21.14.21@rtij.nl.invlalid>, Martijn Lievaart
> says...
>>
>>On Wed, 06 Feb 2008 11:44:16 -0800, Perl Lover wrote:
>>
>>> In article <pan.2008.02.06.19.39.39@rtij.nl.invlalid>, Martijn
>>> Lievaart says...
>>>
>>>>I bet you are using windows and are seeing LF -> CRLF conversion. Try
>>>>opening your files as binary files. See perldoc -f open and perldoc -f
>>>>binmode.
>>>
>>> No. The files are created on Solaris and are used locally.
>>
>>In that case, try to post a small but complete example that exhibits the
>>problem.
>
> First of all thanks for your effort to help.
>
> What exactly you want? Code or data.
>
> The binary data contains
> non ascii, non printable characters.
> The source database stores it in a char field of 512 length. The target
> database (oracle) stores it as a BLOB field because that is the only
> field type that can store binary data.
A small example may be difficult, but you could fill a string with the
data as a literal string, write it out, read it back in and compare if it
is equal.
But try this first.
First try to od -x the file and see if it contains exactly what it
should. If it doesn't there's a problem getting the data from the
database.
Now read the data back and dump that (Data::Dumper will probably do,
otherwise convert to hex with a small loop). Still the same? Then your
problem is in storing the data.
A possible problem with reading from the database is character set. A
VARCHAR is not ment to hold binary data and you may run into characterset
conversions here, or something else.
HTH,
M4
------------------------------
Date: 07 Feb 2008 11:21:20 GMT
From: JD <jd@somewhere.com>
Subject: Re: problem with '>' character
Message-Id: <47aae9b0$0$24089$e4fe514c@dreader15.news.xs4all.nl>
On 2008-02-07, Abigail <abigail@abigail.be> wrote:
> _
> JD (jd@somewhere.com) wrote on VCCLXXIII September MCMXCIII in
><URL:news:47aae1d8$0$5124$e4fe514c@dreader25.news.xs4all.nl>:
> &&
> && Hello,
> &&
> && I have a html-like string, and would like to remove the left part,
> && including the leftmost '>'. I use s/^.*>//;
> && but it does not work as expected (neither does s/^.*\076//;).
> && Something funny is going on, but I do not know what. It looks like a
> && shift-operator comes into action.
> &&
> && Can someone tell me what the problem might be, and how to get it right?
>
>
> Could you give an example of what you did, and what you had expected?
> I know one thing that's wrong about s/^.*>//, but that's not "funny",
> nor does it have anything to do with a shift-operator.
code:
while (<IN>) {
print "$_ \n";
s/^.*\076//;
print "$_ \n";
....
output:
[long string, ending with] size="1">PASTEL
ASTEL
note the space
------------------------------
Date: 07 Feb 2008 11:57:25 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: problem with '>' character
Message-Id: <slrnfqlsh4.ifi.abigail@alexandra.abigail.be>
_
JD (jd@somewhere.com) wrote on VCCLXXIII September MCMXCIII in
<URL:news:47aae9b0$0$24089$e4fe514c@dreader15.news.xs4all.nl>:
!! On 2008-02-07, Abigail <abigail@abigail.be> wrote:
!! > _
!! > JD (jd@somewhere.com) wrote on VCCLXXIII September MCMXCIII in
!! ><URL:news:47aae1d8$0$5124$e4fe514c@dreader25.news.xs4all.nl>:
!! > &&
!! > && Hello,
!! > &&
!! > && I have a html-like string, and would like to remove the left part,
!! > && including the leftmost '>'. I use s/^.*>//;
!! > && but it does not work as expected (neither does s/^.*\076//;).
!! > && Something funny is going on, but I do not know what. It looks like a
!! > && shift-operator comes into action.
!! > &&
!! > && Can someone tell me what the problem might be, and how to get it right?
!! >
!! >
!! > Could you give an example of what you did, and what you had expected?
!! > I know one thing that's wrong about s/^.*>//, but that's not "funny",
!! > nor does it have anything to do with a shift-operator.
!!
!! code:
!! while (<IN>) {
!! print "$_ \n";
!! s/^.*\076//;
!! print "$_ \n";
!! ....
!!
!! output:
!! [long string, ending with] size="1">PASTEL
!! ASTEL
That seems like a bug.
I suggest you construct a small, *self contained* program that exhibits
the bug; test it against the newest versions of Perl (5.10.0, 5.8.8),
and if it is still there, use perlbug to report it.
Abigail
--
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
------------------------------
Date: 07 Feb 2008 12:26:44 GMT
From: JD <jd@somewhere.com>
Subject: Re: problem with '>' character
Message-Id: <47aaf904$0$22800$e4fe514c@dreader18.news.xs4all.nl>
On 2008-02-07, Abigail <abigail@abigail.be> wrote:
> _
>
> That seems like a bug.
>
Found it: It was a a file from a MS-Windows system, with CRLF line ends.
chomp removed the LF, but the CR was still there :(
dos2unix solved it.
------------------------------
Date: Thu, 7 Feb 2008 06:57:33 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: problem with '>' character
Message-Id: <slrnfqm01t.hpq.tadmc@tadmc30.sbcglobal.net>
Peter Makholm <peter@makholm.net> wrote:
> JD <jd@somewhere.com> writes:
>
>> I have a html-like string, and would like to remove the left part,
>> including the leftmost '>'. I use s/^.*>//;
>> but it does not work as expected (neither does s/^.*\076//;).
>
> Do you string consist of multipli lines, then you'll have to remember
> that . doesn't matches the newline character unless you put you regexp
> in multi line mode (with either m og s - read the docs).
^^^^^^^^^^^^^
Only one of those makes dot match a newline...
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Thu, 07 Feb 2008 13:11:55 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: problem with '>' character
Message-Id: <87fxw4hpwk.fsf@hacking.dk>
Tad J McClellan <tadmc@seesig.invalid> writes:
>> Do you string consist of multipli lines, then you'll have to remember
>> that . doesn't matches the newline character unless you put you regexp
>> in multi line mode (with either m og s - read the docs).
> Only one of those makes dot match a newline...
Yes, I'm quite aware of that and the documentation will surly tell you
which one.
//Makholm
------------------------------
Date: Thu, 07 Feb 2008 10:52:22 -0800
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: problem with '>' character
Message-Id: <070220081052221400%jimsgibson@gmail.com>
In article <87fxw4hpwk.fsf@hacking.dk>, Peter Makholm
<peter@makholm.net> wrote:
> Tad J McClellan <tadmc@seesig.invalid> writes:
>
> >> Do you string consist of multipli lines, then you'll have to remember
> >> that . doesn't matches the newline character unless you put you regexp
> >> in multi line mode (with either m og s - read the docs).
>
> > Only one of those makes dot match a newline...
>
> Yes, I'm quite aware of that and the documentation will surly tell you
> which one.
The documentation will surely reveal which one, but it will do not so
in a surly manner, surely. :)
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Thu, 07 Feb 2008 19:23:26 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: problem with '>' character
Message-Id: <x71w7oy3iq.fsf@mail.sysarch.com>
>>>>> "PM" == Peter Makholm <peter@makholm.net> writes:
PM> Tad J McClellan <tadmc@seesig.invalid> writes:
>>> Do you string consist of multipli lines, then you'll have to remember
>>> that . doesn't matches the newline character unless you put you regexp
>>> in multi line mode (with either m og s - read the docs).
>> Only one of those makes dot match a newline...
PM> Yes, I'm quite aware of that and the documentation will surly tell you
PM> which one.
so why do you mention both and not report what the docs said there?
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Architecture, Development, Training, Support, Code Review ------
----------- Search or Offer Perl Jobs ----- http://jobs.perl.org ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Thu, 7 Feb 2008 06:12:13 -0800 (PST)
From: seema <seema_coma@yahoo.co.in>
Subject: ssh using system call
Message-Id: <76c8b5d2-a579-4450-ba67-e9b786382ca7@s12g2000prg.googlegroups.com>
Hi all,
I am new to perl programming on unix, I am trying to ssh to another
box, here is the code I have written,
#!/usr/bin/perl
system ("ssh mygoodbox; mv x y; exit;) ;
it does ssh sucessfully and mv command also works fine. But controle
doesnt return even though exit is there. It just stays in that
machine. Can some body explain how to handle
this. I am using perl 5.8
Please help
seema
------------------------------
Date: 7 Feb 2008 14:31:48 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: ssh using system call
Message-Id: <slrnfqm5ik.8bv.glennj@smeagol.ncf.ca>
At 2008-02-07 09:12AM, "seema" wrote:
> Hi all,
>
> I am new to perl programming on unix, I am trying to ssh to another
> box, here is the code I have written,
>
> #!/usr/bin/perl
> system ("ssh mygoodbox; mv x y; exit;) ;
Missing quote.
> it does ssh sucessfully and mv command also works fine. But controle
> doesnt return even though exit is there. It just stays in that
> machine. Can some body explain how to handle
> this. I am using perl 5.8
If you expect the mv and exit to happen on 'mygoodbox', you're mistaken.
I assume you want the mv command to execute on the remote machine.
See ssh(1) man page:
system qw(ssh mygoodbox mv x y);
--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
------------------------------
Date: Thu, 7 Feb 2008 09:32:39 -0800 (PST)
From: Robert Henniger <robert.henniger@googlemail.com>
Subject: XS code
Message-Id: <d777e0df-ac2d-4237-bc1f-879ef2a907eb@h11g2000prf.googlegroups.com>
Hi to all.
Today I tried to compile my script to an .NET DLL.
This script uses HTML::Template::Pro. The compile process works well.
When I try to use this dll then I get the following message:
Unhandled Exception: PerlRuntime.PerlException: Can't locate auto/HTML/
Template/Pro/query.al in @INC (@INC contains: .... .)
I ve searched for this file but i found nothing. I also contacted the
author of the module but i am still waiting for a feedback.
Maybe someone can help me and explain what a .al file do and why it is
needed.
Is there something i have to change when i use modules with xs parts?
The same script with HTML::Template works well but is very slow.
Thats why i wanna try this module.
Thanks in advance.
Best regards
Robert
PS:
+ PDK 7.0
+ Perl 5.8.6 Build 806
+ HTML::Template::Pro 0.61 (i know that there is a update, but i have
not found a ppd for it)
------------------------------
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 V11 Issue 1263
***************************************