[29017] in Perl-Users-Digest
Perl-Users Digest, Issue: 261 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 24 03:10:04 2007
Date: Sat, 24 Mar 2007 00:09:07 -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 Sat, 24 Mar 2007 Volume: 11 Number: 261
Today's topics:
Re: HTML::Mason and User site folders <macshaggy@carolina.rr.com>
Re: Login time quota <keeling@spots.ab.ca>
Re: Login time quota <keeling@spots.ab.ca>
new CPAN modules on Sat Mar 24 2007 (Randal Schwartz)
Re: parsing a tab delimited or CSV, but keep the delimi <lew@nospam.lewscanon.com>
Re: parsing a tab delimited or CSV, but keep the delimi <lew@nospam.lewscanon.com>
Re: parsing a tab delimited or CSV, but keep the delimi <pats@acm.org>
Re: parsing a tab delimited or CSV, but keep the delimi <jurgenex@hotmail.com>
Re: parsing a tab delimited or CSV, but keep the delimi (Stefan Ram)
Replacing characters in file <anony-mouse@hole.in.the.wall.com>
Re: time structure without shift <mjcarman@mchsi.com>
Re: time structure without shift <stoupa@practisoft.cz>
Re: time structure without shift <mritty@gmail.com>
Re: Why can't we just change the signal disposition on <cdalten@gmail.com>
Re: Why can't we just change the signal disposition on <cdalten@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Mar 2007 18:55:58 -0700
From: "macshaggy" <macshaggy@carolina.rr.com>
Subject: Re: HTML::Mason and User site folders
Message-Id: <1174701357.943156.124190@b75g2000hsg.googlegroups.com>
On Mar 23, 8:45 pm, Mirco Wahab <wahab-m...@gmx.de> wrote:
>
> You need to set the "Mason Component root" for
> the Apache process:
> Example:
>
> PerlModule HTML::Mason::ApacheHandler
> ...
> PerlSetVar MasonCompRoot /Users/jbellew/Sites
> PerlSetVar MasonDataDir /var/cache/mason
> ...
> <FilesMatch "\.html$">
> SetHandler perl-script
> PerlHandler HTML::Mason::ApacheHandler
> </FilesMatch>
> ...
Thanks that makes sense. Next question, since when I read your answer
and saw the above example I had to hit myself upside the hed, I need
my Component Root Directory to be set to /usr/local/apache2/htdocs but
still have Mason process files from /Users/jbellew/Sites as well. Can
I have multiple Root directorys?
Thanks again,
J
------------------------------
Date: Sat, 24 Mar 2007 01:49:27 GMT
From: "s. keeling" <keeling@spots.ab.ca>
Subject: Re: Login time quota
Message-Id: <slrnf090t6.9vq.keeling@heretic.spots.ab.ca>
["Followup-To:" header set to comp.os.linux.misc.]
Koos Pol <koos@geen.spam>:
> After unfruitful debates with my teenage daughter about not spending too
> much time on her computer, I decided to take the more eh, pragmatic
s/pragmatic/fascist/
> approach. As I couldn't find any program that suites me, I've written a
> small Perl script that you can launch from your Un*x boot scripts.
> You can run it like
>
> login_quota -u mary -t 120 &
>
> This will make sure Mary does not spend more that her alloted 120
> minutes.
Why in the world would any parent do this to their kid? Because they
can?
> If anyone wants to steal or borrow it, please feel free. I would appreciate
_Good_ _God_, _no_.
Computers are many things, including mostly harmless fluff (myspace &
youtube), babysitter (WWW), entertainment (WWW), crass commercialism
(WWW), and educational (all of the above, perhaps excepting youtube).
Why is it so annoying to you for your teenage daughter to spend more
than an hour and a half doing that? Why do you consider it your right
to interfere with that? Isn't that better than an hour and a half on
a telephone babbling, "And I was like, ..."?
I wonder how much time Linus T. spent each day on his machine when he
was her age.
You parents can be such jerks sometimes. Leave the kid alone.
--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://www.spots.ab.ca/~keeling Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.
Spammers! http://www.spots.ab.ca/~keeling/emails.html
------------------------------
Date: Sat, 24 Mar 2007 01:54:20 GMT
From: "s. keeling" <keeling@spots.ab.ca>
Subject: Re: Login time quota
Message-Id: <slrnf0916c.9vq.keeling@heretic.spots.ab.ca>
["Followup-To:" header set to comp.os.linux.misc.]
Koos Pol <koos@geen.spam>:
> On zaterdag 17 maart 2007 16:40 grocery_stocker wrote:
> >
> > Sir,
> > I think you underestimate the power of a bored teenager.
>
> I know. I have one :-)
I sympathise with the bored teenager. I think her parent should get
out more often.
--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://www.spots.ab.ca/~keeling Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.
Spammers! http://www.spots.ab.ca/~keeling/emails.html
------------------------------
Date: Sat, 24 Mar 2007 04:42:09 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Mar 24 2007
Message-Id: <JFE529.13IA@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.
AI-Categorizer-0.09
http://search.cpan.org/~kwilliams/AI-Categorizer-0.09/
Automatic Text Categorization
----
Apache-DBI-1.06
http://search.cpan.org/~pgollucci/Apache-DBI-1.06/
Initiate a persistent database connection
----
Apache2-AuthCAS-0.1
http://search.cpan.org/~jhitt/Apache2-AuthCAS-0.1/
A configurable Apache authentication module that enables you to protect content on an Apache server using an existing JA-SIG CAS authentication server.
----
Bio-Grep-v0.4.0
http://search.cpan.org/~limaone/Bio-Grep-v0.4.0/
Perl extension for searching in Fasta files
----
Bio-Phylo-0.16_RC1
http://search.cpan.org/~rvosa/Bio-Phylo-0.16_RC1/
Phylogenetic analysis using perl.
----
Business-OnlinePayment-3.00_07
http://search.cpan.org/~ivan/Business-OnlinePayment-3.00_07/
Perl extension for online payment processing
----
CPANPLUS-0.77_06
http://search.cpan.org/~kane/CPANPLUS-0.77_06/
API & CLI access to the CPAN mirrors
----
CPANPLUS-0.77_07
http://search.cpan.org/~kane/CPANPLUS-0.77_07/
API & CLI access to the CPAN mirrors
----
Catalyst-Model-RDBO-0.01
http://search.cpan.org/~karman/Catalyst-Model-RDBO-0.01/
base class for Rose::DB::Object model
----
Catalyst-Model-SWISH-0.01
http://search.cpan.org/~karman/Catalyst-Model-SWISH-0.01/
Catalyst model for Swish-e
----
Class-DBI-utf8-0.2
http://search.cpan.org/~fotango/Class-DBI-utf8-0.2/
A Class:::DBI subclass that knows about UTF-8
----
Crypt-ECDSA-0.052
http://search.cpan.org/~billh/Crypt-ECDSA-0.052/
Elliptical Cryptography Digital Signature Algorithm
----
DBIx-Class-TimeStamp-0.02
http://search.cpan.org/~jshirley/DBIx-Class-TimeStamp-0.02/
----
DBIx-MyParse-0.81
http://search.cpan.org/~philips/DBIx-MyParse-0.81/
Perl API for MySQL's SQL Parser
----
Devel-PPPort-3.11_01
http://search.cpan.org/~mhx/Devel-PPPort-3.11_01/
Perl/Pollution/Portability
----
Email-AddressParser-0.02
http://search.cpan.org/~awkay/Email-AddressParser-0.02/
RFC 2822 Address Parsing and Creation
----
Email-AddressParser-0.03
http://search.cpan.org/~awkay/Email-AddressParser-0.03/
RFC 2822 Address Parsing and Creation
----
Email-Filter-1.031
http://search.cpan.org/~rjbs/Email-Filter-1.031/
Library for creating easy email filters
----
Email-Folder-0.853
http://search.cpan.org/~rjbs/Email-Folder-0.853/
read all the messages from a folder as Email::Simple objects.
----
Froody-42.034
http://search.cpan.org/~fotango/Froody-42.034/
Yet another XML web API framework
----
Google-Data-JSON-v0.0.5
http://search.cpan.org/~takeru/Google-Data-JSON-v0.0.5/
General XML-JSON converter based on Google Data APIs
----
HTML-ContentExtractor-0.01
http://search.cpan.org/~jzhang/HTML-ContentExtractor-0.01/
extract the main content from a web page by analysising the DOM tree!
----
HTTP-Body-0.7
http://search.cpan.org/~agrundma/HTTP-Body-0.7/
HTTP Body Parser
----
HTTP-Body-0.8
http://search.cpan.org/~agrundma/HTTP-Body-0.8/
HTTP Body Parser
----
IP-QQWry-v0.0.11
http://search.cpan.org/~sunnavy/IP-QQWry-v0.0.11/
a simple interface for QQWry IP database(file).
----
JSON-Any-1.00
http://search.cpan.org/~cthom/JSON-Any-1.00/
Wrapper Class for the myriad JSON classes.
----
JSON-XS-0.3
http://search.cpan.org/~mlehmann/JSON-XS-0.3/
JSON serialising/deserialising, done correctly and fast
----
JSON-XS-0.31
http://search.cpan.org/~mlehmann/JSON-XS-0.31/
JSON serialising/deserialising, done correctly and fast
----
Lingua-EN-Conjugate-0.22
http://search.cpan.org/~rwg/Lingua-EN-Conjugate-0.22/
Conjugation of English verbs
----
Lingua-EN-Conjugate-0.23
http://search.cpan.org/~rwg/Lingua-EN-Conjugate-0.23/
Conjugation of English verbs
----
Lingua-EN-Conjugate-0.24
http://search.cpan.org/~rwg/Lingua-EN-Conjugate-0.24/
Conjugation of English verbs
----
Mail-SpamAssassin-SimpleClient-0.002
http://search.cpan.org/~rjbs/Mail-SpamAssassin-SimpleClient-0.002/
easy client to SpamAssassin's spamd
----
Math-Numbers-0.000000001
http://search.cpan.org/~damog/Math-Numbers-0.000000001/
Methods for mathematical approaches of concepts of the number theory
----
Mobile-Messaging-ParlayX-0.0.2
http://search.cpan.org/~tchatzi/Mobile-Messaging-ParlayX-0.0.2/
Interface to ParlayX OSA.
----
Module-Build-Kwalitee-0.23
http://search.cpan.org/~fotango/Module-Build-Kwalitee-0.23/
Module::Build subclass with prepackaged tests
----
MogileFS-Utils-2.07
http://search.cpan.org/~bradfitz/MogileFS-Utils-2.07/
----
Mozilla-SourceViewer-0.05
http://search.cpan.org/~bosu/Mozilla-SourceViewer-0.05/
Perl extension to get current page source.
----
Nagios-Plugin-0.16b
http://search.cpan.org/~gavinc/Nagios-Plugin-0.16b/
a family of perl modules to streamline writing Nagios plugins
----
Nagios-Plugin-0.17
http://search.cpan.org/~gavinc/Nagios-Plugin-0.17/
a family of perl modules to streamline writing Nagios plugins
----
Net-SFTP-Foreign-0.90_18
http://search.cpan.org/~salva/Net-SFTP-Foreign-0.90_18/
Secure File Transfer Protocol client
----
Net-Twitter-1.04
http://search.cpan.org/~cthom/Net-Twitter-1.04/
Perl interface to twitter.com
----
POE-0.9989
http://search.cpan.org/~rcaputo/POE-0.9989/
portable multitasking and networking framework for Perl
----
POE-Event-Message-0.09
http://search.cpan.org/~ccobb/POE-Event-Message-0.09/
A generic messaging protocol
----
PTools-0.01
http://search.cpan.org/~ccobb/PTools-0.01/
Facilitates 'using' PTools utility modules
----
ProgressMonitor-0.04
http://search.cpan.org/~knth/ProgressMonitor-0.04/
a flexible and configurable framework for providing feedback on how a long-running task is proceeding.
----
Rose-HTMLx-Form-Field-Autocomplete-0.01
http://search.cpan.org/~karman/Rose-HTMLx-Form-Field-Autocomplete-0.01/
Ajax autocompletion for text fields
----
SWISH-API-Object-0.09
http://search.cpan.org/~karman/SWISH-API-Object-0.09/
return SWISH::API results as objects
----
Sort-SQL-0.01
http://search.cpan.org/~karman/Sort-SQL-0.01/
manipulate SQL sort strings
----
Template-TAL-0.91
http://search.cpan.org/~fotango/Template-TAL-0.91/
Process TAL templates with Perl
----
WWW-Search-2.491
http://search.cpan.org/~mthurn/WWW-Search-2.491/
Virtual base class for WWW searches
----
WWW-Search-Search-1.003
http://search.cpan.org/~mthurn/WWW-Search-Search-1.003/
class for searching www.search.com
----
XML-DTD-0.04
http://search.cpan.org/~wohl/XML-DTD-0.04/
Perl module for parsing XML DTDs
----
XML-RSS-LibXML-0.30_02
http://search.cpan.org/~dmaki/XML-RSS-LibXML-0.30_02/
XML::RSS with XML::LibXML
----
Youri-Media-v0.2.0
http://search.cpan.org/~grousse/Youri-Media-v0.2.0/
Abstract media class
----
Youri-Package-v0.1.1
http://search.cpan.org/~grousse/Youri-Package-v0.1.1/
Abstract package class
----
Youri-Utils-v0.2.1
http://search.cpan.org/~grousse/Youri-Utils-v0.2.1/
Youri shared functions
----
mogilefs-server-2.07
http://search.cpan.org/~bradfitz/mogilefs-server-2.07/
----
re-engine-Plan9-0.03
http://search.cpan.org/~avar/re-engine-Plan9-0.03/
Plan9 regular expression engine
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: Sat, 24 Mar 2007 00:10:11 -0400
From: Lew <lew@nospam.lewscanon.com>
Subject: Re: parsing a tab delimited or CSV, but keep the delimiter
Message-Id: <TL-dnRnSlYc-OZnbnZ2dnUVZ_u7inZ2d@comcast.com>
Jürgen Exner wrote:
> Well, sorry, but when you are talking Perl, then CPAN is the one and only
> repository for modules. There may be others, there may even be commercial
> ones. But CPAN is just plain the default and nobody would assume otherwise
> unless you mention a different source explicitely.
You're talking Perl. I'm talking Java. That's where I read the message, in
clj.programmer, and that's what I googled. There are a lot of "registries" for
code in Java; we're not limited to just one.
Sorry us Java folks aren't always hep to the Perl culture.
-- Lew
------------------------------
Date: Sat, 24 Mar 2007 00:14:08 -0400
From: Lew <lew@nospam.lewscanon.com>
Subject: Re: parsing a tab delimited or CSV, but keep the delimiter
Message-Id: <TL-dnRvSlYcNOJnbnZ2dnUVZ_u7inZ2d@comcast.com>
Jürgen Exner wrote:
> Well, sorry, but when you are talking Perl, then CPAN is the one and only
> repository for modules. There may be others, there may even be commercial
> ones. But CPAN is just plain the default and nobody would assume otherwise
> unless you mention a different source explicitely.
Well, sorry, but you're the one talking Perl. I'm talking Java. I read the
post in clj.programmer, and that's what informed my googling. In the Java
world we're not limited to only one repository for useful code. I guess us
Java folks aren't hep to Perl culture.
-- Lew
------------------------------
Date: Fri, 23 Mar 2007 21:31:49 -0700
From: Patricia Shanahan <pats@acm.org>
Subject: Re: parsing a tab delimited or CSV, but keep the delimiter
Message-Id: <eu29jm$2g4r$1@ihnp4.ucsd.edu>
Jürgen Exner wrote:
> Lew wrote:
>> Jürgen Exner wrote:
>>> Sideswipe wrote:
>>>> I need to parse either a CSV or a Tab delimited file, BUT I need to
>>>> keep the delimiting token -- I am parsing these files as generated
>>>> from excel and the user expects them to process EXACTLY as it
>>>> appears in the spreadsheet.
>>> Text::CSV should do the job quite nicely for regular CSV files.
>> Are you referring to <http://www.hxtt.com/text.html>?
>
> No, why would I?
> Of course I am referring to the module Text::CSV (or one of its cousins):
> http://search.cpan.org/search?query=text%3A%3Acsv&mode=all
There is some confusion here because of the cross posting between Java
and Perl newsgroups.
The original message says "I am cross posting this in the Perl and Java
groups because, my implementation is in Java, but Perl users use regexp
far more frequently."
I don't think that was a really good idea because of the confusion,
because it appears to assume a regular expression solution, and because
in any case many Java programmers know regular expressions.
Text::CSV is a Perl module, which I don't think will help given the
question. On the other hand, I think the principle of looking for an
existing implementation is a good one. Parsing CSV is hardly a unique
requirement.
Google for 'java csv' got several promising looking hits - I think the
OP should do the search and compare the results to the requirements.
Patricia
------------------------------
Date: Sat, 24 Mar 2007 04:37:48 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: parsing a tab delimited or CSV, but keep the delimiter
Message-Id: <wW1Nh.325$Rp2.34@trndny04>
Lew wrote:
> Jürgen Exner wrote:
>> Well, sorry, but when you are talking Perl, then CPAN is the one and
>> only repository for modules. There may be others, there may even be
>> commercial ones. But CPAN is just plain the default and nobody would
>> assume otherwise unless you mention a different source explicitely.
>
> Well, sorry, but you're the one talking Perl. I'm talking Java.
The OP posted to comp.lang.PERL.misc. So of course he gets a Perl answer...
jue
------------------------------
Date: 24 Mar 2007 05:07:23 GMT
From: ram@zedat.fu-berlin.de (Stefan Ram)
Subject: Re: parsing a tab delimited or CSV, but keep the delimiter
Message-Id: <CSV-20070324060048@ram.dialup.fu-berlin.de>
"Sideswipe" <christian.bongiorno@gmail.com> writes:
>I need to parse either a CSV or a Tab delimited file, BUT I need to
Whatever you want to parse, you need a specification of
the syntax - which usually is given in EBNF.
>generated from excel
This is not such a specification.
>none are correct
Correct accordint to which syntax specification?
>1) continuous string or with space
What is a »continous string«? Is »continuous string or with
space« supposed to be English?
You do not seem to be able to describe what you need to parse
in English, nor in ENBF. So how are you ever going to implement it?
>That's my understanding of the cases.
My (German) version of Excel does not use the comma as a
separator at all, but the semicolon. So, a CSV file generated
by it for two cells containing »1« and »2«, respectively, is:
1;2
I suggest the following reading:
http://secretgeek.net/csv_trouble.asp
------------------------------
Date: Sat, 24 Mar 2007 18:15:02 +1200
From: Anony-mouse <anony-mouse@hole.in.the.wall.com>
Subject: Replacing characters in file
Message-Id: <240320071815020904%anony-mouse@hole.in.the.wall.com>
Hi,
I'm trying to find a way to replace characters in a file, but have run
into problems. I'm trying to go through a .DAT file replacing the
characters 015F (in hex) with 015C.
I tried playing around with versions of SED, but the file also contains
EOF control characters which cause that to abort part-way through the
file (although it wasn't doing the replacement anyway).
It also needs to be via the DOS command line or a similar way that can
be performed by a BAT file and be as small as possible since it needs
to run from a keyring Flash drive and still leave enough room for the
data files.
Is Perl going to be able to do this??
Or does anyone know a better way?
_
_/ \___
Anony-mouse says o_/O _/ \
"Eek-eek-eek!" \__/_|_/_|\____/
------------------------------
Date: Sat, 24 Mar 2007 01:13:16 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: time structure without shift
Message-Id: <MW_Mh.4762$oV.4296@attbi_s21>
On 3/23/2007 7:23 PM, Petr Vileta wrote:
> I have time in seconds and want to get time structure of this time but
> without shift to local time.
perldoc -f gmtime
-mjc
------------------------------
Date: Sat, 24 Mar 2007 02:46:54 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: time structure without shift
Message-Id: <eu1vvh$gfh$1@ns.felk.cvut.cz>
"Michael Carman" <mjcarman@mchsi.com> píše v diskusním pøíspìvku
news:MW_Mh.4762$oV.4296@attbi_s21...
> On 3/23/2007 7:23 PM, Petr Vileta wrote:
>> I have time in seconds and want to get time structure of this time but
>> without shift to local time.
>
> perldoc -f gmtime
>
gmtime can't help me. I have time in second but in UTC (universal time,
GMT+0) but gmtime() suppose time value in local time. I'm looking for any
function which return array as localtime() or gmtime() but without time
shift.
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
------------------------------
Date: 23 Mar 2007 20:47:28 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: time structure without shift
Message-Id: <1174708048.340014.26790@o5g2000hsb.googlegroups.com>
On Mar 23, 9:46=C2=A0pm, "Petr Vileta" <sto...@practisoft.cz> wrote:
> "Michael Carman" <mjcar...@mchsi.com> p=C3=AD=C5=A1e v diskusn=C3=ADm p=
=C3=B8=C3=ADsp=C3=ACvkunews:MW_Mh.4762$oV.4296@attbi_s21...> On 3/23/2007 7=
:23 PM, Petr Vileta wrote:
> >> I have time in seconds and want to get time structure of this time but
> >> without shift to local time.
>
> > perldoc -f gmtime
>
> gmtime can't help me. I have time in second but in UTC (universal time,
> GMT+0) but gmtime() suppose time value in local time. I'm looking for any
> function which return array as localtime() or gmtime() but without time
> shift.
It would be a lot more helpful if you would provide the sample input
and output that you're looking for.
In the meantime, perhaps you just want to set $ENV{TZ} to the
appropriate value first?
$ perl -le'print scalar localtime(1174703700)'
Fri Mar 23 22:35:00 2007
$ perl -le'$ENV{TZ}=3D"GMT"; print scalar localtime(1174703700)'
Sat Mar 24 02:35:00 2007
------------------------------
Date: 23 Mar 2007 20:07:03 -0700
From: "grocery_stocker" <cdalten@gmail.com>
Subject: Re: Why can't we just change the signal disposition on system()?
Message-Id: <1174705623.022300.223950@e65g2000hsc.googlegroups.com>
On Mar 23, 5:50 pm, "grocery_stocker" <cdal...@gmail.com> wrote:
> This is taken from documentation:
>
> Since "SIGINT" and "SIGQUIT" are ignored during the execution of
> "system", if you expect your program to
> terminate on receipt of these signals you will need to
> arrange to do so yourself based on the return
> value.
>
> @args = ("command", "arg1", "arg2");
> system(@args) == 0
> or die "system @args failed: $?"
>
> You can check all the failure possibilities by
> inspecting $? like this:
>
> if ($? == -1) {
> print "failed to execute: $!\n";
> }
> elsif ($? & 127) {
> printf "child died with signal %d, %s coredump
> \n",
> ($? & 127), ($? & 128) ? 'with' :
> 'without';
> }
> else {
> printf "child exited with value %d\n", $? >> 8;
> }
>
> Why can't we just trap the signal and have it exit? Ie like
> sub sig {
> exit;
> }
>
> $SIG{INT} = \&sig;
>
> Chad
Wait, I sat down and thought about this. system() has it's own set of
signal handlers. Since each function can like only have one signal
handler, the ones used by system() was supercede the ones I would
write.
------------------------------
Date: 23 Mar 2007 20:11:14 -0700
From: "grocery_stocker" <cdalten@gmail.com>
Subject: Re: Why can't we just change the signal disposition on system()?
Message-Id: <1174705874.276783.132730@n59g2000hsh.googlegroups.com>
On Mar 23, 5:50 pm, "grocery_stocker" <cdal...@gmail.com> wrote:
> This is taken from documentation:
>
> Since "SIGINT" and "SIGQUIT" are ignored during the execution of
> "system", if you expect your program to
> terminate on receipt of these signals you will need to
> arrange to do so yourself based on the return
> value.
>
> @args = ("command", "arg1", "arg2");
> system(@args) == 0
> or die "system @args failed: $?"
>
> You can check all the failure possibilities by
> inspecting $? like this:
>
> if ($? == -1) {
> print "failed to execute: $!\n";
> }
> elsif ($? & 127) {
> printf "child died with signal %d, %s coredump
> \n",
> ($? & 127), ($? & 128) ? 'with' :
> 'without';
> }
> else {
> printf "child exited with value %d\n", $? >> 8;
> }
>
> Why can't we just trap the signal and have it exit? Ie like
> sub sig {
> exit;
> }
>
> $SIG{INT} = \&sig;
>
> Chad
Wait, I sat down and thought about this. system() has it's own set of
signal handlers. Since each function can like only have one signal
handler per signal, the ones used by system() was supercede the ones I
would
write.
------------------------------
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 261
**************************************