[30604] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1847 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 10 03:09:47 2008

Date: Wed, 10 Sep 2008 00:09: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           Wed, 10 Sep 2008     Volume: 11 Number: 1847

Today's topics:
    Re: Any GUI Toolkit Suggestions? <ben@morrow.me.uk>
    Re: Data type mismatch warning using DBI <ldolan@thinkinghatbigpond.net.au>
        new CPAN modules on Wed Sep 10 2008 (Randal Schwartz)
        system command failed <shurikgefter@gmail.com>
    Re: system command failed <fawaka@gmail.com>
    Re: system command failed <glex_no-spam@qwest-spam-no.invalid>
    Re: system command failed <smallpond@juno.com>
    Re: system command failed <jurgenex@hotmail.com>
    Re: system command failed (Gary E. Ansok)
    Re: using 2-arg open to open to a scalar <ben@morrow.me.uk>
    Re: using 2-arg open to open to a scalar xhoster@gmail.com
    Re: using 2-arg open to open to a scalar xhoster@gmail.com
    Re: using 2-arg open to open to a scalar <ben@morrow.me.uk>
    Re: using 2-arg open to open to a scalar <ced@blv-sam-01.ca.boeing.com>
    Re: XML::Twig doctype and entity handling <hjp-usenet2@hjp.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 9 Sep 2008 16:08:29 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Any GUI Toolkit Suggestions?
Message-Id: <d4gip5-bc8.ln1@osiris.mauzo.dyndns.org>


Quoth Michael Carman <mjcarman@mchsi.com>:
> Hal Vaughan wrote:
> > I thought there was a GUI Perl programming newsgroup, but I can't 
> > find it, so I'm asking here.
> 
> The closest match is comp.lang.perl.tk. Strictly speaking it's a
> newsgroup for Perl/Tk, but there is a little discussion about other GUI
> toolkits there as well.
> 
> See perldoc -q GUI for a partial list of the toolkits you can use to
> create GUIs for Perl programs.

Note that this particular answer was rewritten in the 5.10 version of
the FAQ. With 5.8 you can use perldoc -q tk, but the answer is not
terribly useful.

Ben

-- 
"Faith has you at a disadvantage, Buffy."
"'Cause I'm not crazy, or 'cause I don't kill people?"
"Both, actually."
                                                         [ben@morrow.me.uk]


------------------------------

Date: Wed, 10 Sep 2008 02:56:43 GMT
From: "Peter Jamieson" <ldolan@thinkinghatbigpond.net.au>
Subject: Re: Data type mismatch warning using DBI
Message-Id: <LHGxk.35285$IK1.21683@news-server.bigpond.net.au>

Thank you to smallpond, J. Gleixner, Paul Lalli and Eric Pozharski
for assistance. I am working through your suggestions which have all
proved quite helpful.
Your comments are very much appreciated! 




------------------------------

Date: Wed, 10 Sep 2008 04:42:20 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Sep 10 2008
Message-Id: <K6yqEK.vIu@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-Ar-1.13b
http://search.cpan.org/~jbazik/Archive-Ar-1.13b/
Interface for manipulating ar archives 
----
Argv-1.23
http://search.cpan.org/~dsb/Argv-1.23/
Provide an OO interface to an arg vector 
----
CPAN-Testers-ParseReport-0.0.6
http://search.cpan.org/~andk/CPAN-Testers-ParseReport-0.0.6/
parse reports to cpantesters.perl.org from various sources 
----
CPANPLUS-YACSmoke-0.06
http://search.cpan.org/~bingos/CPANPLUS-YACSmoke-0.06/
Yet Another CPANPLUS Smoke Tester 
----
Cache-CacheFactory-1.07_04
http://search.cpan.org/~sgraham/Cache-CacheFactory-1.07_04/
factory class for Cache::Cache and other modules. 
----
Chart-Clicker-2.09
http://search.cpan.org/~gphat/Chart-Clicker-2.09/
Powerful, extensible charting. 
----
ClearCase-Argv-1.40
http://search.cpan.org/~dsb/ClearCase-Argv-1.40/
ClearCase-specific subclass of Argv 
----
Curses-1.24
http://search.cpan.org/~giraffed/Curses-1.24/
terminal screen handling and optimization 
----
DBD-DB2-1.2
http://search.cpan.org/~ibmtordb2/DBD-DB2-1.2/
DataBase Driver for DB2 UDB 
----
Devel-PerlySense-0.0159
http://search.cpan.org/~johanl/Devel-PerlySense-0.0159/
Perl IDE backend with Emacs frontend 
----
EekBoek-1.04.00_01
http://search.cpan.org/~jv/EekBoek-1.04.00_01/
Bookkeeping software for small and medium-size businesses 
----
EekBoek-1.04.00_02
http://search.cpan.org/~jv/EekBoek-1.04.00_02/
Bookkeeping software for small and medium-size businesses 
----
File-Corresponding-0.003
http://search.cpan.org/~johanl/File-Corresponding-0.003/
Find corresponding files in the directory tree 
----
Geometry-Primitive-0.11
http://search.cpan.org/~gphat/Geometry-Primitive-0.11/
Primitive Geometry Entities 
----
Graphics-Color-0.15
http://search.cpan.org/~gphat/Graphics-Color-0.15/
Device and library agnostic color spaces. 
----
LCFG-Build-PkgSpec-0.0.23
http://search.cpan.org/~sjquinney/LCFG-Build-PkgSpec-0.0.23/
Object-oriented interface to LCFG build metadata 
----
Layout-Manager-0.18
http://search.cpan.org/~gphat/Layout-Manager-0.18/
2D Layout Management 
----
Module-Collect-0.02
http://search.cpan.org/~yappo/Module-Collect-0.02/
module files are collected from some directories 
----
MyCPAN-Indexer-0.15_01
http://search.cpan.org/~bdfoy/MyCPAN-Indexer-0.15_01/
Index a Perl distribution 
----
Net-Async-HTTP-0.02
http://search.cpan.org/~pevans/Net-Async-HTTP-0.02/
Asynchronous HTTP user agent 
----
Net-Ping-Network-1.56
http://search.cpan.org/~angerstei/Net-Ping-Network-1.56/
A modul to ICMP-request nodes in networks very fast 
----
Net-SIP-0.47
http://search.cpan.org/~sullr/Net-SIP-0.47/
Framework SIP (Voice Over IP, RFC3261) 
----
ORLite-0.11
http://search.cpan.org/~adamk/ORLite-0.11/
Extremely light weight SQLite-specific ORM 
----
OpenGL-PLG-0.01
http://search.cpan.org/~garu/OpenGL-PLG-0.01/
Create, manipulate and render PoLyGon objects and files 
----
OpenResty-0.4.0
http://search.cpan.org/~agent/OpenResty-0.4.0/
General-purpose web service platform for web applications 
----
POE-Component-Server-NSCA-0.06
http://search.cpan.org/~bingos/POE-Component-Server-NSCA-0.06/
a POE Component that implements NSCA daemon functionality 
----
Perlwikipedia-1.3.0
http://search.cpan.org/~dcollins/Perlwikipedia-1.3.0/
a Wikipedia bot framework written in Perl 
----
Search-QueryParser-SQL-0.003
http://search.cpan.org/~karman/Search-QueryParser-SQL-0.003/
turn free-text queries into SQL WHERE clauses 
----
Stem-0.12
http://search.cpan.org/~sscaffidi/Stem-0.12/
----
Sub-Uplevel-0.20
http://search.cpan.org/~dagolden/Sub-Uplevel-0.20/
apparently run a function in a higher stack frame 
----
TL1ng-0.08
http://search.cpan.org/~sscaffidi/TL1ng-0.08/
A simple, flexible, OO way to work with TL1. 
----
Template-Plugin-Timer-0.01
http://search.cpan.org/~kentaro/Template-Plugin-Timer-0.01/
A Template Plugin to Profile Template Processing 
----
Template-Plugin-Timer-0.02
http://search.cpan.org/~kentaro/Template-Plugin-Timer-0.02/
A Template Plugin to Profile Template Processing 
----
Test-Simple-0.81_02
http://search.cpan.org/~mschwern/Test-Simple-0.81_02/
Basic utilities for writing tests. 
----
Test-Valgrind-0.06
http://search.cpan.org/~vpit/Test-Valgrind-0.06/
Test Perl code through valgrind. 
----
URI-Template-0.14_01
http://search.cpan.org/~bricas/URI-Template-0.14_01/
Object for handling URI templates 
----
VisualDreams-Yubikey_online-0.04
http://search.cpan.org/~wildchild/VisualDreams-Yubikey_online-0.04/
----
YAML-DBH-1.06
http://search.cpan.org/~leocharre/YAML-DBH-1.06/
----
okbiff-20080909
http://search.cpan.org/~mschwern/okbiff-20080909/
check if you have mail on OkCupid.com 


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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


------------------------------

Date: Tue, 9 Sep 2008 12:11:31 -0700 (PDT)
From: "shurikgefter@gmail.com" <shurikgefter@gmail.com>
Subject: system command failed
Message-Id: <2de578a1-8ea3-4aad-ab5d-71d68eb35975@l42g2000hsc.googlegroups.com>

Hi,

I have the following line in my script:

system ( "export A=10; myScript.pl param1 par^AAA^da " );

When I run it in Unix I get the following error:

sh: can execute AAA

Please advice what is ^*^

Thanks


------------------------------

Date: 09 Sep 2008 19:43:53 GMT
From: Leon Timmermans <fawaka@gmail.com>
Subject: Re: system command failed
Message-Id: <48c6d1f9$0$196$e4fe514c@news.xs4all.nl>

On Tue, 09 Sep 2008 12:11:31 -0700, shurikgefter@gmail.com wrote:

> Hi,
> 
> I have the following line in my script:
> 
> system ( "export A=10; myScript.pl param1 par^AAA^da " );
> 
> When I run it in Unix I get the following error:
> 
> sh: can execute AAA
> 
> Please advice what is ^*^
> 
> Thanks

This is not a Perl problem but a shell problem. You should probably ask 
in comp.unix.shell. Don't forget to tell them what shell you are running.

Regards,

Leon


------------------------------

Date: Tue, 09 Sep 2008 14:46:15 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: system command failed
Message-Id: <48c6d287$0$48228$815e3792@news.qwest.net>

shurikgefter@gmail.com wrote:
> Hi,
> 
> I have the following line in my script:
> 
> system ( "export A=10; myScript.pl param1 par^AAA^da " );
> 
> When I run it in Unix I get the following error:
> 
> sh: can execute AAA

How do you 'get' that error?

> 
> Please advice what is ^*^

Ahhhh.. What are you asking?  Where is '^*^'?

Maybe you should look at or post 'myScript.pl'.


------------------------------

Date: Tue, 9 Sep 2008 14:10:20 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: system command failed
Message-Id: <9505b040-8a1b-4995-9b29-e166c3c17fb5@s50g2000hsb.googlegroups.com>

On Sep 9, 3:11 pm, "shurikgef...@gmail.com" <shurikgef...@gmail.com>
wrote:
> Hi,
>
> I have the following line in my script:
>
> system ( "export A=10; myScript.pl param1 par^AAA^da " );
>
> When I run it in Unix I get the following error:
>
> sh: can execute AAA
>
> Please advice what is ^*^
>
> Thanks

^*^ appears to be the rarely used emoticon for a flying hedgehog.

My guess is you have a typo or editor artifact in your script.

--S


------------------------------

Date: Tue, 09 Sep 2008 14:38:45 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: system command failed
Message-Id: <11rdc4t1v8kcot1dsq7qcbdnusforg3337@4ax.com>

"shurikgefter@gmail.com" <shurikgefter@gmail.com> wrote:
>system ( "export A=10; myScript.pl param1 par^AAA^da " );
>When I run it in Unix I get the following error:
>
>sh: can execute AAA

Well, that's great that sh is able to execute AAA. Where is the problem?

jue


------------------------------

Date: Wed, 10 Sep 2008 00:47:05 +0000 (UTC)
From: ansok@alumni.caltech.edu (Gary E. Ansok)
Subject: Re: system command failed
Message-Id: <ga75e9$i9k$1@naig.caltech.edu>

In article <2de578a1-8ea3-4aad-ab5d-71d68eb35975@l42g2000hsc.googlegroups.com>,
shurikgefter@gmail.com <shurikgefter@gmail.com> wrote:
>Hi,
>
>I have the following line in my script:
>
>system ( "export A=10; myScript.pl param1 par^AAA^da " );
>
>When I run it in Unix I get the following error:
>
>sh: can execute AAA

In some shells, the ^ character means the same thing as the | character --
pipe the output of one command into the input of another.  So your shell
appears to be trying to run the commands "myscript.pl param1 par", "AAA", and
"da".

I can think of two ways to fix this:

1) (more Perl-ish)

    $ENV{A}=10;
    system 'myScript.pl', 'param1', 'par^AAA^da';

This allows this Perl script to call myScript.pl directly, without
requiring a shell to parse the command line, so the characters that
are special to the shell don't get processed.

(It does set the environment variable A for the rest of this script's
run; there are workarounds if that's a potential issue.)

2) (minimal changes to this script)

    system ( "export A=10; myScript.pl param1 'par^AAA^da' " );

The single quotes in this string will be included in the command
passed to the shell, and will prevent the shell from processing special
characters inside the quotes when it parses the arguments for myScript.pl.

>Please advice what is ^*^

That looks like it might be a rather impolite emoticon.

Gary Ansok
-- 
The recipe says "toss lightly," but I suppose that depends 
on how much you eat and how bad the cramps get.      - J. Lileks 


------------------------------

Date: Tue, 9 Sep 2008 16:17:19 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: using 2-arg open to open to a scalar
Message-Id: <vkgip5-bc8.ln1@osiris.mauzo.dyndns.org>


Quoth "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>:
> 
> open( my $y, "<&=@{[fileno $fh]}" )
>    or die $!;

Blecch :).

    open my $y, "<&=", $fh or die ...;

$fh can be replaced with "STDIN" or \*STDIN if you want to fdopen(3) an
already-existing global filehandle.

Ben

-- 
For far more marvellous is the truth than any artists of the past imagined!
Why do the poets of the present not speak of it? What men are poets who can
speak of Jupiter if he were like a man, but if he is an immense spinning
sphere of methane and ammonia must be silent? [Feynmann]     ben@morrow.me.uk


------------------------------

Date: 09 Sep 2008 15:41:16 GMT
From: xhoster@gmail.com
Subject: Re: using 2-arg open to open to a scalar
Message-Id: <20080909114117.838$1k@newsreader.com>

Ben Morrow <ben@morrow.me.uk> wrote:
> Quoth "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>:
> >
> > open( my $y, "<&=@{[fileno $fh]}" )
> >    or die $!;
>
> Blecch :).
>
>     open my $y, "<&=", $fh or die ...;

But the requirement was to use the 2-arg form of open, not the
3-arg form.

Well, that was the requirement.  Despite the nice answers I've gotten here,
I decided to I'd keep my own library with an updated version of the module
which can take a file-handle in lieu of a string which is passed to 2-arg
open, which obviates the whole mess.  Now I just have the mess of multiple
module versions in different places in @INC

Xho

-- 
-------------------- 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: 09 Sep 2008 15:51:04 GMT
From: xhoster@gmail.com
Subject: Re: using 2-arg open to open to a scalar
Message-Id: <20080909115105.721$H6@newsreader.com>

xhoster@gmail.com wrote:
> Ben Morrow <ben@morrow.me.uk> wrote:
> > Quoth "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>:
> > >
> > > open( my $y, "<&=@{[fileno $fh]}" )
> > >    or die $!;
> >
> > Blecch :).
> >
> >     open my $y, "<&=", $fh or die ...;
>
> But the requirement was to use the 2-arg form of open, not the
> 3-arg form.
>
> Well, that was the requirement.  Despite the nice answers I've gotten
> here, I decided to I'd keep my own library with an updated version of the
> module which can take a file-handle in lieu of a string which is passed
> to 2-arg open, which obviates the whole mess.  Now I just have the mess
> of multiple module versions in different places in @INC

By the way, what do people consider the "best practice" for detecting
whether the thing passed in is a file-handle, rather than a filename?

if (ref $_[0]) { #...

Seems to be good enough to me.  It works with lexicals and with foo(\*FH),
but it fails with foo(*FH).  I'm willing to live with that, but if there is
something better which isn't overly complicated it would be better yet.

Xho

-- 
-------------------- 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: Tue, 9 Sep 2008 19:27:43 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: using 2-arg open to open to a scalar
Message-Id: <vprip5-joi.ln1@osiris.mauzo.dyndns.org>


Quoth xhoster@gmail.com:
> 
> By the way, what do people consider the "best practice" for detecting
> whether the thing passed in is a file-handle, rather than a filename?
> 
> if (ref $_[0]) { #...
> 
> Seems to be good enough to me.  It works with lexicals and with foo(\*FH),
> but it fails with foo(*FH).  I'm willing to live with that, but if there is
> something better which isn't overly complicated it would be better yet.

    use Scalar::Util qw/openhandle/;

    if (openhandle $_[0]) {

is what I'd use. It doesn't catch \*FOO where FOO is not an open handle,
nor cases like

    open my $x, "<", "foo";
    close $x;
    if (openhandle $x) {

but that's probably what you wanted anyway.

Ben

-- 
Many users now operate their own computers day in and day out on various
applications without ever writing a program. Indeed, many of these users
cannot write new programs for their machines...
    -- F.P. Brooks, 'No Silver Bullet', 1987             [ben@morrow.me.uk]


------------------------------

Date: Tue, 9 Sep 2008 21:02:21 -0700 (PDT)
From: "C.DeRykus" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: using 2-arg open to open to a scalar
Message-Id: <7ce1f3d1-a4da-4032-a135-b92c24a1224d@z11g2000prl.googlegroups.com>

On Sep 9, 11:27 am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth xhos...@gmail.com:
>
>
>
> > By the way, what do people consider the "best practice" for detecting
> > whether the thing passed in is a file-handle, rather than a filename?
>
> > if (ref $_[0]) { #...
>
> > Seems to be good enough to me.  It works with lexicals and with foo(\*FH),
> > but it fails with foo(*FH).  I'm willing to live with that, but if there is
> > something better which isn't overly complicated it would be better yet.
>
>     use Scalar::Util qw/openhandle/;
>
>     if (openhandle $_[0]) {
>
> is what I'd use. It doesn't catch \*FOO where FOO is not an open handle,
> nor cases like
>
>     open my $x, "<", "foo";
>     close $x;
>     if (openhandle $x) {
>
> but that's probably what you wanted anyway.
>

Hm... Scalar::Util 1.18 seems to catch both cases:

perl -lM"Scalar::Util 'openhandle'"
open my $h,"<","/dev/null" or die;
close $h or die;
print openhandle $h ? "yes" : "no";
^D
no


perl -lM"Scalar::Util 'openhandle'"
print openhandle \*FOO ? "yes"
                       : "no";
^D
no


--
Charles DeRykus









------------------------------

Date: Tue, 9 Sep 2008 19:58:08 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: XML::Twig doctype and entity handling
Message-Id: <slrngcde9g.t3p.hjp-usenet2@hrunkner.hjp.at>

On 2008-09-09 13:25, Peter J. Holzer <hjp-usenet2@hjp.at> wrote:
> However, if you know that everything inside your metadata elements is
> well-formed XML and that the metadata elements aren't nested and that
> there are no CDATA sections which might contain the string "<metadata>"
> or "</metadata>", you can easily extract those sections:
>
> $/ = "</metadata>";
>
> print $preamble, "<fakeroot>";
> while (<>) {
>     # each record ends with </metadata>,
>     # so we can throw everything up to <metadata away:
>     s/.*(?=<metadata\s)//;
>     print $_
> }
> print "</fakeroot>"
>
> put that in a subprocess and pass the pipe to XML::Twig. (or maybe
> XML::Twig has a method with which you can feed it chunks of input - I
> think it does, but a quick scanning of the man page didn't reveal it).

Sorry, I missed that there is only one metadata element and that it is
always near the start of the document. In that case it's a lot simpler.
You don't need a loop as you only need to read one element. And you can
just call XML::Twig->parse with that element and don't need to wrap it
in a fake root element.


------------------------------

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 1847
***************************************


home help back first fref pref prev next nref lref last post