[30593] in Perl-Users-Digest
Perl-Users Digest, Issue: 1836 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 4 09:09:50 2008
Date: Thu, 4 Sep 2008 06:09:12 -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, 4 Sep 2008 Volume: 11 Number: 1836
Today's topics:
Re: "Selling" Perl (i.e. getting the boss to let me ins <tadmc@seesig.invalid>
Re: Compile vs mod_perl vs perl <Peter@PSDT.com>
cpan link not stuck to a version jidanni@jidanni.org
Re: cpan link not stuck to a version <1usa@llenroc.ude.invalid>
Re: cpan link not stuck to a version jidanni@jidanni.org
Re: cpan link not stuck to a version <peter@makholm.net>
Re: cpan link not stuck to a version <1usa@llenroc.ude.invalid>
Re: Find changes or differences in 2 text files <tadmc@seesig.invalid>
Re: How to check the size of each files that are being <tower.grv@gmail.com>
new CPAN modules on Thu Sep 4 2008 (Randal Schwartz)
Re: perl - CGI problem <zhilianghu@gmail.com>
Re: perl - CGI problem xhoster@gmail.com
Problem with Eval in Constructing AoA <gundalav@gmail.com>
Re: Problem with Eval in Constructing AoA <peter@makholm.net>
Re: Threads and sharing global variable <zentara@highstream.net>
Re: using 2-arg open to open to a scalar xhoster@gmail.com
Re: using 2-arg open to open to a scalar <1usa@llenroc.ude.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 3 Sep 2008 20:22:50 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <slrngbue3a.7av.tadmc@tadmc30.sbcglobal.net>
P B <newsposter625@gmail.com.invalid> wrote:
> On 2008-09-03, l v <veatchla@yahoo.com> wrote:
>> P B wrote:
>>> I'd like to install ActivePerl on a Windows XP machine ...
>>> [snip]
>
>> You "sell" the installation of Perl by tying it to a business need,
>> show it's value and how Perl allows you to meet the business need.
>
> Yeah, I got that much from `perlfaq -q convince' but I have already
> successfully shown these people how Perl effectively meets a business
> need. They agree, but they are still reserved when it comes to
> installing things they're not familiar with. It's my job (in this case)
> to make them familiar with the security implications of a Perl
> installation.
The proper place for fear is regarding the programs written in
Perl, not the installation of perl.
The probability of providing a "vector" in a Perl program is,
at least, thousands of times greater than the probability of
the perl program providing a vector.
Hopefully they don't know this much, or they'd really freak out... ;-)
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Thu, 04 Sep 2008 12:35:11 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: Compile vs mod_perl vs perl
Message-Id: <pan.2008.09.04.12.35.10.818931@PSDT.com>
On Wed, 03 Sep 2008 14:30:20 +0100, bugbear wrote:
> Bill H wrote:
>> Background:
>> I have a program that uses PDF:API2 to generate pdf files based on
>> html text and images. When done it then generates preview images of
>> the pages using Imagemagik. The program does not interaface with the
>> web so there is no communication with a browser.
>
> That modules runs quite quickly, but has a filthy
> startup time, mainly spent loading complex
> font information that may well not be used.
That suggests that Persistent Perl (http://daemoninc.com/PersistentPerl/)
would be a good idea, but it hasn't been updated in ages. Anyone know of
a successor?
--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
------------------------------
Date: Thu, 04 Sep 2008 09:20:27 +0800
From: jidanni@jidanni.org
To: best permanent CPAN links
Subject: cpan link not stuck to a version
Message-Id: <87ej40puzo.fsf@jidanni.org>
I want to make a link the Win32::Shortcut web page on CPAN to put into
http://en.wikipedia.org/wiki/Computer_shortcut#External_links , but
http://search.cpan.org/src/JDB/libwin32-0.28/Shortcut/docs/index.html or
http://search.cpan.org/src/JDB/libwin32-0.28/Shortcut/ have the
version hardwired in them: my link will stale soon. But
http://search.cpan.org/search?query=Win32::Shortcut brings up a wad of
others too on the same page.
------------------------------
Date: Thu, 04 Sep 2008 02:16:44 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: cpan link not stuck to a version
Message-Id: <Xns9B0EE2A26949Basu1cornelledu@127.0.0.1>
jidanni@jidanni.org wrote in news:87ej40puzo.fsf@jidanni.org:
> I want to make a link the Win32::Shortcut web page on CPAN to put into
> http://en.wikipedia.org/wiki/Computer_shortcut#External_links , but
> http://search.cpan.org/src/JDB/libwin32-0.28/Shortcut/docs/index.html or
> http://search.cpan.org/src/JDB/libwin32-0.28/Shortcut/ have the
> version hardwired in them: my link will stale soon. But
> http://search.cpan.org/search?query=Win32::Shortcut brings up a wad of
> others too on the same page.
http://search.cpan.org/~jdb/Win32-Shortcut-0.07/
Those pages have links to all versions. When version 0.08 is released, the
page will display a note to that effect. E.g., compare to:
http://search.cpan.org/~jdb/Win32-Shortcut-0.06/
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Thu, 04 Sep 2008 11:26:26 +0800
From: jidanni@jidanni.org
Subject: Re: cpan link not stuck to a version
Message-Id: <87tzcwoal9.fsf@jidanni.org>
>>>>> "ASU" == A Sinan Unur <1usa@llenroc.ude.invalid> writes:
ASU> http://search.cpan.org/~jdb/Win32-Shortcut-0.07/
ASU> Those pages have links to all versions. When version 0.08 is released, the
ASU> page will display a note to that effect. E.g., compare to:
ASU> http://search.cpan.org/~jdb/Win32-Shortcut-0.06/
How utterly terrible of a system. Isn't something like Debian's
http://packages.debian.org/sid/libgeography-nationalgrid-perl
a little better. Indeed, that links to
http://search.cpan.org/dist/Geography-NationalGrid/
a genuine CPAN URL with no version hardwired that zeros in on the
package. ...
Wait, upon digging and digging I have found the "permalink"
http://search.cpan.org/dist/Win32-Shortcut/
But as the permalinks are so poorly promoted that nobody ends up
linking to them.
------------------------------
Date: Thu, 04 Sep 2008 06:54:50 +0200
From: Peter Makholm <peter@makholm.net>
Subject: Re: cpan link not stuck to a version
Message-Id: <87d4jkecit.fsf@hacking.dk>
jidanni@jidanni.org writes:
> I want to make a link the Win32::Shortcut web page on CPAN to put into
> http://en.wikipedia.org/wiki/Computer_shortcut#External_links , but
In the upper right corner of
http://search.cpan.org/src/JDB/libwin32-0.28/Shortcut/
Ther is a link called 'permalink'. This link will always brin you to
the latest version of the Win32::Shortcut documentation:
http://search.cpan.org/perldoc?Win32::Shortcut
//Makhonlm
------------------------------
Date: Thu, 04 Sep 2008 04:57:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: cpan link not stuck to a version
Message-Id: <Xns9B0F9C62B3DDasu1cornelledu@127.0.0.1>
jidanni@jidanni.org wrote in news:87tzcwoal9.fsf@jidanni.org:
>>>>>> "ASU" == A Sinan Unur <1usa@llenroc.ude.invalid> writes:
>
> ASU> http://search.cpan.org/~jdb/Win32-Shortcut-0.07/
>
> ASU> Those pages have links to all versions.
> ASU> When version 0.08 is released, the
> ASU> page will display a note to that effect. E.g.,
> ASU> compare to:
>
> ASU> http://search.cpan.org/~jdb/Win32-Shortcut-0.06/
>
> How utterly terrible of a system.
I don't think it is a terrible system.
Things can change between versions of a module. What you write about and
reference today may not exist in the next version (a concern esp. since
a version number like 0.07 does not indicate a mature module to me).
As for "scholarly" purposes, I believe it is common practice to
reference the document you actually read rather than some unknown future
version of it.
> Wait, upon digging and digging I have found the "permalink"
> http://search.cpan.org/dist/Win32-Shortcut/
>
> But as the permalinks are so poorly promoted that nobody ends up
> linking to them.
I wasn't aware of the permalink feature. But I don't anticipate using it
precisely for the reason above.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Wed, 3 Sep 2008 19:30:26 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Find changes or differences in 2 text files
Message-Id: <slrngbub12.7av.tadmc@tadmc30.sbcglobal.net>
Bill H <bill@ts1000.us> wrote:
> On Sep 3, 2:20 pm, Leon Timmermans <faw...@gmail.com> wrote:
>> On Wed, 03 Sep 2008 11:09:42 -0700, Bill H wrote:
>> > Something along the lines of Diff without having to shell out to
>> > it (unless Difff is faster).
^^^^^^^^^
^^^^^^^^^
Are you coding a high-performance application or expect hundred-Mb
strings to compare or something?
"Premature optimization is the root of all evil". (Google it)
First you want an approach that does what you want it to do.
Only if the 1st approach proves to be too slow should you
concern yourself with execution speed.
>> Please try CPAN before asking these kinds of questions.
This is some very sage advice. Please don't dismiss it...
> Thanks for the tip - FYI searching for any variation of:
>
> Find changes or differences in 2 text files
>
> Finds nothing on Cpan. The search engine on there is very limited.
It is a keyword search, not a natural language processing search.
You need to give it a keyword.
Like "Diff", which you already knew was a relevant keyword.
> I
> would need to know what I am looking for to find what I am looking
> for.
You did know what you were looking for, you were looking for
something along the lines of "Diff", so I fail to see the
relevance of the quote snippet above.
> And if I search for Diff, I get 124 different modules to dig
> through.
FYI, posting here rather than first taking the 5 minutes necessary
to dig through CPAN results can severely damage your ability to get
help with future Perl questions.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Thu, 4 Sep 2008 00:21:35 -0700 (PDT)
From: "tower.grv@gmail.com" <tower.grv@gmail.com>
Subject: Re: How to check the size of each files that are being uploaded
Message-Id: <71c9c295-87c5-4159-83a3-43b90f282e24@a2g2000prm.googlegroups.com>
> Partial solution is to use javascript to check file sizes before user click on
> Send button. But be sure to warn users which have javascript disabled in
> browser. It is very simple:
>
> <body>
> <noscript>
> <div style="border: 2px solid red">You have not javascript enabled, please
> enable it.</div>
> </noscript>
> --
I tried to get file size with javascrip but i found that it is
imposiblem. Browsers don't allow this operation.
Do you know how to do this?
------------------------------
Date: Thu, 4 Sep 2008 04:42:22 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Sep 4 2008
Message-Id: <K6nMEM.BKL@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.
Acme-Lisp-0.03
http://search.cpan.org/~ambs/Acme-Lisp-0.03/
Evals lisp code on array references
----
Acme-Samurai-0.02
http://search.cpan.org/~tomita/Acme-Samurai-0.02/
Samurai de gozaru
----
Amb-0.02
http://search.cpan.org/~karasik/Amb-0.02/
non-deterministic operators
----
App-sh2p-0.02
http://search.cpan.org/~clive/App-sh2p-0.02/
Perl program to aid for conversion from UNIX shell to Perl
----
Bundle-Compress-Zlib-2.015
http://search.cpan.org/~pmqs/Bundle-Compress-Zlib-2.015/
Install Compress::Zlib and dependencies
----
Bundle-IO-Compress-Bzip2-2.015
http://search.cpan.org/~pmqs/Bundle-IO-Compress-Bzip2-2.015/
Install IO::Compress::Bzip2 and dependencies
----
Bundle-Lingua-PT-0.04
http://search.cpan.org/~ambs/Bundle-Lingua-PT-0.04/
install a set of useful modules for Natural Language Processing of the Portuguese
----
CPAN-1.92_64
http://search.cpan.org/~andk/CPAN-1.92_64/
query, download and build perl modules from CPAN sites
----
CPAN-Checksums-2.01
http://search.cpan.org/~andk/CPAN-Checksums-2.01/
Write a CHECKSUMS file for a directory as on CPAN
----
CPANPLUS-YACSmoke-0.04
http://search.cpan.org/~bingos/CPANPLUS-YACSmoke-0.04/
Yet Another CPANPLUS Smoke Tester
----
Calendar-Schedule-0.05
http://search.cpan.org/~vlado/Calendar-Schedule-0.05/
for managing calendar schedules
----
Catalyst-Controller-HTML-FormFu-0.03004
http://search.cpan.org/~cfranks/Catalyst-Controller-HTML-FormFu-0.03004/
----
Catalyst-Helper-AuthDBIC-0.05
http://search.cpan.org/~zarquon/Catalyst-Helper-AuthDBIC-0.05/
(EXPERIMENTAL)
----
Catalyst-Plugin-StackTrace-0.09
http://search.cpan.org/~mstrout/Catalyst-Plugin-StackTrace-0.09/
Display a stack trace on the debug screen
----
Chart-Clicker-2.07
http://search.cpan.org/~gphat/Chart-Clicker-2.07/
Powerful, extensible charting.
----
Class-DBI-ClassGenerator-1.01
http://search.cpan.org/~dcantrell/Class-DBI-ClassGenerator-1.01/
generate Class::DBI sub-class modules from a pre-exsting database's structure.
----
Compress-Raw-Bzip2-2.015
http://search.cpan.org/~pmqs/Compress-Raw-Bzip2-2.015/
Low-Level Interface to bzip2 compression library
----
Compress-Raw-Zlib-2.015
http://search.cpan.org/~pmqs/Compress-Raw-Zlib-2.015/
Low-Level Interface to zlib compression library
----
Compress-Zlib-2.015
http://search.cpan.org/~pmqs/Compress-Zlib-2.015/
Interface to zlib compression library
----
Config-AutoConf-0.10
http://search.cpan.org/~ambs/Config-AutoConf-0.10/
A module to implement some of AutoConf macros in pure perl.
----
Data-Rx-0.002
http://search.cpan.org/~rjbs/Data-Rx-0.002/
perl implementation of Rx schema system
----
Fey-DBIManager-0.07
http://search.cpan.org/~drolsky/Fey-DBIManager-0.07/
Manage a set of DBI handles
----
Games-Risk-0.3.0
http://search.cpan.org/~jquelin/Games-Risk-0.3.0/
classical 'risk' board game
----
Games-Risk-0.3.1
http://search.cpan.org/~jquelin/Games-Risk-0.3.1/
classical 'risk' board game
----
Games-Risk-0.3.2
http://search.cpan.org/~jquelin/Games-Risk-0.3.2/
classical 'risk' board game
----
Games-Sudoku-SudokuTk-0.09
http://search.cpan.org/~cguine/Games-Sudoku-SudokuTk-0.09/
Sudoku Game
----
Graphics-Primitive-0.27
http://search.cpan.org/~gphat/Graphics-Primitive-0.27/
Device and library agnostic graphic primitives
----
Graphics-Primitive-0.28
http://search.cpan.org/~gphat/Graphics-Primitive-0.28/
Device and library agnostic graphic primitives
----
Graphics-Primitive-Driver-Cairo-0.23
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.23/
Cairo backend for Graphics::Primitive
----
HTML-FormFu-0.03004
http://search.cpan.org/~cfranks/HTML-FormFu-0.03004/
HTML Form Creation, Rendering and Validation Framework
----
HTML-FormFu-ExtJS-0.02
http://search.cpan.org/~perler/HTML-FormFu-ExtJS-0.02/
Render and validate ExtJS forms using HTML::FormFu
----
HTTP-Engine-0.0.16
http://search.cpan.org/~yappo/HTTP-Engine-0.0.16/
Web Server Gateway Interface and HTTP Server Engine Drivers (Yet Another Catalyst::Engine)
----
HTTP-Proxy-0.23
http://search.cpan.org/~book/HTTP-Proxy-0.23/
A pure Perl HTTP proxy
----
IO-Compress-Base-2.015
http://search.cpan.org/~pmqs/IO-Compress-Base-2.015/
Base Class for IO::Compress modules
----
IO-Compress-Bzip2-2.015
http://search.cpan.org/~pmqs/IO-Compress-Bzip2-2.015/
Write bzip2 files/buffers
----
IO-Compress-Lzf-2.015
http://search.cpan.org/~pmqs/IO-Compress-Lzf-2.015/
Write lzf files/buffers
----
IO-Compress-Lzop-2.015
http://search.cpan.org/~pmqs/IO-Compress-Lzop-2.015/
Write lzop files/buffers
----
IO-Compress-Zlib-2.015
http://search.cpan.org/~pmqs/IO-Compress-Zlib-2.015/
----
Image-Match-1.02
http://search.cpan.org/~karasik/Image-Match-1.02/
locate an image inside another
----
Lingua-JA-Alphabet-Yomi-0.02
http://search.cpan.org/~tomita/Lingua-JA-Alphabet-Yomi-0.02/
Alphabet Katakana pronunciations
----
Lingua-JA-Gal-0.02
http://search.cpan.org/~tomita/Lingua-JA-Gal-0.02/
Leet speak by Japanese gals
----
Lingua-PT-Abbrev-0.07
http://search.cpan.org/~ambs/Lingua-PT-Abbrev-0.07/
An abbreviations dictionary manager for NLP
----
Lingua-PT-ProperNames-0.09
http://search.cpan.org/~ambs/Lingua-PT-ProperNames-0.09/
Simple module to extract proper names from Portuguese Text
----
Mobile-Ads-0.0.2
http://search.cpan.org/~tchatzi/Mobile-Ads-0.0.2/
base class for Mobile Ads
----
Moose-0.57
http://search.cpan.org/~drolsky/Moose-0.57/
A postmodern object system for Perl 5
----
MooseX-LogDispatch-1.1003
http://search.cpan.org/~jgoulah/MooseX-LogDispatch-1.1003/
A Logging Role for Moose
----
Muldis-Rosetta-0.11.1
http://search.cpan.org/~duncand/Muldis-Rosetta-0.11.1/
Full-featured truly relational DBMS in Perl
----
Net-Amazon-AWIS-0.34
http://search.cpan.org/~shevek/Net-Amazon-AWIS-0.34/
Use the Amazon Alexa Web Information Service
----
Net-Amazon-S3-Policy-0.1.2
http://search.cpan.org/~polettix/Net-Amazon-S3-Policy-0.1.2/
manage Amazon S3 policies for HTTP POST forms
----
Net-CUPS-0.59
http://search.cpan.org/~dhageman/Net-CUPS-0.59/
Common Unix Printing System Interface
----
Nevermore-0.01
http://search.cpan.org/~sri/Nevermore-0.01/
----
Script-Toolbox-0.23
http://search.cpan.org/~eckardt/Script-Toolbox-0.23/
Framework for the daily business scripts
----
Subtitles-1.01
http://search.cpan.org/~karasik/Subtitles-1.01/
handle video subtitles in various text formats
----
Test-Aggregate-0.33
http://search.cpan.org/~flora/Test-Aggregate-0.33/
Aggregate *.t tests to make them run faster.
----
Text-FixedWidth-0.03
http://search.cpan.org/~jhannah/Text-FixedWidth-0.03/
Easy OO manipulation of fixed width text files.
----
Text-FixedWidth-0.04
http://search.cpan.org/~jhannah/Text-FixedWidth-0.04/
Easy OO manipulation of fixed width text files.
----
Tie-IxHash-FixedSize-0.10
http://search.cpan.org/~mschout/Tie-IxHash-FixedSize-0.10/
Tie::IxHash with a fixed maximum size
----
Time-Stats-0.1
http://search.cpan.org/~pmichaud/Time-Stats-0.1/
Easy timing info
----
Verilog-Perl-3.041
http://search.cpan.org/~wsnyder/Verilog-Perl-3.041/
----
WWW-Comix-0.1.1
http://search.cpan.org/~polettix/WWW-Comix-0.1.1/
programmatically access comics on the web
----
WebService-EveOnline-0.62
http://search.cpan.org/~chrisc/WebService-EveOnline-0.62/
a wrapper intended to (eventually) provide a useful interface to the MMORPG game, "Eve Online"
----
WebService-Google-Contact-0.0.1
http://search.cpan.org/~abui/WebService-Google-Contact-0.0.1/
Simple Interface for Google Contact API.
----
WebService-Google-Contact-0.01
http://search.cpan.org/~abui/WebService-Google-Contact-0.01/
Simple Interface for Google Contact API.
----
WebService-Google-Contact-0.1
http://search.cpan.org/~abui/WebService-Google-Contact-0.1/
Simple Interface for Google Contact API.
----
Wx-0.86
http://search.cpan.org/~mbarbon/Wx-0.86/
interface to the wxWidgets cross-platform GUI toolkit
----
XML-RelaxNG-Compact-PXB-0.11
http://search.cpan.org/~mpg/XML-RelaxNG-Compact-PXB-0.11/
create perl XML (RelaxNG Compact) data binding API
----
XML-RelaxNG-Compact-PXB-0.12
http://search.cpan.org/~mpg/XML-RelaxNG-Compact-PXB-0.12/
create perl XML (RelaxNG Compact) data binding API
----
macro-0.03
http://search.cpan.org/~gfuji/macro-0.03/
An implementation of macro processor
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: Wed, 3 Sep 2008 19:56:11 -0700 (PDT)
From: Zhiliang Hu <zhilianghu@gmail.com>
Subject: Re: perl - CGI problem
Message-Id: <a1d64ec0-6dab-4cd2-b062-64932f42e695@v13g2000pro.googlegroups.com>
Thank you all for the hints. So if I send the job to background and
use a "transit page" to watch (by refresh) for the finishing of the
program, I should get by. I will try that out.
Best regards,
Zhiliang
------------------------------
Date: 04 Sep 2008 10:34:50 GMT
From: xhoster@gmail.com
Subject: Re: perl - CGI problem
Message-Id: <20080904063451.016$og@newsreader.com>
Zhiliang Hu <zhilianghu@gmail.com> wrote:
> Thank you all for the hints. So if I send the job to background and
> use a "transit page" to watch (by refresh) for the finishing of the
> program, I should get by. I will try that out.
Another thing to try is to have the original script print a progress
character (like "+\n") every now and then, to keep the browser mesmerized.
It is quite a bit simpler than a refreshing transit page, and often gets
the job done.
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: Wed, 3 Sep 2008 23:53:54 -0700 (PDT)
From: Gundala Viswanath <gundalav@gmail.com>
Subject: Problem with Eval in Constructing AoA
Message-Id: <a9bfd685-7b71-444a-8a9c-4ee9d82803d0@a2g2000prm.googlegroups.com>
Hi,
This code below tries to convert
the string in newick format into the corresponding
data structure (Array of Array).
But somehow the EVAL function doesn't work
as expected. What's wrong with my code here?
__BEGIN__
use Data::Dumper;
use Carp;
my $str = "(foo,(bar,qux))"; #Newick format
print "$str\n";
my $ar = conv_newick2aoa($str);
print Dumper $ar ;
sub conv_newick2aoa {
my $nstr_in = shift;
my $nstr = $nstr_in;
for ($nstr) {
s/\\/\\\\/g;
s/'/\\'/g;
s/\(/['/g;
s/\)/']/g;
s/,/','/g;
}
return eval{$nstr};
}
__END__
Why it doesn't give this output instead:
$VAR1 = [
'foo',
[
'bar',
'qux'
]
];
Regards,
Gundala Viswanath
Jakarta-INDONESIA
------------------------------
Date: Thu, 04 Sep 2008 09:06:20 +0200
From: Peter Makholm <peter@makholm.net>
Subject: Re: Problem with Eval in Constructing AoA
Message-Id: <877i9se6fn.fsf@hacking.dk>
Gundala Viswanath <gundalav@gmail.com> writes:
> my $str = "(foo,(bar,qux))"; #Newick format
> print "$str\n";
>
> my $ar = conv_newick2aoa($str);
> print Dumper $ar ;
>
> sub conv_newick2aoa {
>
> my $nstr_in = shift;
> my $nstr = $nstr_in;
> for ($nstr) {
> s/\\/\\\\/g;
> s/'/\\'/g;
> s/\(/['/g;
> s/\)/']/g;
> s/,/','/g;
> }
>
> return eval{$nstr};
This probably isn't doing what you think. Here you try to evaluate the
block consisting on the literal code '$nstr', which of course
evaluates to the value of the variable $nstr.
What you want to is to evaluate the value of $nstr itself. That is
return eval $nstr.
... but in you example $nstr doesn't consist of valid perlcode.
//Makholm
------------------------------
Date: Thu, 04 Sep 2008 08:31:48 -0400
From: zentara <zentara@highstream.net>
Subject: Re: Threads and sharing global variable
Message-Id: <pukvb4dme93men553feh4vkrbhibd0j3nv@4ax.com>
On Wed, 3 Sep 2008 09:44:02 -0700 (PDT), anguyen@redhat.com wrote:
>Hi,
>I am having a global array @gDone, and after spawning a number
>threads, each would set the corresponding element to TRUE to signify
>it has done its work so the parent thread could stop waiting.
>It seems like the update of @gDone is not seen in the parent thread.
>The print of $gDone[$tid] is always either FALSE or undef, depending
>on how I set it in the parent thread.
>Can someone help providing an explanation for this?
>Anh-
A couple of possible explanations:
1. You set the values of the array before you declared it shared.
2. The parent thread will not automagically see the changes in the array
due to a thread action, you must active read it in the main thread to
update it. This is a problem in Gui's and threads, where you need a
timer run in the main thread to constantly re-read the array at a fast
interval.
Otherwise, show a minimal code example that runs and demonstrates the
problem.
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/Remember_How_Lucky_You_Are.html
------------------------------
Date: 04 Sep 2008 11:21:04 GMT
From: xhoster@gmail.com
Subject: Re: using 2-arg open to open to a scalar
Message-Id: <20080904072105.577$2p@newsreader.com>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
> xhoster@gmail.com wrote in news:20080902165755.862$vr@newsreader.com:
>
> > I'm looking for a value to put in $some_string so that the
> > below code will have $y read from $scalar. I can't use the "<&4"
> > syntax, since $x doesn't have a real fileno to be duped.
> >
> >
> > open my $x, "<", \$scalar or die $!;
> > open my $y, $some_string or die $!;
> >
> > The context of this is that I have an external (i.e. not my code)
> > module which won't take a file-handle, it will only take a "filename"
> > which gets passed to the 2-argument form of open. So I want to craft
> > a magical "filename" that when given to 2-arg open, does what I want.
>
> C:\Temp> cat tt.pl
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> use Alias;
>
> my $input_text = <<EOT;
> sdksdfk;lf';lk lk l;' k
> asfas;l's' k' k'adkd;fka'gka' ' ksf'sg
> ;sk;sdkg;skg;sk
> lsdf;ksdfk
> EOT
>
> open my $input, '<', \$input_text;
> alias INPUT => $input;
>
> myread( "<&=INPUT");
Excellent, thanks. I just had to add the package name because in my
case myread is in a different package.
myread("<&=main::INPUT")
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: Thu, 04 Sep 2008 12:11:22 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: using 2-arg open to open to a scalar
Message-Id: <Xns9B0F534ED146Fasu1cornelledu@127.0.0.1>
xhoster@gmail.com wrote in news:20080904072105.577$2p@newsreader.com:
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>> xhoster@gmail.com wrote in news:20080902165755.862$vr@newsreader.com:
>>
...
>> open my $input, '<', \$input_text;
>> alias INPUT => $input;
>>
>> myread( "<&=INPUT");
>
> Excellent, thanks. I just had to add the package name because in my
> case myread is in a different package.
>
> myread("<&=main::INPUT")
Glad it worked. This is why I love this group: Prior to your post, I
would never have thought about how to achieve what you want to achieve.
This really helped me learn a lot about the open function some of whose
features I had not paid much attention to before.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
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 1836
***************************************