[29581] in Perl-Users-Digest
Perl-Users Digest, Issue: 825 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 6 06:09:39 2007
Date: Thu, 6 Sep 2007 03:09:05 -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 Thu, 6 Sep 2007 Volume: 11 Number: 825
Today's topics:
Re: Have any Asynchronous I/O module in win32? <noreply@gunnar.cc>
Re: Have any Asynchronous I/O module in win32? <sonet.all@gmail.com>
How to do Asynchronous I/O in win32? <sonet.all@gmail.com>
Memory management and type casting in XS <wenbinye@gmail.com>
new CPAN modules on Thu Sep 6 2007 (Randal Schwartz)
Re: Perl variable to shell command...? <josef.moellers@fujitsu-siemens.com>
Re: Perl variable to shell command...? <klaus03@gmail.com>
Re: Problem with sending mail using perl <shafa.fahad@gmail.com>
Re: Trying to access DB <jluis@agujeronegro.escomposlinux.org>
Re: UPDATE DB <rkb@i.frys.com>
Re: UPDATE DB <uri@stemsystems.com>
Re: UPDATE DB <uri@stemsystems.com>
Re: UPDATE DB <stoupa@practisoft.cz>
Re: UPDATE DB <uri@stemsystems.com>
What is required for perl scripts to run correct when l deanjones7@gmail.com
Re: What is required for perl scripts to run correct wh <peter@makholm.net>
Re: What is required for perl scripts to run correct wh usenet@DavidFilmer.com
Re: Why use die? <bik.mido@tiscalinet.it>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 06 Sep 2007 07:35:31 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Have any Asynchronous I/O module in win32?
Message-Id: <5k9htcF2n549U1@mid.individual.net>
sonet wrote:
... a multi-posted question. Don't do that!
http://lipas.uwasa.fi/~ts/http/crospost.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 6 Sep 2007 14:43:42 +0800
From: "sonet" <sonet.all@gmail.com>
Subject: Re: Have any Asynchronous I/O module in win32?
Message-Id: <fbo7it$qko$1@netnews.hinet.net>
No. I do not multi-posted question. The two question is difference.
One is asking for need a module.And another is asking for how to do
Asynchronous I/O in win32?
If you think that the two question is the same then everyone muti-post
question.
Because everyone is asking for a question that i don't know or i want to
know ...
"Gunnar Hjalmarsson" <noreply@gunnar.cc>
???????:5k9htcF2n549U1@mid.individual.net...
> sonet wrote:
>
> ... a multi-posted question. Don't do that!
>
> http://lipas.uwasa.fi/~ts/http/crospost.html
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 6 Sep 2007 12:41:43 +0800
From: "sonet" <sonet.all@gmail.com>
Subject: How to do Asynchronous I/O in win32?
Message-Id: <fbo0e7$8j8$1@netnews.hinet.net>
Have any modules like http://www.summerblue.net/computing/libiocp/index.html
for win32-perl ?
------------------------------
Date: Thu, 06 Sep 2007 01:46:45 -0700
From: Ye Wenbin <wenbinye@gmail.com>
Subject: Memory management and type casting in XS
Message-Id: <1189068405.840817.318310@d55g2000hsg.googlegroups.com>
Hi,
I am going to write a XS binding for an C library. I have some
question about the memory management and type casting. For example,
the library contain a string and list module. I bind DESTROY to
str_del function which free the string struct, that is ok when using
the string module alone. But if with list, there comes the problem. If
I use list_get to fetch a element from the list which is a string and
the result is a perl object in a scalar. When the object go out of the
scope, it will invoke DESTROY function. But the list still has the
pointer to the string. Because the string module don't have reference
count, so it is not posible to decide whether free the object or not
in DESTROY function. So how to deal with this situation?
I try two method which seem can work but not very good.
First is add a flag in perl string object which tell DESTROY to
release the memory or not. Second one is making the list_get function
return a copy of the string. Both are not generic solution for all C
struct and may introduce bugs in using the object.
Another question is how to convert data in list. The element in the
list is a void* pointer. There should be a convertor to make the
pointer understand to perl. What I plan to do is add an attribute
"type" to the list object which is the package name for the pointer.
So output from C code can use sv_setref_pv to make the pointer blessed
to the package, input from the perl is the IV value of the object
reference which can convert to a pointer. Is there other way to
do that?
Thanks for advice!
Regards,
Ye Wenbin
------------------------------
Date: Thu, 6 Sep 2007 04:42:14 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Sep 6 2007
Message-Id: <JnxJqE.1AI3@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Archive-Unzip-Burst-0.02_01
http://search.cpan.org/~smueller/Archive-Unzip-Burst-0.02_01/
Featureless but fast ZIP extraction
----
Business-PayPal-EWP-0.03
http://search.cpan.org/~isaac/Business-PayPal-EWP-0.03/
Perl extension for PayPal's Encrypted Website Payments
----
Business-PayPal-EWP-1.00
http://search.cpan.org/~isaac/Business-PayPal-EWP-1.00/
Perl extension for PayPal's Encrypted Website Payments
----
CPAN-Reporter-0.99_06
http://search.cpan.org/~dagolden/CPAN-Reporter-0.99_06/
Adds CPAN Testers reporting to CPAN.pm
----
CPAN-Reporter-0.99_07
http://search.cpan.org/~dagolden/CPAN-Reporter-0.99_07/
Adds CPAN Testers reporting to CPAN.pm
----
Catalyst-Model-DBIC-Schema-QueryLog-0.03
http://search.cpan.org/~fayland/Catalyst-Model-DBIC-Schema-QueryLog-0.03/
DBIx::Class::QueryLog Model Class
----
Class-Component-0.06
http://search.cpan.org/~yappo/Class-Component-0.06/
pluggable component framework
----
DBIx-ORM-Declarative-0.20
http://search.cpan.org/~jschneid/DBIx-ORM-Declarative-0.20/
Perl extension for object-oriented database access
----
DBIx-ORM-Declarative-0.21
http://search.cpan.org/~jschneid/DBIx-ORM-Declarative-0.21/
Perl extension for object-oriented database access
----
DJabberd-VCard-LDAP-0.03
http://search.cpan.org/~urkle/DJabberd-VCard-LDAP-0.03/
LDAP VCard Provider for DJabberd
----
Devel-PerlySense-0.01_08
http://search.cpan.org/~johanl/Devel-PerlySense-0.01_08/
IntelliSense for Perl
----
Devel-PerlySense-0.01_09
http://search.cpan.org/~johanl/Devel-PerlySense-0.01_09/
IntelliSense for Perl
----
HTML-Display-0.37
http://search.cpan.org/~corion/HTML-Display-0.37/
display HTML locally in a browser
----
HTML-Menu-TreeView-0.8
http://search.cpan.org/~lze/HTML-Menu-TreeView-0.8/
----
IPC-MorseSignals-0.08
http://search.cpan.org/~vpit/IPC-MorseSignals-0.08/
Communicate between processes with Morse signals.
----
InSilicoSpectro-Databanks-0.0.21
http://search.cpan.org/~alexmass/InSilicoSpectro-Databanks-0.0.21/
parsing protein/nucleotides sequence databanks (fasta, uniprot...)
----
JavaScript-SpiderMonkey-0.19
http://search.cpan.org/~tbusch/JavaScript-SpiderMonkey-0.19/
Perl interface to the JavaScript Engine
----
Nagios-Plugin-0.20
http://search.cpan.org/~tonvoon/Nagios-Plugin-0.20/
A family of perl modules to streamline writing Nagios plugins
----
Net-CouchDb-0.01
http://search.cpan.org/~dgl/Net-CouchDb-0.01/
Interface to CouchDb
----
Net-DNS-DynDNS-0.95
http://search.cpan.org/~ddick/Net-DNS-DynDNS-0.95/
Update dyndns.org with correct ip address for your domain name
----
OIS-0.03
http://search.cpan.org/~slanning/OIS-0.03/
Perl binding for the OIS C++ input framework
----
POE-Component-MessageQueue-0.1.6
http://search.cpan.org/~dsnopek/POE-Component-MessageQueue-0.1.6/
A POE message queue that uses STOMP for the communication protocol
----
POE-Component-Server-DNS-0.11
http://search.cpan.org/~bingos/POE-Component-Server-DNS-0.11/
A non-blocking, concurrent DNS server POE component
----
POE-Loop-Event_Lib-0.001_01
http://search.cpan.org/~blblack/POE-Loop-Event_Lib-0.001_01/
a bridge that supports Event::Lib from POE
----
PSQL-Query-0.01_02
http://search.cpan.org/~ecarroll/PSQL-Query-0.01_02/
A framework to parse pg-query plans via the output of Explain / Explain Analyze
----
SQL-DB-0.04
http://search.cpan.org/~mlawren/SQL-DB-0.04/
Perl interface to SQL Databases
----
SQL-Script-0.01
http://search.cpan.org/~adamk/SQL-Script-0.01/
An object representing a series of SQL statements, normally stored in a file
----
SQL-Script-0.02
http://search.cpan.org/~adamk/SQL-Script-0.02/
An object representing a series of SQL statements, normally stored in a file
----
Socket-Class-1.1.0
http://search.cpan.org/~chrmue/Socket-Class-1.1.0/
A class to communicate with sockets
----
Sys-Syslog-0.19
http://search.cpan.org/~saper/Sys-Syslog-0.19/
Perl interface to the UNIX syslog(3) calls
----
Sys-Syslog-0.20
http://search.cpan.org/~saper/Sys-Syslog-0.20/
Perl interface to the UNIX syslog(3) calls
----
Text-Diff-Parser-0.07
http://search.cpan.org/~gwyn/Text-Diff-Parser-0.07/
Parse patch files containing unified and standard diffs
----
Text-Scan-0.29
http://search.cpan.org/~tbusch/Text-Scan-0.29/
Fast search for very large numbers of keys in a body of text.
----
Tk-TextHighlight-1.0.2
http://search.cpan.org/~turnerjw/Tk-TextHighlight-1.0.2/
a TextUndo widget with syntax highlighting capabilities.
----
VCI-0.1.0_3
http://search.cpan.org/~mkanat/VCI-0.1.0_3/
A generic interface for interacting with various version-control systems.
----
WWW-Mechanize-TreeBuilder-1.00001
http://search.cpan.org/~ash/WWW-Mechanize-TreeBuilder-1.00001/
----
XML-MyXML-0.0985
http://search.cpan.org/~karjala/XML-MyXML-0.0985/
A simple-to-use XML module, for parsing and creating XML documents
----
XML-Trivial-0.02
http://search.cpan.org/~pajout/XML-Trivial-0.02/
The trivial tool representing parsed XML as tree of read only objects.
----
XML-XML2JSON-0.01
http://search.cpan.org/~ken/XML-XML2JSON-0.01/
Convert XML into JSON (and back again) using XML::LibXML
----
threads-1.65
http://search.cpan.org/~jdhedden/threads-1.65/
Perl interpreter-based threads
----
threads-shared-1.13
http://search.cpan.org/~jdhedden/threads-shared-1.13/
Perl extension for sharing data structures between threads
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 06 Sep 2007 08:54:47 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Perl variable to shell command...?
Message-Id: <fbo87s$ot1$1@nntp.fujitsu-siemens.com>
Benoit Lefebvre wrote:
> On Sep 4, 5:55 pm, Rohit <rohit.makas...@gmail.com> wrote:
>=20
>>Hi, I am trying to use perl local variable with shell command call.
>>
>>Example:
>>
>>$filename=3DmyFile.txt
>>
>>@fileRec=3D`cat $filename`;
>>
>>Here shell is not able to identify $filename variable. Any idea or
>>suggestions?
>>I am using array of filename so it is necessary for me to use cat with
>>variable.
>>
>>Thanks in advance.
>>
>>~Rohit
>=20
>=20
> I like to do it that way
>=20
> $filename =3D "myfile.txt";
>=20
> $cmd =3D "cat ". $filename;
>=20
> @fileRec =3D `$cmd`;
While this is how I'd do it, too (I can then show the entire command for =
debugging purposes), it won't help the OP as the net result won't be any =
different.
Most likeley, the file isn't accessable, e.g. because it's in a=20
different path or it is read-protected, or the OP isn't telling us=20
everything, as his code is not valid Perl anyway.
--=20
These are my personal views and not those of Fujitsu Siemens Computers!
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html
------------------------------
Date: Thu, 06 Sep 2007 01:05:29 -0700
From: Klaus <klaus03@gmail.com>
Subject: Re: Perl variable to shell command...?
Message-Id: <1189065929.268346.84790@k79g2000hse.googlegroups.com>
On Sep 5, 1:10 am, Rohit <rohit.makas...@gmail.com> wrote:
> On Sep 4, 3:25 pm, use...@DavidFilmer.com wrote:
>
> > On Sep 4, 2:55 pm, Rohit <rohit.makas...@gmail.com> wrote:
>
> > > Hi, I am trying to use perl local variable with shell command call.
> > > Example:
> > > $filename=myFile.txt
>
> > You should quote your string literals.
[ ...snip... ]
> > my $filename = '/path/to/my/file.txt';
You have replaced your string literal myFile.txt
by a single variable $symbolFile[$fileCount]:
> $symbolFile = "$symbolFile[$fileCount]";
While you should quote string literals, you should *not* quote a
single variable.
See perlfaq 4: What's wrong with always quoting ``$vars''?
--
Klaus
------------------------------
Date: Thu, 06 Sep 2007 02:21:25 -0700
From: Kimi <shafa.fahad@gmail.com>
Subject: Re: Problem with sending mail using perl
Message-Id: <1189070485.302131.231680@y42g2000hsy.googlegroups.com>
On Sep 5, 9:48 pm, Ben Morrow <ben@morrow.me.uk> wrote:
> Quoth Kimi <shafa.fahad@gmail.com>:
>
>
>
> > On Sep 5, 8:14 pm, Benoit Lefebvre <benoit.lefeb...@gmail.com> wrote:
> > > On Sep 5, 11:12 am, Kimi <shafa.fa...@gmail.com> wrote:
>
> > > > While trying to use this simple unix command to send mail using perl
>
> > > > #!/usr/bin/perl
> > > > my $output =`echo Mailbody | mail afa...@VSNL.com`;
>
> > > > I am facing a strange issue where "afa...@VSNL.com" gets converted to
> > > > "afahad....@LocalHost.Local" and the mail is sent to it. Could some
> > > > one throw pointers to get rid of the issue.
>
> > > > The above unix code works perfectly well when executed separately and
> > > > send mail to afa...@VSNL.com
>
> > > Put a "\" in front of the "@"
>
> > > #!/usr/bin/perl
> > > my $output =`echo Mailbody | mail afa...\@VSNL.com`;
>
> > Thanks Benoit, That was helpful. But Is it how mail ids are supposed
> > to be used in perl in general. Suppose I am assigning the mail id to a
> > variable and want to use it,
>
> @VSNL is a variable. Variables interpolate in "" strings. If you had put
>
> use strict;
> use warnings;
>
> at the top of your script, Perl would have told you what was wrong.
>
> > Should it be again like,
>
> > #!/usr/bin/perl
> > $mail_id="afahad\@VSNL.com";
> > my $output =`echo Mailbody | mail $mail_id`;
>
> > Or is there a better way?
>
> This is a perfectly good way, yes. Slightly clearer might be
>
> $mail_id = 'afahad@VSNL.com';
>
> note that I no longer have to use \@ as single quotes don't expand
> variables.
>
> Ben
Thanks Ben.
-Kimi
------------------------------
Date: Thu, 06 Sep 2007 07:49:31 +0100
From: José Luis Pérez Diez <jluis@agujeronegro.escomposlinux.org>
Subject: Re: Trying to access DB
Message-Id: <VA.00000bdb.4eda22c1@agujeronegro.escomposlinux.org>
In article <1189006009.457673.103820@g4g2000hsf.googlegroups.com>,
JimJx wrote:
> Jose, for some reason, your gave me errors when I executed it.....
>
The newsreader that I'm using capitalizes letters after the dot and the
or operator was changed to Or.
------------------------------
Date: Wed, 05 Sep 2007 21:24:20 -0700
From: Ron Bergin <rkb@i.frys.com>
Subject: Re: UPDATE DB
Message-Id: <1189052660.526020.193550@22g2000hsm.googlegroups.com>
On Sep 5, 7:23 pm, "Petr Vileta" <sto...@practisoft.cz> wrote:
> JimJx wrote:
> > $ID does come from a SELECT. And I hate to show my ignorance here,
> > but how do I force $ID to integer?
>
> To convert "numeric string" to number I'm used to use
>
> $ID = "123"; # this is a string but contain digits only
> $ID *= 1; # now it is a integer number
>
> $ID = "123.45"; # this is a string but contain digits only and the decimal
> dot
> $ID *= 1; # now it is a float number
>
> --
>
> Petr Vileta, Czech republic
> (My server rejects all messages from Yahoo and Hotmail. Send me your mail
> from another non-spammer site please.)
It really depends on the context in which it's being used/evaluated.
use strict;
use warnings;
my $str = "123";
my $ID = "123"; # this is a string but contain digits only
$ID *= 1; # now it is a integer number
if($ID eq $str) {
print "$ID eq $str evaluated in string context\n";
}
if($ID == $str) {
print "$ID == $str evaluated in numerical context\n";
}
------------------------------
Date: Thu, 06 Sep 2007 04:28:32 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: UPDATE DB
Message-Id: <x7ir6ov2mn.fsf@mail.sysarch.com>
>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:
PV> JimJx wrote:
>> $ID does come from a SELECT. And I hate to show my ignorance here,
>> but how do I force $ID to integer?
>>
PV> To convert "numeric string" to number I'm used to use
PV> $ID = "123"; # this is a string but contain digits only
PV> $ID *= 1; # now it is a integer number
PV> $ID = "123.45"; # this is a string but contain digits only and the
PV> decimal dot
PV> $ID *= 1; # now it is a float number
neither of those is ever really needed. perl will convert strings
to/from numbers on demand. you are burning cpu cycles for no reason if
you add those conversion lines.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 06 Sep 2007 04:37:15 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: UPDATE DB
Message-Id: <x7sl5stnno.fsf@mail.sysarch.com>
>>>>> "J" == JimJx <webmaster@valleywebnet.com> writes:
J> On Sep 5, 10:23 pm, "Petr Vileta" <sto...@practisoft.cz> wrote:
>> JimJx wrote:
>> > $ID does come from a SELECT. And I hate to show my ignorance here,
>> > but how do I force $ID to integer?
>>
>> To convert "numeric string" to number I'm used to use
>>
>> $ID = "123"; # this is a string but contain digits only
>> $ID *= 1; # now it is a integer number
>>
>> $ID = "123.45"; # this is a string but contain digits only and the decimal
>> dot
>> $ID *= 1; # now it is a float number
J> Excellent Petr, thank you for that!
it is not excellent. see my other post. his conversion code is generally
not needed.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 6 Sep 2007 07:43:19 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: UPDATE DB
Message-Id: <fbo41r$2f9m$1@ns.felk.cvut.cz>
Uri Guttman wrote:
>>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:
>
>> JimJx wrote:
> >> $ID does come from a SELECT. And I hate to show my ignorance
> here, >> but how do I force $ID to integer?
> >>
>> To convert "numeric string" to number I'm used to use
>
>> $ID = "123"; # this is a string but contain digits only
>> $ID *= 1; # now it is a integer number
>
>> $ID = "123.45"; # this is a string but contain digits only and the
>> decimal dot
>> $ID *= 1; # now it is a float number
>
> neither of those is ever really needed. perl will convert strings
> to/from numbers on demand. you are burning cpu cycles for no reason if
> you add those conversion lines.
>
Hmm, interesting ;-) I tested it now and you are right, but in some case, I
can't to remember which, the == comparation fail. Maybe in old version of
Perl, I really don' know now. For this I began to use "brute force" type
conversion. Maybe I vaste CPU time but I'm sure that I have variable type
what I need for other operations.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
------------------------------
Date: Thu, 06 Sep 2007 06:39:30 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: UPDATE DB
Message-Id: <x7bqcgthzw.fsf@mail.sysarch.com>
>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:
PV> Uri Guttman wrote:
>>
>>> $ID = "123"; # this is a string but contain digits only
>>> $ID *= 1; # now it is a integer number
>>
>>> $ID = "123.45"; # this is a string but contain digits only and the
>>> decimal dot
>>> $ID *= 1; # now it is a float number
>>
>> neither of those is ever really needed. perl will convert strings
>> to/from numbers on demand. you are burning cpu cycles for no reason if
>> you add those conversion lines.
>>
PV> Hmm, interesting ;-) I tested it now and you are right, but in some
PV> case, I can't to remember which, the == comparation fail. Maybe in old
PV> version of Perl, I really don' know now. For this I began to use "brute
PV> force" type conversion. Maybe I vaste CPU time but I'm sure that I have
PV> variable type what I need for other operations.
but you never need it. never. perl converts according the operation
being done. if you use a numeric op like == or + or * it will convert
any strings to numbers. and perl converts any numbers to strings when
they are used with ops like . "" and print. the only issue is if you
have a string which isn't a proper number. perl will convert it until it
runs into a bad character and will issue a warning if enabled. your
manual conversions are just doing it a step before perl will do it
itself.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 06 Sep 2007 01:06:40 -0700
From: deanjones7@gmail.com
Subject: What is required for perl scripts to run correct when launched from rc scripts on HPUX 11?
Message-Id: <1189066000.429586.237660@w3g2000hsg.googlegroups.com>
I have a perl script that's part of a pipe (i.e. program | perl
script). The perl script reads the stdout of the program on the other
end of the pipe and logs/emails any error messages.
This works OK if run from the command line. However, the perl script
fails without any errors when the system is booted. There's nothing
useful in /etc/rc.log (just some "not a typewriter" messages since the
shell script that starts the above does an su first).
I suspect its a file handle issue but I don't know enough about perl
to figure out what.
Can anyone help?
------------------------------
Date: Thu, 06 Sep 2007 08:13:22 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: What is required for perl scripts to run correct when launched from rc scripts on HPUX 11?
Message-Id: <87abs0yzx9.fsf@hacking.dk>
deanjones7@gmail.com writes:
> This works OK if run from the command line. However, the perl script
> fails without any errors when the system is booted. There's nothing
> useful in /etc/rc.log (just some "not a typewriter" messages since the
> shell script that starts the above does an su first).
And you have made sure that perl is actually run. The $PATH might not
be set to the same set og directories as when you are logged in. Try
use the full path to perl in you script.
# This is not a perl answer
//Makholm
------------------------------
Date: Thu, 06 Sep 2007 08:17:09 -0000
From: usenet@DavidFilmer.com
Subject: Re: What is required for perl scripts to run correct when launched from rc scripts on HPUX 11?
Message-Id: <1189066629.846939.148880@r34g2000hsd.googlegroups.com>
On Sep 6, 1:06 am, deanjon...@gmail.com wrote:
> the perl script fails without any errors when the system is booted.
That means NOTHING. How do you know it fails? How do you even know
it runs? Why would you think it should run on a reboot?
With no code and a meaningless description of the problem I doubt
anyone is psychic enough to advise you of what your actual problem is.
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Thu, 06 Sep 2007 10:46:46 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Why use die?
Message-Id: <bafvd3djm8mc93c7uv7e3vs3hd5k8fek3o@4ax.com>
On Sat, 1 Sep 2007 16:34:28 +0200, "Petr Vileta"
<stoupa@practisoft.cz> wrote:
>For web scripts I use some like
>
>my $ok=1;
>open(TMP, '>'.$file) or sub {print "Can't create temporary file.<br>Please
>contact webmaster"; $ok=0;}
>if($ok) { # then write something to file}
Pardon me for pointing out, but if you really do this, then you're
doing something utterly wrong. The sub code is never executed on
failure. You would have to dereference it with ->(). Even so, it looks
really awkward.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
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 825
**************************************