[24723] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6878 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 18 03:05:53 2004

Date: Wed, 18 Aug 2004 00:05: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           Wed, 18 Aug 2004     Volume: 10 Number: 6878

Today's topics:
    Re: Can I easily automate testing of my cgi using Test: <wherrera@lynxview.com>
        CPANPLUS::Backend and Inline::Java <zebee@zip.com.au>
    Re: Earthquake forecasting program   Aug. 16, 2004 <somebody@somewhere.com>
    Re: Earthquake forecasting program   Aug. 16, 2004 <edgrsprj@ix.netcom.com>
    Re: Earthquake forecasting program   Aug. 16, 2004 <edgrsprj@ix.netcom.com>
    Re: Earthquake forecasting program   Aug. 16, 2004 <edgrsprj@ix.netcom.com>
    Re: editing perl script through TEXTAREA <tadmc@augustmail.com>
    Re: editing perl script through TEXTAREA <abigail@abigail.nl>
    Re: editing perl script through TEXTAREA (anita)
    Re: editing perl script through TEXTAREA (anita)
    Re: Forcing Array Context <tadmc@augustmail.com>
    Re: Forcing Array Context <tim@vegeta.ath.cx>
    Re: My own handy Pocket Reference notes (Randal L. Schwartz)
    Re: My own handy Pocket Reference notes <tim@vegeta.ath.cx>
    Re: My own handy Pocket Reference notes <pinyaj@rpi.edu>
    Re: My own handy Pocket Reference notes (Randal L. Schwartz)
    Re: My own handy Pocket Reference notes (Greg Bacon)
    Re: Operator for presence of value in list? <tadmc@augustmail.com>
    Re: Operator for presence of value in list? ctcgag@hotmail.com
    Re: pod2text and carriage-return's <tadmc@augustmail.com>
    Re: Trying to parse a variable name <ebohlman@omsdev.com>
        XY problem (was Re: editing perl script through TEXTARE <tadmc@augustmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 17 Aug 2004 20:11:12 -0600
From: Bill <wherrera@lynxview.com>
Subject: Re: Can I easily automate testing of my cgi using Test::[something]?
Message-Id: <rdadnZed78ZHJ7_cRVn-vA@adelphia.com>

SC wrote:
> I'd like to automate testing on a current project.  I read 
> Test::Tutorial and the related docs by Michael Schwern (Test::Simple and 
> Test::More) and everything seems prety clear to me.
> 
> The only problem is that all the examples are for testing modules. 
> (About which I don't really know anything).  Is there any way I can test 
> the output from my cgi scripts as-is using some of these testing tools 
> or am I out of luck?
> 
> My cgis are fairly simple affairs taking some params, reading from some 
> files/DBMs then outputing html.  I'm not doing anything really clever or 
> complicated but I find that the number of things I need to test for is 
> growing larger than I can easily handle manually.
> 
> I'd really appreciate it if anyone has link to a tutorial or howto on 
> the subject.
> 
> 
> Scot
> 
Look at CGI::Test on CPAN.  And use -T. Taint mode is your shield.

Most of the work is still trying to decide what to test and under which 
circumstances, of course. You can easily spend more time revising the 
tests than the CGI :).


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

Date: 18 Aug 2004 04:24:58 GMT
From: Zebee Johnstone <zebee@zip.com.au>
Subject: CPANPLUS::Backend and Inline::Java
Message-Id: <slrnci5mao.npa.zebee@zeus.zipworld.com.au>

I am trying to script a set of module installations via
CPANPLUS::Backend.

So far I've git it all working bar one - Inline::Java.

This module requires you to
	perl Makefile.PL J2SDK=/path/to/your/j2sdk/installation
	make java
	make
	make install

I can get it to add the J2SDK flag via makemakerflags, but can't 
get it to make java before doing make.

I have tried:
 my $rv = $cb->install( modules =>['Inline::Java'],skiptest=>"1",makemakerflags=>'J2SDK=/usr/local/jdk',prereq_target=>'java');

It fails because "make java" hasn't been done, it goes straight
to make and can't continue because things "make java" should have
done are not done. (error: make: *** No rule to make target
`Java/InlineJavaServer.jar', needed by `pm_to_blib'.  Stop.)

I have tried it via 3 steps, fetch, extract, then make.  but the make
step:
my $rv = $cb->make( dirs=>['/root/.cpanplus/5.6.0/build/Inline-Java-0.49'],makemakerflags=>'J2SDK=/usr/local/jdk',prereq_target=>"java'");

fails in the same way, "make java" is not being done.

If I try target java, instead of prereq_target, with the idea of doing
two make steps, it complains that "Key 'target' is of invalid type for
CPANPLUS::Internals::Make::_make" I presume because it is not one of
make/install/test/makefile.

 Is there a way to script the installation of this module?

Zebee
-- 
Zebee Johnstone (zebee@zip.com.au), proud holder of
aus.motorcycles Poser Permit #1.
"Motorcycles are like peanuts... who can stop at just one?"


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

Date: Wed, 18 Aug 2004 01:27:42 GMT
From: MichiganBob <somebody@somewhere.com>
Subject: Re: Earthquake forecasting program   Aug. 16, 2004
Message-Id: <igyUc.1885$Rb5.1535@newssvr23.news.prodigy.com>

edgrsprj wrote:
> August 16, 2004   Posted to sci.geo.earthquakes and other Newsgroups
> 
> Newsgroup Readers:  I recommend that you send copies of this report to any
> government officials and researchers that you know who are interested in
> earthquake forecasting science.

Do your own spamming.


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

Date: Wed, 18 Aug 2004 06:03:43 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Earthquake forecasting program   Aug. 16, 2004
Message-Id: <3jCUc.25400$nx2.21126@newsread2.news.atl.earthlink.net>

"MichiganBob" <somebody@somewhere.com> wrote in message
news:igyUc.1885$Rb5.1535@newssvr23.news.prodigy.com...
> edgrsprj wrote:
> > August 16, 2004   Posted to sci.geo.earthquakes and other Newsgroups
> >
> > Newsgroup Readers:  I recommend that you send copies of this report to
any
> > government officials and researchers that you know who are interested in
> > earthquake forecasting science.
>
> Do your own spamming.

August 18, 2004

Here is the rationale for asking that people consider sending copies of the
report to their government  officials etc.

I talk with earthquake forecasting experts around the world all the time.
And what I have found is that communications between different forecasters,
research groups, government agencies etc. regarding this subject matter
probably fall somewhere between nonexistent and atrocious.  The situation is
so bad that it is shocking in my opinion.  And a few months ago I submitted
a proposal to UN / ISDR officials for how they might deal with that type of
problem.  They took it seriously.  But I don't know if they will act on it.

So, if you lived in Japan for example and wanted your government earthquake
forecasting researchers to know that someone was saying that he had
developed a computer program which might help them forecast some of their
own earthquakes then you could let them know that by sending them a copy of
that report.  Otherwise they might never become aware that the technology
existed.  I do circulate information by e-mail.  The Newsgroups are another
potentially valuable communications resource.




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

Date: Wed, 18 Aug 2004 06:03:44 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Earthquake forecasting program   Aug. 16, 2004
Message-Id: <4jCUc.25401$nx2.24562@newsread2.news.atl.earthlink.net>

"Oriel36" <geraldkelleher@hotmail.com> wrote in message
news:273f8e06.0408170318.1611ffb5@posting.google.com...
> "edgrsprj" <edgrsprj@ix.netcom.com> wrote in message
news:<0f1Uc.23551$nx2.17009@newsread2.news.atl.earthlink.net>...
> > August 16, 2004   Posted to sci.geo.earthquakes and other Newsgroups
> >

August 18, 2004

What my data show is that there is some type of link between the positions
of the sun and the moon in the sky and the times when many of our
earthquakes are being triggered.  And the only forces which I can picture as
being involved are the sun and moon gravitational pulls on the Earth.

The nature of the actual triggering mechanism is I believe still a mystery.
But I am not even certain of that because there has been some work in this
area done by researchers in Europe.  And I don't yet know if they have been
able to clearly identify the triggering mechanism.  It might be the bending,
stretching, and compression of fault zone rock layers related to the Solid
Earth Tide or perhaps something related to the differences between the sun
and moon gravitational forces related movements of the core of the Earth
versus those of its crust.

This is a matter that geophysicists can work on.  I am personally
certain that my computer programs, EM signal data, and theories could
provide them with a doorway to an exciting and valuable new area of science.
But so far no members of that community have expressed any interest in it.
I suspect that part of the problem has to do with the fact that celestial
mechanics are involved.  This is not a science which focuses simply on
geophysics.


Regarding copyrights,  I am not a legal expert.  But I believe that the
following is the case;

Here in the U.S., whenever you create a drawing, song, research report,
computer program etc. you are the automatic owner of the copyright for it.
But if you don't formally apply for a copyright with the U.S. Copyright
Office then if someone else wants to say that he created the computer
program etc. you would have to find some other way to prove that you were
the author.  In my opinion it is probably worth the $30 copyright fee to
avoid hassles like that.

At the top of my computer program there is a section which says that people
can use it for free.  And it says that they can modify it if they wish as
long as they note in that section of their copy that modifications were
made.  They can also send copies to other people as far as I am concerned.
What I have said they should not do is claim to be the original author of
the program or sell copies of it.

Remember, that Perl language computer program was primarily created in the
hopes that it might save some lives, not generate a fortune from patents or
copyrights.




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

Date: Wed, 18 Aug 2004 06:24:39 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Earthquake forecasting program   Aug. 16, 2004
Message-Id: <HCCUc.25408$nx2.3994@newsread2.news.atl.earthlink.net>

"Ethan Brown" <ethan@draupnir.gso.saic.com> wrote in message
news:vr8ycdoegk.fsf@draupnir.gso.saic.com...
> Earthquakes don't kill people.  Stuff falling on people kills people.
Improving
> building codes and adhearing to these codes goes a long way in mitigating
loss of
> life in seismically active regions.  For example, a 6.0 earthquake in
California will
> typically result in few, if any, deaths.  The same size earthquake in a
third-world
> country can result in many deaths.  All due to the nature of building
construction.
>

August 18, 2004

In China there are a number of groups including the official government
group (10,000 full-time employees I believe) which attempt to focus in on
where an earthquake is going to occur by studying a variety of data.  My
present Perl language EM signal data processing program is intended to help
governments etc. identify earthquake "hot spots" which they should focus on
to see if there could be an earthquake headed for that location.  In my
opinion it already produces invaluable data.  And it could do much better if
more sophisticated data processing routines were added.

If you look around the Internet you will find a Web site which talks about
the many precursors that were observed before the deadly January 16, 1995
earthquake in Kobe, Japan (6000 fatalities).  Many were apparently also
observed before the deadly August 17, 1999 earthquake in Turkey (18,000
fatalities) and the January 26, 2001 earthquake in India (10,000
fatalities).

If people are observing precursors like that then they should be able to
tell from when large numbers are observed that an earthquake is likely to
follow.  I am also a strong believer in improving building construction.
But that option will not be available for very large numbers of people
around the world for many years, if ever.

Regarding Perl itself,

What I am hoping to do is get some type of group of volunteer or even paid
computer programmers organized to do further development work on that
program.  And one of the first questions to ask would be, "Is Perl the best
language to use for such an application?"

Where better to ask such a question than in a Perl Newsgroup?




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

Date: Tue, 17 Aug 2004 17:13:27 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <slrnci50o7.dlb.tadmc@magna.augustmail.com>

anita <anita1766@yahoo.com> wrote:

> I am trying to get to edit my perl scripts through a form.


Why are you trying to get to edit your perl scripts through a form?

I am sensing an X-Y problem here...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 17 Aug 2004 23:41:49 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <slrnci55tt.3tq.abigail@alexandra.abigail.nl>

anita (anita1766@yahoo.com) wrote on  September MCMXCIII in
<URL:news:1a1fc02.0408171244.3114d5ce@posting.google.com>:
--
--  I am trying to get to edit my perl scripts through a form. I'm loading


That sounds about as cumbersome and useful as eating soup through
the keyhole of a door.

Good luck!


Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


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

Date: 17 Aug 2004 20:45:35 -0700
From: anita1766@yahoo.com (anita)
Subject: Re: editing perl script through TEXTAREA
Message-Id: <1a1fc02.0408171945.2a4430b@posting.google.com>

Lets just say I am editing some file, any file through the form... Not
necessarily a perl script. That- is a good example because it tends to
have a lot of special characters.
One other person suggested that I save before converting. I am not
sure what was meant by that.
                                              
From what I understand, my file has to be processed to replace all the
special HTML chars before display (so browser wont complain) and once
the user edits and tries to save it through the form, it has to be
stripped off the special entities, so it can be saved...

I will look into the HTML module. 
> I am sensing an X-Y problem here...

I dont get it. What do you mean X-y problem ?
Thanks


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

Date: 17 Aug 2004 20:46:05 -0700
From: anita1766@yahoo.com (anita)
Subject: Re: editing perl script through TEXTAREA
Message-Id: <1a1fc02.0408171946.2abd7dca@posting.google.com>

Lets just say I am editing some file, any file through the form... Not
necessarily a perl script. That- is a good example because it tends to
have a lot of special characters.
One other person suggested that I save before converting. I am not
sure what was meant by that.
                                              
From what I understand, my file has to be processed to replace all the
special HTML chars before display (so browser wont complain) and once
the user edits and tries to save it through the form, it has to be
stripped off the special entities, so it can be saved...

I will look into the HTML module. 
> I am sensing an X-Y problem here...

I dont get it. What do you mean X-y problem ?
Thanks


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

Date: Tue, 17 Aug 2004 16:55:26 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Forcing Array Context
Message-Id: <slrnci4vme.dlb.tadmc@magna.augustmail.com>

Peter Kay <peterkayatwork@yahoo.com> wrote:
> merlyn@stonehenge.com (Randal L. Schwartz) wrote in message news:<86oel9y87t.fsf@blue.stonehenge.com>...
>> >>>>> "Peter" == Peter Kay <peterkayatwork@yahoo.com> writes:
>> 
>> Peter> sub do_it ($$@);
>> 
>> Prototypes.  Eliminate.  Crush.  Kill.  Destroy.

> I was naively hoping Perl would expand the list, push the first two
> elements into the two scalars, and continue on its way. 


That is exactly what Perl would do if you would only 
eliminate the prototype.  :-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 17 Aug 2004 22:31:07 -0000
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: Forcing Array Context
Message-Id: <slrnci51tl.g6i.tim@vegeta.saiyix>

Peter Kay <peterkayatwork@yahoo.com> wrote:
> I want to pass in arguments to a subroutine via an array or list.
> Seems simple enough, right?  Well, no, because the array keeps getting
> kicked into scalar context.  An example perl script is provided:
>  
>  ------------------------------
>  
>  #!/usr/bin/perl -w
>  use strict;
>  
>  sub do_it ($$@);
>  
>  my @args=("a","b","c");
>  
>  do_it( "a", "b", @args );  #works
>  do_it( @args );  # Doesn't work:
[ snip ]

The irony here is that you're trying to coerce perl to do what it wants
to do by default anyway.  It's not an uncommon stumbling block for
people coming from other languages like C or Python.  Prototypes serve
a different purpose in Perl and are almost never necessary.  Don't worry
abou them for now.

Removing the prototypes should give you the desired behavior.

HTH,
Tim Hammerquist


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

Date: 17 Aug 2004 15:07:49 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: My own handy Pocket Reference notes
Message-Id: <86brh9xvt6.fsf@blue.stonehenge.com>

>>>>> "Jeff" == Jeff 'japhy' Pinyan <pinyaj@rpi.edu> writes:

Jeff> On 17 Aug 2004, Randal L. Schwartz wrote:
>> Please shoot the person who came up with that cute hack.  That's
>> just as cutesey (and dangerous) as rename $x => $y.  Ugh.

Jeff> What, specifically, is dangerous about

Jeff>   rename $x => $y;

Jeff> Apart from a lack of error-checking, I mean.  I thought that was a rather
Jeff> clever use of the => comma to signify a "becoming" relationship.

Because it breaks as a general pattern.  Witness:

    use constant INCOMING => "/tmp/incoming.file.txt";
    ...
    rename INCOMING => $new or die "Cannot rename ... ";

The problem is that once you start showing the pattern, the newbies
will combine it, not realizing that a fat arrow autoquotes the left
arg.  Ooops.  Cargoculting breaking things again.

So, don't use it. Or put a big warning on the right "use at your own
risk - your milage may vary".

print "Just another Perl hacker,"; 

-- 
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: Tue, 17 Aug 2004 22:25:09 -0000
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: My own handy Pocket Reference notes
Message-Id: <slrnci51if.g6i.tim@vegeta.saiyix>

Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> >>>>> "Ala" == Ala Qumsieh <notvalid@email.com> writes:
> Ala> I find this a bit more amusing, although less maintainable:
> Ala> 	$var = [$b => $a] -> [$b <= $a];
>  
> And more expensive.  All the work to create an anonymous list, then an
> anonymous array from that, take a reference to it, dereference it, and
> then pull one of the two items back out, and then discard the array
> and the list value.
>  
> Ugh.
>  
> Please shoot the person who came up with that cute hack.  That's just
> as cutesey (and dangerous) as rename $x => $y.  Ugh.

The following is an excerpt from "Effective Perl Programming"
(Addison-Wesley; p.245):

    [ $a => $b ] -> [ $b <= $a ]

    This wonderfully symmetrical one-liner contributed by Phil
    Abercrombie returns the lesser of $a and $b.

    It can written with less wasted technology, but then it isn't nearly
    as pretty:

        ($a, $b)[$b <= $a]

I think we know which author contributed the word "wonderfully" to that
paragraph now, eh?  ;-)

Cheers! (and apologies to Randal),
Tim Hammerquist


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

Date: Tue, 17 Aug 2004 18:42:03 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
Subject: Re: My own handy Pocket Reference notes
Message-Id: <Pine.SGI.3.96.1040817184137.1340834A-100000@vcmr-64.server.rpi.edu>

On Tue, 17 Aug 2004, Tim Hammerquist wrote:

>The following is an excerpt from "Effective Perl Programming"
>(Addison-Wesley; p.245):
>
>    [ $a => $b ] -> [ $b <= $a ]

I *thought* I remembered seeing that idiom in EPP.  I'm just nowhere near
my copy to check.

--
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
RPI Corporation Secretary   %  have long ago been overpaid?
http://japhy.perlmonk.org/  %  
http://www.perlmonks.org/   %    -- Meister Eckhart




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

Date: 17 Aug 2004 15:53:17 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: My own handy Pocket Reference notes
Message-Id: <86acwtwf4y.fsf@blue.stonehenge.com>

>>>>> "Tim" == Tim Hammerquist <tim@vegeta.ath.cx> writes:

Tim> I think we know which author contributed the word "wonderfully" to that
Tim> paragraph now, eh?  ;-)

Yes, wasn't me. :)

-- 
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: Wed, 18 Aug 2004 00:57:36 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: My own handy Pocket Reference notes
Message-Id: <10i5ac0d4kpbg6f@corp.supernews.com>

In article <86brh9xvt6.fsf@blue.stonehenge.com>,
    Randal L. Schwartz <merlyn@stonehenge.com> wrote:

: The problem is that once you start showing the pattern, the newbies
: will combine it, not realizing that a fat arrow autoquotes the left
: arg.  Ooops.  Cargoculting breaking things again.

I'm not convinced that this argument holds water.  Is there *any*
feature of Perl that withstands this "look what the cargocultists
might do" test?

Greg
-- 
Rightful liberty is unobstructed action according to our will within limits
drawn around us by the equal rights of others. I do not add 'within the limits
of the law,' because law is often but the tyrant's will, and always so when it
violates the rights of the individual.      -- Thomas Jefferson


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

Date: Tue, 17 Aug 2004 17:08:11 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Operator for presence of value in list?
Message-Id: <slrnci50eb.dlb.tadmc@magna.augustmail.com>


[ Please do not post TOFU style, it annoys folks here.
  Text trimmed and rearranged into a sensible order.

}
JJ <geenbestaandadres@lycos.nl> wrote:

>> >> Quote from the applicable Perl FAQ ("perldoc -q contained"):

> I'm even more lazy than Martin, why does nobody copy-paste the faq here?


Because posters that require that someone _else_ read the FAQs to
them deserves to remain in ignorance.

There is Good Lazy and there is Bad Lazy...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 17 Aug 2004 22:43:28 GMT
From: ctcgag@hotmail.com
Subject: Re: Operator for presence of value in list?
Message-Id: <20040817184328.722$vM@newsreader.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> Bernard El-Hagin wrote:
> > Martin Mrazek wrote:
> >> I'm new to Perl. Is there something like in operator?
> >>
> >> $a in @list; returns 1 if $a is among values in @list, 0 if not.
> >
> >   perldoc -f grep
>
> Quote from the applicable Perl FAQ ("perldoc -q contained"):
>
> "Please do not use
>
>      ($is_there) = grep $_ eq $whatever, @array;
>
> or worse yet
>
>      ($is_there) = grep /$whatever/, @array;
>
> These are slow (checks every element even if the first matches),
> inefficient (same reason),

Why not just say "Don't use Perl, it is slow and inefficient."?

If one doesn't care enough about efficiency to use a hash, then I highly
doubt one will care about the (generally trivial) additional inefficiency
of using grep.  I've probably spent more of my time typing this reply than
all of the time wasted via grep-in-boolean-context of all the perl programs
I've ever run.

> and potentially buggy (what if there are
> regex characters in $whatever?)."

Both forms (the grep and the foreach loop) require you to make the correct
decision regarding use of eq versus =~ versus ==.  If you habitually use
regex when you shouldn't be, then the suggested replacement is just as
"potentially buggy" as what it is replacing.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Tue, 17 Aug 2004 17:10:39 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: pod2text and carriage-return's
Message-Id: <slrnci50iv.dlb.tadmc@magna.augustmail.com>

Nath <DON'T_SEND_ME@TRIPE_TO_MY_IN.BOX> wrote:
> I am trying to use pod2text (windows) on my Perl/Tk application. I have
> converted the Perl script file to Unix, but when i use pod2text it puts the
> carriage-return's in the resulting text file. So when i use the application
> on RedHat and access the text file it shows all the carriage-return's! Very
> annoying!

> or am i missing something else?


Use "ASCII" or "text" FTP mode when transferring files between
dissimilar operating systems.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 18 Aug 2004 01:06:28 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Trying to parse a variable name
Message-Id: <Xns9548CD62F98CEebohlmanomsdevcom@130.133.1.4>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote in news:2of8kiFa6jqmU1@uni-
berlin.de:

> Well, in that simple case, I would have done so, too.
> 
> But let's assume that the return value from the function is only a
> part of the replacement string:
> 
>      s/to_be_replaced/start @{ [ somefunction() ] } end/
> 
>      s/to_be_replaced/'start ' . somefunction() . ' end'/e
> 
> Which is best is no longer *that* obvious, is it? ;-)

I'd prefer s/to_be_replaced/sprintf('start %s end',somefunction())/e;

I'm just not the type who values using tricks for things that have standard 
solutions.


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

Date: Tue, 17 Aug 2004 23:43:15 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: XY problem (was Re: editing perl script through TEXTAREA)
Message-Id: <slrnci5nj3.e3j.tadmc@magna.augustmail.com>

anita <anita1766@yahoo.com> wrote:
> Lets just say I am editing some file, any file through the form... 

>> I am sensing an X-Y problem here...
> 
> I dont get it. What do you mean X-y problem ?


   An XY problem is when you want to do X, but you ask how to do Y
   instead, because you've decided that Y is the best way to accomplish X.


If you tell us why you think you want to edit programs in a browser,
then maybe we could suggest a better or easier alternative...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

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 V10 Issue 6878
***************************************


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