[29584] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 828 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 7 06:09:38 2007

Date: Fri, 7 Sep 2007 03:09:04 -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, 7 Sep 2007     Volume: 11 Number: 828

Today's topics:
    Re: Ensuring parent/child processes <jrpfinch@gmail.com>
    Re: Ensuring parent/child processes <jrpfinch@gmail.com>
        Function notation with mysql <usenet@larseighner.com>
        How do you use HTML::Widget::Plugin::Combo ?  justin.allegakoen@maptek.com.au
        new CPAN modules on Fri Sep  7 2007 (Randal Schwartz)
    Re: Poll with clpmisc option <bik.mido@tiscalinet.it>
        Posting Guidelines for comp.lang.perl.misc ($Revision:  tadmc@seesig.invalid
    Re: Reduce CPU time while polling serial port  justin.allegakoen@maptek.com.au
    Re: Reduce CPU time while polling serial port <stoupa@practisoft.cz>
        String question <paulito.santana@gmail.com>
    Re: String question <dummy@example.com>
    Re: String question <wahab-mail@gmx.net>
        trying to export some utility methods, and struggling <bugbear@trim_papermule.co.uk_trim>
    Re: Yahoo finance quotes retrieval failing <9fyh-t1fo@dea.spamcon.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 07 Sep 2007 01:27:12 -0700
From:  jrpfinch <jrpfinch@gmail.com>
Subject: Re: Ensuring parent/child processes
Message-Id: <1189153632.101960.283590@r34g2000hsd.googlegroups.com>

On 6 Sep, 19:02, xhos...@gmail.com wrote:
[snip]
> If you can have one
> bloated parent and one bloated child, why not one small parent and two
> bloated children?  The parent could wait on any child, and then kill the
> other. Or you could have a slim parent and a bloated child and a bloated
> grandchild. If the grandchild dies unexpectedly, the middle one will get a
> SIG{CHLD} and can kill itself.  If the middle one dies unexpected, the
> super-parent will get a SIG{CHLD} (or just return from a blocking waitpid)
> and can then kill the whole process group.
>

These sound like good solutions - however, the processes are bloated
because they both use many external modules.  Is there any way to have
the external modules only loaded by the children?  And have each child
only load the modules they need?

[snip]
> > I have read perlipc and would like to know what the approved way to do
> > this is.  I am thinking two solutions - 1. have a die signal handler
> > kill the other process 2. use big eval blocks to trap any unexpected
> > errors and kill the other process.
>
> That would work if your "unexpected" errors happen only in expected ways.
> What if you get blown out of the water by an untrapped or untrappable
> signal? Neither signal handlers nor eval blocks can then kill off the
> partner.  Is that tolerable or not?

Not really.  I would like to ensure that they both die together in all
possible circumstances (or at least as many as possible).

> If you have to detect even truly unexpected deaths, then one way would
> be to open a pipe between parent and child, and never close or write to the
> pipe. If the pipe becomes readable (as detected by select or IO::Select)
> then the other party must have gone away.  Alas this requires polling on
> the part of the survivor.

I will do this if I can't get the slim grandparent/parent solution
working.

Many thanks

Jon



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

Date: Fri, 07 Sep 2007 02:58:46 -0700
From:  jrpfinch <jrpfinch@gmail.com>
Subject: Re: Ensuring parent/child processes
Message-Id: <1189159126.966669.91750@50g2000hsm.googlegroups.com>

On 7 Sep, 09:27, jrpfinch <jrpfi...@gmail.com> wrote:
> On 6 Sep, 19:02, xhos...@gmail.com wrote:
> [snip]
>
> > If you can have one
> > bloated parent and one bloated child, why not one small parent and two
> > bloated children?  The parent could wait on any child, and then kill the
> > other. Or you could have a slim parent and a bloated child and a bloated
> > grandchild. If the grandchild dies unexpectedly, the middle one will get a
> > SIG{CHLD} and can kill itself.  If the middle one dies unexpected, the
> > super-parent will get a SIG{CHLD} (or just return from a blocking waitpid)
> > and can then kill the whole process group.
>
> These sound like good solutions - however, the processes are bloated
> because they both use many external modules.  Is there any way to have
> the external modules only loaded by the children?  And have each child
> only load the modules they need?
>
> [snip]

With regards this solution - I think I can do it if I use the dynamic
loading method detailed in this post:

http://groups.google.co.uk/group/comp.lang.perl.misc/browse_thread/thread/94ccc975cc704df3/3734dbe392990614?lnk=gst&q=dynamic+load+modules&rnum=11#3734dbe392990614

Dynamically loading modules in the children seems to considerably
reduce the memory used by the parent.



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

Date: 07 Sep 2007 09:40:54 GMT
From: Lars Eighner <usenet@larseighner.com>
Subject: Function notation with mysql
Message-Id: <slrnfe2752.1tsp.usenet@debranded.larseighner.com>

I'd like to work in perl, but it appears the Mysql module has been eaten by
DBI so it will no longer recognize funtion notation.  Is there any
procedural-type library for interfacing with Mysql?

-- 
Lars Eighner     <http://larseighner.com/>     <http://myspace.com/larseighner>
                         Countdown: 501 days to go.
                    What do you do when you're debranded?


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

Date: Thu, 06 Sep 2007 18:28:02 -0700
From:  justin.allegakoen@maptek.com.au
Subject: How do you use HTML::Widget::Plugin::Combo ?
Message-Id: <1189128482.600714.266620@57g2000hsv.googlegroups.com>

How exactly do you use HTML::Widget::Plugin::Combo; ?
The docs and google don't explain much. If it matters I'm trying to
get it working with CGI::Pretty - warnings and strict are enabled,
along with CGI::Carp qw(warningsToBrowser fatalsToBrowser).
I'd like a working example from any of you that are able to decipher
its usage. I'm currently poking around in the module itself, but
havent been able to figure out what $factory should be. And looking at
the .t file doesnt help much either.

As of now I'm guessing that I should be calling combo with 2 hash
references like so (?) :-

combo({}, {id => 'combo_box'})<br /><br />

Just in



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

Date: Fri, 7 Sep 2007 04:42:14 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Sep  7 2007
Message-Id: <JnzEEE.1Ao2@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-LeetSpeak-0.01
http://search.cpan.org/~jmadler/Acme-LeetSpeak-0.01/
Speak like a kI[)dI3 
----
Bio-Das-1.05
http://search.cpan.org/~lds/Bio-Das-1.05/
Interface to Distributed Annotation System 
----
Bio-Das-1.06
http://search.cpan.org/~lds/Bio-Das-1.06/
Interface to Distributed Annotation System 
----
Bio-Emboss-5.0.0.1
http://search.cpan.org/~pernst/Bio-Emboss-5.0.0.1/
Write EMBOSS programs in Perl 
----
Devel-PerlySense-0.01_10
http://search.cpan.org/~johanl/Devel-PerlySense-0.01_10/
IntelliSense for Perl 
----
Devel-PerlySense-0.01_11
http://search.cpan.org/~johanl/Devel-PerlySense-0.01_11/
IntelliSense for Perl 
----
GRID-Machine-0.075
http://search.cpan.org/~casiano/GRID-Machine-0.075/
Remote Procedure Calls over a SSH link 
----
GRID-Machine-0.076
http://search.cpan.org/~casiano/GRID-Machine-0.076/
Remote Procedure Calls over a SSH link 
----
GRID-Machine-0.077
http://search.cpan.org/~casiano/GRID-Machine-0.077/
Remote Procedure Calls over a SSH link 
----
Geo-Coordinates-OSGB-2.01
http://search.cpan.org/~toby/Geo-Coordinates-OSGB-2.01/
Convert Coordinates from Lat/Long to UK Grid 
----
HTML-Display-0.38
http://search.cpan.org/~corion/HTML-Display-0.38/
display HTML locally in a browser 
----
HTML-Mason-1.37
http://search.cpan.org/~drolsky/HTML-Mason-1.37/
High-performance, dynamic web site authoring system 
----
IP-ChinaISP
http://search.cpan.org/~pangj/IP-ChinaISP/
Querying China ISP from a given IP 
----
IP-ChinaISP-0.02
http://search.cpan.org/~pangj/IP-ChinaISP-0.02/
Retrieve an ISP in China from the given IP 
----
IPC-System-Simple-0.06
http://search.cpan.org/~pjf/IPC-System-Simple-0.06/
Call system() commands with a minimum of fuss 
----
Math-ConvexHull-1.02
http://search.cpan.org/~smueller/Math-ConvexHull-1.02/
Calculate convex hulls using Graham's scan (n*log(n)) 
----
MyLibrary-3.0.4
http://search.cpan.org/~emorgan/MyLibrary-3.0.4/
a database-driven website application for libraries 
----
Net-Domain-ExpireDate-0.80
http://search.cpan.org/~despair/Net-Domain-ExpireDate-0.80/
obtain expiration date of domain names 
----
Net-FullAuto-0.01
http://search.cpan.org/~reedfish/Net-FullAuto-0.01/
Perl Based Secure Distributed Computing Network Process Automation Utility 
----
Net-FullAuto-0.02
http://search.cpan.org/~reedfish/Net-FullAuto-0.02/
Perl Based Secure Distributed Computing Network Process Automation Utility 
----
Net-FullAuto-0.03
http://search.cpan.org/~reedfish/Net-FullAuto-0.03/
Perl Based Secure Distributed Computing Network Process Automation Utility 
----
Net-IP-Match-Regexp-1.00
http://search.cpan.org/~cdolan/Net-IP-Match-Regexp-1.00/
Efficiently match IP addresses against ranges 
----
Net-Whois-Raw-1.30
http://search.cpan.org/~despair/Net-Whois-Raw-1.30/
Get Whois information for domains 
----
Net-Whois-Raw-1.31
http://search.cpan.org/~despair/Net-Whois-Raw-1.31/
Get Whois information for domains 
----
Ogre-0.24
http://search.cpan.org/~slanning/Ogre-0.24/
Perl binding for the OGRE C++ graphics library 
----
POE-Component-Server-DNS-0.12
http://search.cpan.org/~bingos/POE-Component-Server-DNS-0.12/
A non-blocking, concurrent DNS server POE component 
----
POE-Filter-Slim-CLI-0.01
http://search.cpan.org/~agrundma/POE-Filter-Slim-CLI-0.01/
A POE filter for talking with SlimServer over CLI 
----
Package-Data-Inheritable-0.01
http://search.cpan.org/~gcerrai/Package-Data-Inheritable-0.01/
Inheritable and overridable package data/variables 
----
Package-Data-Inheritable-0.02
http://search.cpan.org/~gcerrai/Package-Data-Inheritable-0.02/
Inheritable and overridable package data/variables 
----
Perl-Critic-1.075_001
http://search.cpan.org/~elliotjs/Perl-Critic-1.075_001/
Critique Perl source code for best-practices 
----
Socialtext-Resting-RSS-0.01
http://search.cpan.org/~lukec/Socialtext-Resting-RSS-0.01/
Create rss feeds for a Socialtext workspace 
----
Test-Deep-0.098
http://search.cpan.org/~fdaly/Test-Deep-0.098/
Extremely flexible deep comparison 
----
Tk-RotatingGauge-0.01
http://search.cpan.org/~jquelin/Tk-RotatingGauge-0.01/
a rotating gauge for Tk 
----
Tk-RotatingGauge-0.02
http://search.cpan.org/~jquelin/Tk-RotatingGauge-0.02/
a rotating gauge for Tk 
----
Unicode-Semantics-1.02
http://search.cpan.org/~juerd/Unicode-Semantics-1.02/
Work around *the* Perl 5 Unicode bug 
----
WWW-Mechanize-TreeBuilder-1.00002
http://search.cpan.org/~ash/WWW-Mechanize-TreeBuilder-1.00002/
----
XML-Compile-0.53
http://search.cpan.org/~markov/XML-Compile-0.53/
Compilation based XML processing 
----
XML-XML2JSON-0.02
http://search.cpan.org/~ken/XML-XML2JSON-0.02/
Convert XML into JSON (and back again) using XML::LibXML 
----
rpm-build-perl-0.6.4
http://search.cpan.org/~atourbin/rpm-build-perl-0.6.4/


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: Fri, 07 Sep 2007 11:33:52 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Poll with clpmisc option
Message-Id: <gn62e351uli2uvmldbc4ql5vvm68odj23f@4ax.com>

On Thu, 06 Sep 2007 23:02:02 GMT, "John W. Krahn" <dummy@example.com>
wrote:

>> (Results thus far)
>
>And did you expect an argument?   :-)

No, I generally don't use prototypes.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Fri, 07 Sep 2007 07:10:11 GMT
From: tadmc@seesig.invalid
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
Message-Id: <nP6Ei.1859$Sd4.1637@nlpi061.nbdc.sbc.com>

Outline
   Before posting to comp.lang.perl.misc
      Must
       - Check the Perl Frequently Asked Questions (FAQ)
       - Check the other standard Perl docs (*.pod)
      Really Really Should
       - Lurk for a while before posting
       - Search a Usenet archive
      If You Like
       - Check Other Resources
   Posting to comp.lang.perl.misc
      Is there a better place to ask your question?
       - Question should be about Perl, not about the application area
      How to participate (post) in the clpmisc community
       - Carefully choose the contents of your Subject header
       - Use an effective followup style
       - Speak Perl rather than English, when possible
       - Ask perl to help you
       - Do not re-type Perl code
       - Provide enough information
       - Do not provide too much information
       - Do not post binaries, HTML, or MIME
      Social faux pas to avoid
       - Asking a Frequently Asked Question
       - Asking a question easily answered by a cursory doc search
       - Asking for emailed answers
       - Beware of saying "doesn't work"
       - Sending a "stealth" Cc copy
      Be extra cautious when you get upset
       - Count to ten before composing a followup when you are upset
       - Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------

Posting Guidelines for comp.lang.perl.misc ($Revision: 1.8 $)
    This newsgroup, commonly called clpmisc, is a technical newsgroup
    intended to be used for discussion of Perl related issues (except job
    postings), whether it be comments or questions.

    As you would expect, clpmisc discussions are usually very technical in
    nature and there are conventions for conduct in technical newsgroups
    going somewhat beyond those in non-technical newsgroups.

    The article at:

        http://www.catb.org/~esr/faqs/smart-questions.html

    describes how to get answers from technical people in general.

    This article describes things that you should, and should not, do to
    increase your chances of getting an answer to your Perl question. It is
    available in POD, HTML and plain text formats at:

     http://www.rehabitation.com/clpmisc.shtml

    For more information about netiquette in general, see the "Netiquette
    Guidelines" at:

     http://andrew2.andrew.cmu.edu/rfc/rfc1855.html

    A note to newsgroup "regulars":

       Do not use these guidelines as a "license to flame" or other
       meanness. It is possible that a poster is unaware of things
       discussed here.  Give them the benefit of the doubt, and just
       help them learn how to post, rather than assume that they do 
       know and are being the "bad kind" of Lazy.

    A note about technical terms used here:

       In this document, we use words like "must" and "should" as
       they're used in technical conversation (such as you will
       encounter in this newsgroup). When we say that you *must* do
       something, we mean that if you don't do that something, then
       it's unlikely that you will benefit much from this group.
       We're not bossing you around; we're making the point without
       lots of words.

    Do *NOT* send email to the maintainer of these guidelines. It will be
    discarded unread. The guidelines belong to the newsgroup so all
    discussion should appear in the newsgroup. I am just the secretary that
    writes down the consensus of the group.

Before posting to comp.lang.perl.misc
  Must
    This section describes things that you *must* do before posting to
    clpmisc, in order to maximize your chances of getting meaningful replies
    to your inquiry and to avoid getting flamed for being lazy and trying to
    have others do your work.

    The perl distribution includes documentation that is copied to your hard
    drive when you install perl. Also installed is a program for looking
    things up in that (and other) documentation named 'perldoc'.

    You should either find out where the docs got installed on your system,
    or use perldoc to find them for you. Type "perldoc perldoc" to learn how
    to use perldoc itself. Type "perldoc perl" to start reading Perl's
    standard documentation.

    Check the Perl Frequently Asked Questions (FAQ)
        Checking the FAQ before posting is required in Big 8 newsgroups in
        general, there is nothing clpmisc-specific about this requirement.
        You are expected to do this in nearly all newsgroups.

        You can use the "-q" switch with perldoc to do a word search of the
        questions in the Perl FAQs.

    Check the other standard Perl docs (*.pod)
        The perl distribution comes with much more documentation than is
        available for most other newsgroups, so in clpmisc you should also
        see if you can find an answer in the other (non-FAQ) standard docs
        before posting.

    It is *not* required, or even expected, that you actually *read* all of
    Perl's standard docs, only that you spend a few minutes searching them
    before posting.

    Try doing a word-search in the standard docs for some words/phrases
    taken from your problem statement or from your very carefully worded
    "Subject:" header.

  Really Really Should
    This section describes things that you *really should* do before posting
    to clpmisc.

    Lurk for a while before posting
        This is very important and expected in all newsgroups. Lurking means
        to monitor a newsgroup for a period to become familiar with local
        customs. Each newsgroup has specific customs and rituals. Knowing
        these before you participate will help avoid embarrassing social
        situations. Consider yourself to be a foreigner at first!

    Search a Usenet archive
        There are tens of thousands of Perl programmers. It is very likely
        that your question has already been asked (and answered). See if you
        can find where it has already been answered.

        One such searchable archive is:

         http://groups.google.com/advanced_group_search

  If You Like
    This section describes things that you *can* do before posting to
    clpmisc.

    Check Other Resources
        You may want to check in books or on web sites to see if you can
        find the answer to your question.

        But you need to consider the source of such information: there are a
        lot of very poor Perl books and web sites, and several good ones
        too, of course.

Posting to comp.lang.perl.misc
    There can be 200 messages in clpmisc in a single day. Nobody is going to
    read every article. They must decide somehow which articles they are
    going to read, and which they will skip.

    Your post is in competition with 199 other posts. You need to "win"
    before a person who can help you will even read your question.

    These sections describe how you can help keep your article from being
    one of the "skipped" ones.

  Is there a better place to ask your question?
    Question should be about Perl, not about the application area
        It can be difficult to separate out where your problem really is,
        but you should make a conscious effort to post to the most
        applicable newsgroup. That is, after all, where you are the most
        likely to find the people who know how to answer your question.

        Being able to "partition" a problem is an essential skill for
        effectively troubleshooting programming problems. If you don't get
        that right, you end up looking for answers in the wrong places.

        It should be understood that you may not know that the root of your
        problem is not Perl-related (the two most frequent ones are CGI and
        Operating System related), so off-topic postings will happen from
        time to time. Be gracious when someone helps you find a better place
        to ask your question by pointing you to a more applicable newsgroup.

  How to participate (post) in the clpmisc community
    Carefully choose the contents of your Subject header
        You have 40 precious characters of Subject to win out and be one of
        the posts that gets read. Don't waste them. Take care while
        composing them, they are the key that opens the door to getting an
        answer.

        Spend them indicating what aspect of Perl others will find if they
        should decide to read your article.

        Do not spend them indicating "experience level" (guru, newbie...).

        Do not spend them pleading (please read, urgent, help!...).

        Do not spend them on non-Subjects (Perl question, one-word
        Subject...)

        For more information on choosing a Subject see "Choosing Good
        Subject Lines":

         http://www.cpan.org/authors/id/D/DM/DMR/subjects.post

        Part of the beauty of newsgroup dynamics, is that you can contribute
        to the community with your very first post! If your choice of
        Subject leads a fellow Perler to find the thread you are starting,
        then even asking a question helps us all.

    Use an effective followup style
        When composing a followup, quote only enough text to establish the
        context for the comments that you will add. Always indicate who
        wrote the quoted material. Never quote an entire article. Never
        quote a .signature (unless that is what you are commenting on).

        Intersperse your comments *following* each section of quoted text to
        which they relate. Unappreciated followup styles are referred to as
        "top-posting", "Jeopardy" (because the answer comes before the
        question), or "TOFU" (Text Over, Fullquote Under).

        Reversing the chronology of the dialog makes it much harder to
        understand (some folks won't even read it if written in that style).
        For more information on quoting style, see:

         http://web.presby.edu/~nnqadmin/nnq/nquote.html

    Speak Perl rather than English, when possible
        Perl is much more precise than natural language. Saying it in Perl
        instead will avoid misunderstanding your question or problem.

        Do not say: I have variable with "foo\tbar" in it.

        Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
        or I have $var = <DATA> (and show the data line).

    Ask perl to help you
        You can ask perl itself to help you find common programming mistakes
        by doing two things: enable warnings (perldoc warnings) and enable
        "strict"ures (perldoc strict).

        You should not bother the hundreds/thousands of readers of the
        newsgroup without first seeing if a machine can help you find your
        problem. It is demeaning to be asked to do the work of a machine. It
        will annoy the readers of your article.

        You can look up any of the messages that perl might issue to find
        out what the message means and how to resolve the potential mistake
        (perldoc perldiag). If you would like perl to look them up for you,
        you can put "use diagnostics;" near the top of your program.

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.

    Provide enough information
        If you do the things in this item, you will have an Extremely Good
        chance of getting people to try and help you with your problem!
        These features are a really big bonus toward your question winning
        out over all of the other posts that you are competing with.

        First make a short (less than 20-30 lines) and *complete* program
        that illustrates the problem you are having. People should be able
        to run your program by copy/pasting the code from your article. (You
        will find that doing this step very often reveals your problem
        directly. Leading to an answer much more quickly and reliably than
        posting to Usenet.)

        Describe *precisely* the input to your program. Also provide example
        input data for your program. If you need to show file input, use the
        __DATA__ token (perldata.pod) to provide the file contents inside of
        your Perl program.

        Show the output (including the verbatim text of any messages) of
        your program.

        Describe how you want the output to be different from what you are
        getting.

        If you have no idea at all of how to code up your situation, be sure
        to at least describe the 2 things that you *do* know: input and
        desired output.

    Do not provide too much information
        Do not just post your entire program for debugging. Most especially
        do not post someone *else's* entire program.

    Do not post binaries, HTML, or MIME
        clpmisc is a text only newsgroup. If you have images or binaries
        that explain your question, put them in a publically accessible
        place (like a Web server) and provide a pointer to that location. If
        you include code, cut and paste it directly in the message body.
        Don't attach anything to the message. Don't post vcards or HTML.
        Many people (and even some Usenet servers) will automatically filter
        out such messages. Many people will not be able to easily read your
        post. Plain text is something everyone can read.

  Social faux pas to avoid
    The first two below are symptoms of lots of FAQ asking here in clpmisc.
    It happens so often that folks will assume that it is happening yet
    again. If you have looked but not found, or found but didn't understand
    the docs, say so in your article.

    Asking a Frequently Asked Question
        It should be understood that you may have missed the applicable FAQ
        when you checked, which is not a big deal. But if the Frequently
        Asked Question is worded similar to your question, folks will assume
        that you did not look at all. Don't become indignant at pointers to
        the FAQ, particularly if it solves your problem.

    Asking a question easily answered by a cursory doc search
        If folks think you have not even tried the obvious step of reading
        the docs applicable to your problem, they are likely to become
        annoyed.

        If you are flamed for not checking when you *did* check, then just
        shrug it off (and take the answer that you got).

    Asking for emailed answers
        Emailed answers benefit one person. Posted answers benefit the
        entire community. If folks can take the time to answer your
        question, then you can take the time to go get the answer in the
        same place where you asked the question.

        It is OK to ask for a *copy* of the answer to be emailed, but many
        will ignore such requests anyway. If you munge your address, you
        should never expect (or ask) to get email in response to a Usenet
        post.

        Ask the question here, get the answer here (maybe).

    Beware of saying "doesn't work"
        This is a "red flag" phrase. If you find yourself writing that,
        pause and see if you can't describe what is not working without
        saying "doesn't work". That is, describe how it is not what you
        want.

    Sending a "stealth" Cc copy
        A "stealth Cc" is when you both email and post a reply without
        indicating *in the body* that you are doing so.

  Be extra cautious when you get upset
    Count to ten before composing a followup when you are upset
        This is recommended in all Usenet newsgroups. Here in clpmisc, most
        flaming sub-threads are not about any feature of Perl at all! They
        are most often for what was seen as a breach of netiquette. If you
        have lurked for a bit, then you will know what is expected and won't
        make such posts in the first place.

        But if you get upset, wait a while before writing your followup. I
        recommend waiting at least 30 minutes.

    Count to ten after composing and before posting when you are upset
        After you have written your followup, wait *another* 30 minutes
        before committing yourself by posting it. You cannot take it back
        once it has been said.

AUTHOR
    Tad McClellan and many others on the comp.lang.perl.misc newsgroup.

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


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

Date: Thu, 06 Sep 2007 21:06:54 -0700
From:  justin.allegakoen@maptek.com.au
Subject: Re: Reduce CPU time while polling serial port
Message-Id: <1189138014.644915.287680@d55g2000hsg.googlegroups.com>

On Sep 7, 6:18 am, jis <jisma...@gmail.com> wrote:
> Hi,
>
> I am using Win32::serialport for reading a data through a scanner
> which is connected to the serial port.
> I use polling  as below.But this consumes 99% of my CPU time. and
> slows down the system.
>  while(!($data=~/\r/))
>     {
>          $data=$Scanner->input();     #read the scanner port
>         $labeldata=$labeldata.$data;         #append
>     }
>
> Is there any way I implement interrupts or events  using perl. Or is
> there any other method to solve this issue.
> I use WIndows NT4(its old..but i have to...)
>
> Pls share your ideas.
>
> Cheers,
> jis

You could also stick a sleep statement into your while loop.

use Win32;

Win32::Sleep(300);

HTH,
Just in



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

Date: Fri, 7 Sep 2007 06:09:44 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: Reduce CPU time while polling serial port
Message-Id: <fbqjc8$ofq$1@ns.felk.cvut.cz>

jis wrote:
> Hi,
>
> I am using Win32::serialport for reading a data through a scanner
> which is connected to the serial port.
> I use polling  as below.But this consumes 99% of my CPU time. and
> slows down the system.
> while(!($data=~/\r/))
>    {
>         $data=$Scanner->input();     #read the scanner port
>        $labeldata=$labeldata.$data;         #append
>    }
>
>
> Is there any way I implement interrupts or events  using perl. Or is
> there any other method to solve this issue.
> I use WIndows NT4(its old..but i have to...)
>
>
You can use Perl/Tk or Win32::GUI, create "timer" and look for 
$Scanner->status periodically, say evey 50 miliseconds.
-- 

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail 
from another non-spammer site please.)





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

Date: Fri, 07 Sep 2007 00:59:49 -0700
From:  Santana <paulito.santana@gmail.com>
Subject: String question
Message-Id: <1189151989.574873.250760@d55g2000hsg.googlegroups.com>


Hei all,
i'am a newbie in PERL and i find a solution for this problem :

I have a string "xxxxxxx" , i want put ones("1") on left of string, if
this string dont have a length of 20 character.

Example :

if i have th string "HELLO" and woul like get  this ;

"111111111111111HELLO"


How i can this ???



Thanks,
Paulito



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

Date: Fri, 07 Sep 2007 08:29:28 GMT
From: "John W. Krahn" <dummy@example.com>
Subject: Re: String question
Message-Id: <IZ7Ei.22492$Pd4.12190@edtnps82>

Santana wrote:
> Hei all,
> i'am a newbie in PERL and i find a solution for this problem :
> 
> I have a string "xxxxxxx" , i want put ones("1") on left of string, if
> this string dont have a length of 20 character.
> 
> Example :
> 
> if i have th string "HELLO" and woul like get  this ;
> 
> "111111111111111HELLO"
> 
> 
> How i can this ???

$ perl -le'
my $string = "HELLO";

print substr "1" x 20 . $string, -20;
'
111111111111111HELLO



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: Fri, 07 Sep 2007 11:33:34 +0200
From: Mirco Wahab <wahab-mail@gmx.net>
Subject: Re: String question
Message-Id: <fbr697$fds$1@mlucom4.urz.uni-halle.de>

Santana wrote:
> I have a string "xxxxxxx" , i want put ones("1") on left of string, if
> this string dont have a length of 20 character.
> if i have th string "HELLO" and would like get  this ;
> "111111111111111HELLO"
> How i can this ???

Just by printing the proper count of '1's in front of the string:

   ...
   $string = 'xxxxxxx';
   ...
   $string = '1' x (20-length $string) . $string;


No rocket science required here ;-)

Regards

M.


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

Date: Fri, 07 Sep 2007 09:00:56 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: trying to export some utility methods, and struggling
Message-Id: <13e219ogmi029cd@corp.supernews.com>

Dear All;
I'm trying to make a module to deal with
Widgets (not really, of course)

My design (in object terms) involves
a WidgetBasher, a WidgetManip base class,
and a few Widget sub-classes (WidgetManipA, WidgetManipB ...).

The WidgetBasher class has moderately
complex behaviour and coding, but is
also extensively configurable via WidgetsManips;
the WidgetDoer constructor takes an
array (ref) of WidgetManips.

My intention for the user (also me!)
is to be able to
   use WidgetBasher;

and then have the option of making
new WidgetManip sub-classes (if needed),
and then instantiating WidgetBashers
with arrays of (instantiated) WidgetManip
classes.

However, in the problem domain,
I also want the module to make some utility
methods and variables available; I would
like these to be avaiable (nearly) globally,
in that they are of use in the implementation of WidgetBasher,
the implementation of an WidgetManip sub-class,
and of great use to anybody (the user) working
on Widgets.

All of the object stuff I have working happily;
indeed it's rather trivial.

But I cannot for the life of me get my
"utility stuff" where I want it (everywhere!)

As a further requirment, I would ideally
like all this to reside in a single module file.

I have tried rather a lot of variations/permutations
of EXPORT, import, package, BEING { import ... }; etc,
and have come up empty.

If anyone can help I'd be grateful.

     BugBear


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

Date: Thu, 06 Sep 2007 22:40:16 -0700
From: bgoosh <9fyh-t1fo@dea.spamcon.org>
Subject: Re: Yahoo finance quotes retrieval failing
Message-Id: <20p1e3p6hdchdkftkccj8lu0vobf83p2ol@4ax.com>

Ben Morrow <ben@morrow.me.uk> wrote:

>
>Quoth bgoosh <9fyh-t1fo@dea.spamcon.org>:
>> I have a simple old Perl script that retrieves stock quotes, the
>> essence of which does:
>> 
>>    $yahoo_string = "/d/quotes.csv\?s=$symbol_list&f=sl9d1t1&e=.csv";
>>    # Go and get the quotes
>>    $FH = getwww ("quote.yahoo.com", 80, $yahoo_string);
>> 
>> It's worked fine for years; sometime between 8/21/07 and 8/28/07
>> it stopped working.  Now instead of a CSV list I get a Yahoo web
>> page response complaining about "HTTP/1.1 400 Bad Request" and
>> also:
><snip>
>> 
>> Anybody know how to fix this?
>
>Use LWP::Simple instead.
>
>> Or, I recall reading about a package Finance:Quotes or something
>> like that, does that still work?  If so I could probably change
>> my script to use that instead.
>
>http://search.cpan.org/
>
>Ben

Thank you, Ben.  Simply changing from the ancient getwww to LWP::Simple
fixed the problem.

-- 
A wok is what you throw at a wabbit.


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

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


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