[29604] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 848 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 14 03:09:40 2007

Date: Fri, 14 Sep 2007 00:09:06 -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           Fri, 14 Sep 2007     Volume: 11 Number: 848

Today's topics:
    Re: Accessing Hash keys alphabetically <tzz@lifelogs.com>
    Re: Accessing Hash keys alphabetically <allergic-to-spam@no-spam-allowed.org>
    Re: Accessing Hash keys alphabetically <dummy@example.com>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <cwilbur@chromatico.net>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <tadmc@seesig.invalid>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <bart.lateur@pandora.be>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <brian.d.foy@gmail.com>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <brian.d.foy@gmail.com>
    Re: Challenge: CPU-optimized byte-wise or-equals (for a <uri@stemsystems.com>
    Re: Commented braces <zaxfuuq@invalid.net>
        HTTP Filtering and Threads... <danett18@yahoo.com.br>
        Image processing in perl? <jismagic@gmail.com>
        new CPAN modules on Fri Sep 14 2007 (Randal Schwartz)
    Re: New to Perl - strange behaviour with backticks <joe@inwap.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 13 Sep 2007 20:21:55 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Accessing Hash keys alphabetically
Message-Id: <m2wsuuca8c.fsf@lifelogs.com>

On Thu, 13 Sep 2007 23:06:53 +0200 Michele Dondi <bik.mido@tiscalinet.it> wrote: 

MD> On Thu, 13 Sep 2007 08:16:14 -0700, Paul Lalli <mritty@gmail.com>
MD> wrote:

>>> Well, it is and maybe it isn't, but just to play the devil's
>>> advocate. (Don't know if the English idiom is correct.)
>> 
>> It is.  You speak English better than about 75% of the native-speakers
>> here.  No worries. :-P

MD> Thank you for your kind words. Yet, I occasionally have problems with
MD> idiomatic forms, and in doubt I ask... you know, just to be sure and
MD> *learn*.

Don't listen to Paul, he's having fun at your expense.  The proper idiom
is "to play the Devil's avocado."  Even native speakers get it wrong
very often!

Ted :)


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

Date: Fri, 14 Sep 2007 07:21:25 +0200 (CEST)
From: Jim Cochrane <allergic-to-spam@no-spam-allowed.org>
Subject: Re: Accessing Hash keys alphabetically
Message-Id: <slrnfek6ij.h2v.allergic-to-spam@no-spam-allowed.org>

On 2007-09-13, Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On Thu, 13 Sep 2007 08:16:14 -0700, Paul Lalli <mritty@gmail.com>
> wrote:
>
>>> Well, it is and maybe it isn't, but just to play the devil's
>>> advocate. (Don't know if the English idiom is correct.)
>>
>>It is.  You speak English better than about 75% of the native-speakers
>>here.  No worries. :-P
>
> Thank you for your kind words. Yet, I occasionally have problems with
> idiomatic forms, and in doubt I ask... you know, just to be sure and
> *learn*.
>
>
> Michele

I've been reading your posts for the past several weeks and I didn't
even realize that you were Italian until I saw Paul's response to your
post, then noticed your last name and then your address.  You had me
fooled :-) - I thought you were a native English speaker!

-- 



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

Date: Fri, 14 Sep 2007 07:01:10 GMT
From: "John W. Krahn" <dummy@example.com>
Subject: Re: Accessing Hash keys alphabetically
Message-Id: <WkqGi.64195$vP5.63853@edtnps90>

Ted Zlatanov wrote:
> On Thu, 13 Sep 2007 23:06:53 +0200 Michele Dondi <bik.mido@tiscalinet.it> wrote: 
> 
> MD> On Thu, 13 Sep 2007 08:16:14 -0700, Paul Lalli <mritty@gmail.com>
> MD> wrote:
> 
>>>> Well, it is and maybe it isn't, but just to play the devil's
>>>> advocate. (Don't know if the English idiom is correct.)
>>> It is.  You speak English better than about 75% of the native-speakers
>>> here.  No worries. :-P
> 
> MD> Thank you for your kind words. Yet, I occasionally have problems with
> MD> idiomatic forms, and in doubt I ask... you know, just to be sure and
> MD> *learn*.
> 
> Don't listen to Paul, he's having fun at your expense.  The proper idiom
> is "to play the Devil's avocado."  Even native speakers get it wrong
> very often!

How do you play an avocado?  I thought it was an ocarina.  (Sorry, I only 
speak Canadian!)


John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: 13 Sep 2007 18:29:55 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <87ps0m19ng.fsf@mithril.chromatico.net>

>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:

    MD> Honestly, I don't want to bother anyone. Do you think that
    MD> occasionally posting here interesting stuff from PM with a
    MD> suitable tag in the Subject for you and others to easily
    MD> filter it out would be so bad?

I think that both Usenet and Perlmonks are interactive media, and both
are best served by an occasional post saying something like "there's
an interesting conversation going on about $subject over on
Perlmonks."  People who want Perlmonks know where to find it, by and
large, and it's not as if clpm is hurting for traffic.

I don't think "Post it, and if people find it unwelcome they can
filter it out" is a polite strategy to pursue.  But I'm not the
arbiter of clpm behavior, except in that I'm fairly quick to score
subjects and posters down.

Charlton






-- 
Charlton Wilbur 
cwilbur@chromatico.net


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

Date: Thu, 13 Sep 2007 17:50:46 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <slrnfejfm6.v35.tadmc@tadmc30.sbcglobal.net>

Charlton Wilbur <cwilbur@chromatico.net> wrote:
>>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:
>
>    MD> I *do* think that there's a point, for people interested in
>    MD> *Perl* who may like one interface and dislike the other
>    MD> one. And I think there's a point reposting stuff from one
>    MD> place to the other if it contributes to Perl knowledge or is
>    MD> otherwise intriguing. 
>
> I'm afraid I concur with Abigail here.


<aol> Me too! </aol>


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Fri, 14 Sep 2007 00:43:02 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <do1he3trml0kj6fkhueop9q0cm5mt8n8ug@4ax.com>

Keith Keller wrote:

>Beer is measured in volume, not length.  The OP (at PM) should really be
>offering a cubic meter of beer, and moritz and avar should demand such.

Funny you should mention that. I just asked about that a few days ago,
to the guy who started it (with the Perl for Windows + free C compiler
challenge):

	<http://use.perl.org/comments.pl?sid=36903&cid=57707>

-- 
	Bart.


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

Date: Thu, 13 Sep 2007 23:50:49 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <130920072350495491%brian.d.foy@gmail.com>

In article <ri8je3t355us9d8tbc37rdue2e6knqvbpu@4ax.com>, Michele Dondi
<bik.mido@tiscalinet.it> wrote:

> On 13 Sep 2007 11:39:28 -0400, Charlton Wilbur
> <cwilbur@chromatico.net> wrote:
> 
> >If Perlmonks is lacking in competent and knowledgeable posters, then
> >perhaps it's time to reexamine their choice of interfaces.  And if

> Well, of course if I see that many people agree with you and Abigail,
> then I will stop doing so. Not that I do it *routinely* nor that I've
> done that so many times...

I agree with them. It's a lame thing to do, reposting other people's
stuff (heh, from the guy who runs the perlfaq server :). 

Posting your own stuff is fine, or your own thoughts on someone else's
ideas is fine, but just reposting something with no transformative
effect is a pillar of copyright infringement, and it's rude to the
author.


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

Date: Fri, 14 Sep 2007 00:01:32 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <140920070001324076%brian.d.foy@gmail.com>

In article <ri8je3t355us9d8tbc37rdue2e6knqvbpu@4ax.com>, Michele Dondi
<bik.mido@tiscalinet.it> wrote:

> Honestly, I don't want to bother anyone. Do you think that
> occasionally posting here interesting stuff from PM with a suitable
> tag in the Subject for you and others to easily filter it out would be
> so bad?

How about posting original content of which you are the author? Talking
about a problem that you think is interesting, expounding on it, and so
on would be a lot better.

Otherwise, let the original authors decide where to post their own work.


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

Date: Thu, 13 Sep 2007 22:40:19 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Challenge: CPU-optimized byte-wise or-equals (for a meter of beer)
Message-Id: <x7abrqjijw.fsf@mail.sysarch.com>

>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:

  MD> On 13 Sep 2007 11:39:28 -0400, Charlton Wilbur
  MD> <cwilbur@chromatico.net> wrote:

  >> If Perlmonks is lacking in competent and knowledgeable posters, then
  >> perhaps it's time to reexamine their choice of interfaces.  And if

  MD> Well, of course if I see that many people agree with you and Abigail,
  MD> then I will stop doing so. Not that I do it *routinely* nor that I've
  MD> done that so many times...

i am not there because of the web api (why no news/email gateway?) and
because i have never was into the monk culture. and yes i know plenty of
people there but i have seen too many idiots. there are idiots on usenet
too but emacs makes it easier to ignore them. 

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, 13 Sep 2007 23:52:09 -0700
From: "Wade Ward" <zaxfuuq@invalid.net>
Subject: Re: Commented braces
Message-Id: <Jf2dnbRXfMILvHfbnZ2dnUVZ_oOnnZ2d@comcast.com>



"Paul Lalli" <mritty@gmail.com> wrote in message 
news:1189606409.299898.311000@y42g2000hsy.googlegroups.com...
> On Sep 12, 5:03 am, Michele Dondi <bik.m...@tiscalinet.it> wrote:
this dude                     ^^^^^^.
>> This is something obvious, but it may not be entirely obvious to all.
>> So I'm copying it here for the benefit of potential readers.
>>
>> Originally from:
>>
>> http://perlmonks.org/?node_id=638287

>
> Paul Lalli
>
Do you know how to reach Mr. Dondi through e-mail?
-- 
Wade Ward
wade@zaxfuuq.net
'If they took all the "And it came to pass's" out
of the Book of Mormon, it would be a pamphlet.'
--Mark Twain 




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

Date: Thu, 13 Sep 2007 21:33:08 -0700
From:  Dan <danett18@yahoo.com.br>
Subject: HTTP Filtering and Threads...
Message-Id: <1189744388.978420.17170@50g2000hsm.googlegroups.com>

Hi,

That's my first program and my first question in perl programming..
lolll! Any kind of help is appreciated. :)

1) I have a code in perl which is doing a HTTP request and getting a
response and saving in a variable, so I want to filter a specific
value of a field. My code is more or less like this one:

next unless /^<input name/i;
my ($name, $value) = $_ =~ /input name="(.*)Name" type=.*
value="(.*)">/i;
if ((length($value)) > 1){
     $MiddleName = $value;
     #Some Stuff Code...
     print "$MiddleName";<br><br>
}

However the HTTP request return a HTML code that is more or less like
this:

#Some non relevante HTML stuff...
<input name="$mdName" type="hidden" value="Silva">
#Some non relevante HTML stuff...
<input name="Name" type="hidden" value="Silva">
<input name="mdName" type="hidden" value="Daniel">
#Some non relevante HTML stuff...<code>

The problem is that my code is getting the value of "mdName" which is
"Daniel" and I want it get the value of "$mdName" which is "Silva" and
if it is missing (blank) I want to get the value of "Name" which in
the example also is "Silva". But I never want to get the value of
"mdName" which is "Daniel" and is what always is happening. :(

Obs.: I also tried (without sucess) use:

* my ($name, $value) = $_ =~ input name="\"\$mdName\" type=.*
value="(.*)">/i;

* my ($name, $value) = $_ =~ m/input name=\"\$mdName\" type=.*
value="(.*)">/i;

* my ($name, $value) = $_ =~ input name="\/$mdName\/" type=.*
value="(.*)">/i;

* my ($name, $value) = $_ =~ m/input name="\/$mdName\/" type=.*
value="(.*)">/i;


Someone can give me a snippet of code of how to fix it? :)

2) In the some program I have a piece of code which list all users and
do a loop for call the function which will get detailed information of
each user (the code in question 1 is part of this function). The
snippet is like this one:

# Some irrelevant code stuff...

(my $ruid, @userIDs) = &GetUserList($start, $end);
   if ($userIDs[0] == -1) { exit(0); }

   foreach $userID (@userIDs) {
      &GetUserData($name, $middlename, $lname, $bdate);

      print "$userID\t: $name, $middlename, $lname, $bdate";

      # Some irrelevant code stuff...

   }

# Some irrelevant code stuff...

The function GetUserData() is really slow, it do HTTP Request, parse
some HTML stuff and the amount of users is big. So I would like to add
thread support to it, in a fashion that I could have for example 8
instances of this code running in paralel. :)

I had looked at http://perldoc.perl.org/threads.html, but it doesn't
helped so much. I belive I should add the thread support in a fashion
that it work directly with the foreach loop instruction and
GetUserData(), right?

However I want to take care to doesn't overwrite data (in C when we
deal with threads we have some unsafe functions that can overwrite
values - which is not good)... also take care that each print will be
in the correct sequence...

Can someone give me a snippet of code based in mine for that? I know
that read documentation is better, but documentation doesn't helped
much, I appreciate practical examples...

3) The Perl2exe (http://www.indigostar.com/perl2exe.htm) is the best
option to convert Perl code to Executables? It really work well? Even
with complicated and sophisticated code (using thread, raw sockets,
windows registry access, etc)?

Well, that's my first code in perl, so sorry for ugly/bad code (and
also I'm not a programmer, just a curious:). hehe

Thank you and sorry for amount (of dumb and off-topic) questions.

Cheers,



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

Date: Fri, 14 Sep 2007 03:03:31 -0000
From:  jis <jismagic@gmail.com>
Subject: Image processing in perl?
Message-Id: <1189739011.316073.91420@k79g2000hse.googlegroups.com>

Hi,

I want to detect or identify objects on an image.
Does perl has any image processing  related applications in use.

ChEeRs,
jis



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

Date: Fri, 14 Sep 2007 04:42:17 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Sep 14 2007
Message-Id: <JoCD2H.qE1@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.

Atompub-0.1.2
http://search.cpan.org/~takeru/Atompub-0.1.2/
Atom Publishing Protocol implementation 
----
Benchmark-Stopwatch-0.05
http://search.cpan.org/~evdb/Benchmark-Stopwatch-0.05/
simple timing of stages of your code. 
----
Catalyst-Controller-Atompub-0.1.0
http://search.cpan.org/~takeru/Catalyst-Controller-Atompub-0.1.0/
A Catalyst controller for the Atom Publishing Protocol 
----
Catalyst-Controller-Atompub-0.1.1
http://search.cpan.org/~takeru/Catalyst-Controller-Atompub-0.1.1/
A Catalyst controller for the Atom Publishing Protocol 
----
Catalyst-Plugin-Unicode-0.7
http://search.cpan.org/~mramberg/Catalyst-Plugin-Unicode-0.7/
Unicode aware Catalyst 
----
Class-Dot-1.0.3
http://search.cpan.org/~asksh/Class-Dot-1.0.3/
Simple way of creating accessor methods. 
----
Crypt-GpgME-0.03
http://search.cpan.org/~flora/Crypt-GpgME-0.03/
Perl interface to libgpgme 
----
Crypt-GpgME-0.04
http://search.cpan.org/~flora/Crypt-GpgME-0.04/
Perl interface to libgpgme 
----
Flickr-Upload-Dopplr-0.1
http://search.cpan.org/~ascope/Flickr-Upload-Dopplr-0.1/
Flickr::Upload subclass to assign location information using Dopplr 
----
GraphViz-Data-Structure-0.17
http://search.cpan.org/~mcmahon/GraphViz-Data-Structure-0.17/
Visualise data structures 
----
HTML-Table-2.07-beta
http://search.cpan.org/~ajpeacock/HTML-Table-2.07-beta/
produces HTML tables 
----
HTTP-Async-0.09
http://search.cpan.org/~evdb/HTTP-Async-0.09/
process multiple HTTP requests in parallel without blocking. 
----
HTTP-MobileAgent-0.26_1
http://search.cpan.org/~kurihara/HTTP-MobileAgent-0.26_1/
HTTP mobile user agent string parser 
----
IMDB-Film-0.30
http://search.cpan.org/~stepanov/IMDB-Film-0.30/
OO Perl interface to the movies database IMDB. 
----
IO-Socket-SSL-1.09
http://search.cpan.org/~sullr/IO-Socket-SSL-1.09/
Nearly transparent SSL encapsulation for IO::Socket::INET. 
----
Module-Build-PM_Filter-0.9
http://search.cpan.org/~vmoral/Module-Build-PM_Filter-0.9/
Add a PM_Filter feature to Module::Build 
----
Module-Build-PM_Filter-0.9.1
http://search.cpan.org/~vmoral/Module-Build-PM_Filter-0.9.1/
Add a PM_Filter feature to Module::Build 
----
MojoMojo-0.999003
http://search.cpan.org/~mramberg/MojoMojo-0.999003/
A Catalyst & DBIx::Class powered Wiki. 
----
MooseX-AttributeHelpers-0.02
http://search.cpan.org/~stevan/MooseX-AttributeHelpers-0.02/
Extend your attribute interfaces 
----
Net-FullAuto-0.04
http://search.cpan.org/~reedfish/Net-FullAuto-0.04/
Perl Based Secure Distributed Computing Network Process Automation Utility 
----
Net-Proxy-0.09
http://search.cpan.org/~book/Net-Proxy-0.09/
Framework for proxying network connections in many ways 
----
Palm-Keyring-0.96_05
http://search.cpan.org/~andrew/Palm-Keyring-0.96_05/
Handler for Palm Keyring databases. 
----
Parse-Apache-ServerStatus-0.03
http://search.cpan.org/~bloonix/Parse-Apache-ServerStatus-0.03/
Simple module to parse apache's server-status. 
----
Parse-Eyapp-1.074
http://search.cpan.org/~casiano/Parse-Eyapp-1.074/
Extensions for Parse::Yapp 
----
Parse-Eyapp-1.075
http://search.cpan.org/~casiano/Parse-Eyapp-1.075/
Extensions for Parse::Yapp 
----
Parse-Eyapp-1.076
http://search.cpan.org/~casiano/Parse-Eyapp-1.076/
Extensions for Parse::Yapp 
----
Pod-Coverage-0.19
http://search.cpan.org/~rclamp/Pod-Coverage-0.19/
Checks if the documentation of a module is comprehensive 
----
RDF-Query-1.044
http://search.cpan.org/~gwilliams/RDF-Query-1.044/
An RDF query implementation of SPARQL/RDQL in Perl for use with RDF::Redland and RDF::Core. 
----
SVG-Convert-0.01
http://search.cpan.org/~zigorou/SVG-Convert-0.01/
Convert from SVG to other format. 
----
SVG-Template-Graph-0.12
http://search.cpan.org/~ronan/SVG-Template-Graph-0.12/
Perl extension for generating template-driven graphs with SVG 
----
SVN-Hook-0.26
http://search.cpan.org/~clkao/SVN-Hook-0.26/
Managing subversion hooks 
----
Sphinx-Config-0.01
http://search.cpan.org/~jjschutz/Sphinx-Config-0.01/
Sphinx search engine configuration file read/modify/write 
----
Sys-Syslog-0.21
http://search.cpan.org/~saper/Sys-Syslog-0.21/
Perl interface to the UNIX syslog(3) calls 
----
Term-Menus-1.25
http://search.cpan.org/~reedfish/Term-Menus-1.25/
Create Powerful Terminal, Console and CMD Enviroment Menus 
----
Test-Simple-0.71
http://search.cpan.org/~mschwern/Test-Simple-0.71/
Basic utilities for writing tests. 
----
Tk-Wizard-2.113
http://search.cpan.org/~mthurn/Tk-Wizard-2.113/
GUI for step-by-step interactive logical process 
----
VCI-0.2.0_1
http://search.cpan.org/~mkanat/VCI-0.2.0_1/
A generic interface for interacting with various version-control systems. 
----
WWW-Metaweb-0.02
http://search.cpan.org/~hds/WWW-Metaweb-0.02/
An interface to the Metaweb database via MQL 
----
Win32-GUIRobot-0.03
http://search.cpan.org/~karasik/Win32-GUIRobot-0.03/
send keyboard and mouse input to win32, analyze graphical output 
----
XML-NewsML-0.4
http://search.cpan.org/~andy/XML-NewsML-0.4/
Simple interface for creating NewsML documents 
----
go-perl-0.07
http://search.cpan.org/~cmungall/go-perl-0.07/
----
html-table-2.07-beta
http://search.cpan.org/~ajpeacock/html-table-2.07-beta/
----
libmodule-build-pm-filter-perl_0.9.1
http://search.cpan.org/~vmoral/libmodule-build-pm-filter-perl_0.9.1/
----
local-lib-1.000000
http://search.cpan.org/~mstrout/local-lib-1.000000/
create and use a local lib/ for perl modules with PERL5LIB 
----
pler-0.28
http://search.cpan.org/~adamk/pler-0.28/
The DWIM Perl Debugger 


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, 13 Sep 2007 22:44:32 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: New to Perl - strange behaviour with backticks
Message-Id: <5pOdna7HOrsggnfbnZ2dnUVZ_oytnZ2d@comcast.com>

Eric wrote:
> I am trying to set up a CGI script that will run two other scripts and
> then write a short message back to the webpage.  I have this mostly
> working, except for one strange issue: after using backticks to read
> the stdout from the first script, stdout from the second script is
> being printed to the page as if it were printed from the CGI script
> that acts as the caller.

If the first script is called using backticks and the second one is
called using system(), then that is proper and expected behavior.

> The behaviour disappears if I comment out
> the backticks, but then I can't get the information i need from the
> stdout of the first script.

That does not sound right - could be that the second script is not
sending anything at all to stdout.

> print "Content-type: text/html\n\n";
> my $query = new CGI;

You could use methods in the CGI module to output the Content-type.

> my $pdbCode = $query->param("pdbcode");
> my $scriptPath = "~/Sites/etaserver/bin";
> my $rankPath = "~/Documents/Templates/Distance\ Matcher/Data/2006/
> Data";
> my $pdbPath = "~/Documents/Templates/Distance\ Matcher/Data/
> 2006/2006pdb90\ ET/$pdbCode";
> my $pymolPath = "/sw/lib/pymol-py24/bin/pymol";
> 
> my $extractMotifArgs = "perl -I$scriptPath \"$scriptPath/
> extractmotif.pl\" \"$pdbPath/$pdbCode.clusters\" \"$pdbPath/
> $pdbCode.dssp\" \"$pdbPath/$pdbCode.pdb\" \"$pdbPath/$p

Have you heard of qq()?  It eliminates the need to escape double quotes.

my $extractMotifArgs = qq(perl -I$scriptPath "$scriptPath/extractmotif.pl" "$pdbPath/$pdbCode.clusters" "$pdbPath/$pdbCode.dssp" "$pdbPath/$pdbCode.pdb" "$pdbPath/$p");

>   my $args = ("$pymolPath -cr $scriptPath/createPyMolImage.py --
> $pdbCode \"$pdbPath\" $motifs");
>   system($args);

my $args = qq($pymolPath -cr $scriptPath/createPyMolImage.py -- $pdbCode "$pdbPath" $motifs);
my $result = `$args </dev/null`;
print "Error: Unexpected output from $pymolPath: '$result'\n";

	-Joe


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

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


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