[24236] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6427 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 20 00:05:53 2004

Date: Mon, 19 Apr 2004 21:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 19 Apr 2004     Volume: 10 Number: 6427

Today's topics:
    Re: Array from a string. <samschulte@hotmail.com>
    Re: Array from a string. (Sam Holden)
    Re: Array from a string. <jurgenex@hotmail.com>
    Re: foreach loop test <bmb@ginger.libs.uga.edu>
    Re: HASH vs Regexp <bik.mido@tiscalinet.it>
        pattern matching (LiHui)
    Re: pattern matching <bmb@ginger.libs.uga.edu>
    Re: Perl is the answer? <matthew.garrish@sympatico.ca>
    Re: Perl is the answer? axel@white-eagle.co.uk
    Re: Perl is the answer? <jtc@shell.dimensional.com>
    Re: Perl is the answer? <bmb@ginger.libs.uga.edu>
    Re: regex compression? (Bill)
    Re: regex compression? (Bill)
        regular expression module? (Walter Roberson)
    Re: Request for program test on different operating syt <tadmc@augustmail.com>
    Re: Request for program test on different operating syt <uri@stemsystems.com>
    Re: stupid regexp question <slinberg@crocker.com>
        Thanks: Re: need Regular Expression to remove all non-n <robert@the.com>
        Upgrading perl from 5.02 to 5.8? (Mike Dross)
    Re: Upgrading perl from 5.02 to 5.8? <spamtrap@dot-app.org>
    Re: Upgrading perl from 5.02 to 5.8? <tadmc@augustmail.com>
    Re: Writing fast(er) performing parsers in Perl (Walter Roberson)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 19 Apr 2004 23:27:31 GMT
From: "SoCalSam" <samschulte@hotmail.com>
Subject: Re: Array from a string.
Message-Id: <DfZgc.171009$K91.432236@attbi_s02>

6 posts telling the poor dude to read the FAQ.  Couldn't the first responder
just answer the Q, and end their post with a friendly reminder to read the
FAQ?

Jeesh.


"Richard S Beckett" <spikeywan@bigfoot.com.delete.this.bit> wrote in message
news:c4euhp$dfo$1@newshost.mot.com...
> > Hmmmm .. You would have found the answer had you looked at the table of
> > contents and then read perlfaq4.
>
>
> OK, it's a fair cop! :-) I'll try harder next time.
>
> Thanks for the help.
> --
> R.
> GPLRank +79.699
>
>




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

Date: 19 Apr 2004 23:42:13 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Array from a string.
Message-Id: <slrnc88oul.qo0.sholden@flexal.cs.usyd.edu.au>

On Mon, 19 Apr 2004 23:27:31 GMT, SoCalSam <samschulte@hotmail.com> wrote:
> 6 posts telling the poor dude to read the FAQ.  Couldn't the first responder
> just answer the Q, and end their post with a friendly reminder to read the
> FAQ?

Why?

The OP can just read the FAQ themselves once they have been pointed to it.
What's the point of repeating the answer in a post?

[snip a full quote]

Please don't do that.

-- 
Sam Holden


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

Date: Tue, 20 Apr 2004 00:45:28 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Array from a string.
Message-Id: <Io_gc.22895$G_.1158@nwrddc02.gnilink.net>

[Jeopardy-posting deleted; please don't do that]

SoCalSam wrote:
> 6 posts telling the poor dude to read the FAQ.  Couldn't the first
> responder just answer the Q, and end their post with a friendly
> reminder to read the FAQ?

You don't know much about how Usenet posts are propagated, do you?

jue




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

Date: Mon, 19 Apr 2004 23:01:13 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: foreach loop test
Message-Id: <Pine.A41.4.58.0404192300080.16004@ginger.libs.uga.edu>

On Mon, 19 Apr 2004, christie wrote:

> Brad Baxter <bmb@ginger.libs.uga.edu> wrote in message news:<Pine.A41.4.58.0404170900040.16046@ginger.libs.uga.edu>...
> > On Fri, 16 Apr 2004, christie wrote:
> > > Try this,
> > >
> > > $count = @test;
> > >
> > > for($i=0; $i<$count;$i++){
> > > $tmp = $test[$i];
> > > if($i == 0){print "First array: $tmp\n";}
> > > if($i == floor($count/2)){print "Middle array: $tmp\n";}
> > > if($i== $count){print "Last array: $tmp\n";}
> > > }
> >
> > Did you try it?  It will never print "Last array ..."
>
> Of course, it will never print the last array 'cause $i<$count. It
> should be $i<=$count.  An entry level scripter should be able to fix
> this bug.


You're welcome.  :-)

Brad


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

Date: Tue, 20 Apr 2004 01:18:33 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: HASH vs Regexp
Message-Id: <2ua880t0fgienusho1hbb545umkek2ibrr@4ax.com>

On 19 Apr 2004 11:51:42 GMT, "Tassilo v. Parseval"
<tassilo.parseval@rwth-aachen.de> wrote:

>IMHO, it certainly would and actually making that work requires just a
>tiny patch to the core. However, this idea has unfortunately been

Fine to know! I feared that this may have revealed to sound just like
yet another crankery, like some of my posts on "similar subjects"
(i.e. Perl's syntax/semantics) in the past did...

>rejected by the porters. It's available from the CPAN, though:
>
>    <http://search.cpan.org/~chocolate/autobox-0.11/>

I'll try it ASAP, TY!


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

Date: 19 Apr 2004 18:58:30 -0700
From: tanlh_listing@hotmail.com (LiHui)
Subject: pattern matching
Message-Id: <500605f9.0404191758.37113659@posting.google.com>

Can someone tell me what does this line do ?

$line =~ m/^\|\s*\w\S*\s*(?:\|.+?){10,}\|$/o

I know that it check to see if the line begin with "|" follow by
whitespace, word, nonwhitespace and than I'm lost. What is s*(?:\|.+?)

Any help will be greatly appreciate. Thanks LH


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

Date: Mon, 19 Apr 2004 22:58:26 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: pattern matching
Message-Id: <Pine.A41.4.58.0404192238210.16004@ginger.libs.uga.edu>

On Mon, 19 Apr 2004, LiHui wrote:

> Can someone tell me what does this line do ?
>
> $line =~ m/^\|\s*\w\S*\s*(?:\|.+?){10,}\|$/o
>
> I know that it check to see if the line begin with "|" follow by
> whitespace, word, nonwhitespace and than I'm lost. What is s*(?:\|.+?)

Make that "|" followed by optional whitespace, a word character, optional
nonwhitespace, optional whitespace, ten or more of "these": |x..., and
ending in "|".

Also, it's not s*(?:\|.+?), it's \s*(?:\|..+?).  (?:...) are grouping (not
capturing) parentheses.  They're followed by {10,} so you want 10 or more
of those groups.  Each group is "|" followed by at least one, possibly
more, character(s) that match(es) /./ but not "|" (because +? is
non-greedy).

Below is an expanded (using /x) version:

# example line that will match
my $line = '| abc |0|1|2|3|4|5|6|7|8|9|x|y|z|';

$line =~ m/^\|\s*\w\S*\s*(?:\|.+?){10,}\|$/o and print "yes\n";

$line =~ m/
    ^      # begins with
    \|     # 'or' bar
    \s*    # optional whitespace
    \w     # ONE word character
    \S*    # optional nonwhitespace
    \s*    # optional whitespace
    (?:    # begin the group
    \|     # 'or' bar
    .+     # at least one character
    ?      # make the '+' non-greedy
    )      # end the group
    {10,}  # give me 10 or more GROUPS
    \|     # 'or' bar
    $      # at the end
    /ox and print "yes\n";


I assume you've looked at perldoc perlre.

Regards,

Brad


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

Date: Mon, 19 Apr 2004 18:13:09 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Perl is the answer?
Message-Id: <K9Ygc.35187$Gp4.570824@news20.bellglobal.com>


"Jim Cochrane" <jtc@shell.dimensional.com> wrote in message
news:slrnc8871o.ufs.jtc@shell.dimensional.com...
> In article <4d3880lph91adlhpds8sv0ndo4btcdb13s@4ax.com>, Andries wrote:
> > Hello there,
> >
> > I hope someone can help me.
> > This is my problem:
> > I have a list of thousands and thousands of the next lines:
> > ----------------------------------------------------------------------
> ><a href="hs80.htm#halveringstijd"target="topic">halveringstijd</a><br>
> ><a href="hs80.htm#hartkleppen" target="topic"></a><br>
> ><a href="hs80.htm#hartvolume" target="topic"></a><br>
> ><a href="hs80.htm#hemoglobine" target="topic"></a><br>
> ><a href="hs80.htm#heteroseksueel " target="topic"></a><br>
> ><a href="hs80.htm#hijgen" target="topic"></a><br>
> ><a href="hs80.htm#histamine" target="topic"></a><br>
>
> --------------------------------------------------------------------------
------------
> > I need to copy the word between the # and " and put it after the > and
> ></a>
> >
> > It can done by hand like the first line but it can be automated with a
> > perl script isn't it?
> >
> > If so I still have a problem can anyone tell me how?
> >
> >
> > TIA
> > Andries Meijer
>
> Here's one way to do it:
>
> #!/usr/bin/perl -n
>
> use strict;
> use warnings;
>
> my ($part1, $part2, $part3, $part4) = /([^#]*#)([^"]*)("[^>]*><\/a>)(.*)/;
> if ($part4) {
> print "${part1}${part2}${part3}${part2}${part4}\n";
> } else {
> print
> }
>

Ick! Why not just in one line?

while (my $line = <DATA>) {

   $line =~ s/(#([^"]+)"[^>]*>)/$1$2/;

   print $line;

}

__DATA__
<a href="hs80.htm#hartkleppen" target="topic"></a><br>
<a href="hs80.htm#hartvolume" target="topic"></a><br>
<a href="hs80.htm#hemoglobine" target="topic"></a><br>
<a href="hs80.htm#heteroseksueel " target="topic"></a><br>
<a href="hs80.htm#hijgen" target="topic"></a><br>
<a href="hs80.htm#histamine" target="topic"></a><br>




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

Date: Mon, 19 Apr 2004 22:57:30 GMT
From: axel@white-eagle.co.uk
Subject: Re: Perl is the answer?
Message-Id: <uPYgc.235$m1.130@news-binary.blueyonder.co.uk>

Julia deSilva <jds@nospantrumpetweb.co.uk> wrote:

> Can be done very simply in any programming language, but if you are only
> using it once or twice I'd just use a macro in a good text viewer. I like
> www.textpad.com but Word could be used.

Macros, Word... shudder! that would probably take longer than creating
and running a simple perl script!

But the one line perl scripts can easily be adapted to the vi editor...
assuming all the lines in the file are of the same format as the
examples, the following command will achieve the same and edit the
entire file:

:% s/\(#\)\(.*\)\(" .*ic">\)\(<.*\)/\1\2\3\2\4/

But seriously there is an advantage in running a short script over
thousands of lines of input as it is easy to alter if it does not work
quite as expected and it can also be used to check for anomalies in the
data... just in case.

Axel

 



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

Date: 19 Apr 2004 17:56:25 -0600
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: Perl is the answer?
Message-Id: <slrnc88pp9.1lt.jtc@shell.dimensional.com>

In article <K9Ygc.35187$Gp4.570824@news20.bellglobal.com>, Matt Garrish wrote:
> 
> "Jim Cochrane" <jtc@shell.dimensional.com> wrote in message
> news:slrnc8871o.ufs.jtc@shell.dimensional.com...
>> In article <4d3880lph91adlhpds8sv0ndo4btcdb13s@4ax.com>, Andries wrote:
>> > Hello there,
>> >
>> > I hope someone can help me.
>> > This is my problem:
>> > I have a list of thousands and thousands of the next lines:
>> > ----------------------------------------------------------------------
>> ><a href="hs80.htm#halveringstijd"target="topic">halveringstijd</a><br>
>> ><a href="hs80.htm#hartkleppen" target="topic"></a><br>
>> ><a href="hs80.htm#hartvolume" target="topic"></a><br>
>> ><a href="hs80.htm#hemoglobine" target="topic"></a><br>
>> ><a href="hs80.htm#heteroseksueel " target="topic"></a><br>
>> ><a href="hs80.htm#hijgen" target="topic"></a><br>
>> ><a href="hs80.htm#histamine" target="topic"></a><br>
>>
>> --------------------------------------------------------------------------
> ------------
>> > I need to copy the word between the # and " and put it after the > and
>> ></a>
>> >
>> > It can done by hand like the first line but it can be automated with a
>> > perl script isn't it?
>> >
>> > If so I still have a problem can anyone tell me how?
>> >
>> >
>> > TIA
>> > Andries Meijer
>>
>> Here's one way to do it:
>>
>> #!/usr/bin/perl -n
>>
>> use strict;
>> use warnings;
>>
>> my ($part1, $part2, $part3, $part4) = /([^#]*#)([^"]*)("[^>]*><\/a>)(.*)/;
>> if ($part4) {
>> print "${part1}${part2}${part3}${part2}${part4}\n";
>> } else {
>> print
>> }
>>
> 
> Ick! Why not just in one line?
> 
> while (my $line = <DATA>) {
> 
>    $line =~ s/(#([^"]+)"[^>]*>)/$1$2/;
> 
>    print $line;
> 
> }
> 
> __DATA__
><a href="hs80.htm#hartkleppen" target="topic"></a><br>
><a href="hs80.htm#hartvolume" target="topic"></a><br>
><a href="hs80.htm#hemoglobine" target="topic"></a><br>
><a href="hs80.htm#heteroseksueel " target="topic"></a><br>
><a href="hs80.htm#hijgen" target="topic"></a><br>
><a href="hs80.htm#histamine" target="topic"></a><br>

Hmm - there are two differences between our versions; apparently we read
the "spec" differently.  Your version copies the captured string before
the </a> and mine puts it after it.  Probably the OP meant: "put it
after the > and before the </a>" instead of "put it after the > and </a>",
so your version does what is apparently expected.

But the other difference is that mine just prints the anomalous first line
as is, without modification.  Yours changes it into:

<a
href="hs80.htm#halveringstijd"target="topic">halveringstijdhalveringstijd</a><br>

, which I think is not what he wants.

Of course, rereading the OP, it looks like you understood his English
better than I did - It appears the 1st line was not part of the input.
If the file indeed has no anomalies, your version is more appropriate.
With anomalies, mine is probably more appropriate, with the fix:

#!/usr/bin/perl -n

use strict;
use warnings;

my ($part1, $part2, $part3, $part4) = /([^#]*#)([^"]*)("[^>]*>)(<\/a>.*)/;
if ($part4) {
	print "${part1}${part2}${part3}${part2}${part4}\n";
} else {
	print
}

Of course, you're right that mine is more wordy that necessary.  Here's a
shorter version:

#!/usr/bin/perl -p

use strict;
use warnings;

s/([^#]*#)([^"]*)("[^>]*>)(<\/a>.*)/$1$2$3$2$4/;


It uses substitution. like your version, but it also, like the original
version, attempts to leave "anomalous" lines unchanged.

-- 
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]


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

Date: Mon, 19 Apr 2004 23:03:49 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Perl is the answer?
Message-Id: <Pine.A41.4.58.0404192301480.16004@ginger.libs.uga.edu>

Perl isn't the answer.  Perl is the question.  Yes! is the answer.


Sorry, I couldn't resist.

Regards,

Brad


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

Date: 19 Apr 2004 20:34:07 -0700
From: wherrera@lynxview.com (Bill)
Subject: Re: regex compression?
Message-Id: <239ce42f.0404191934.230dbf2f@posting.google.com>

> Even if I discount the missing space between /all/ and /\d+/ as a typo
> it still won't.
>  
> > I don't need something that just does an 'or' of all the supplied regexes
> > into one though.
> 
> Why?

I was trying to optimize Mail::Milter::Module::ConnectRegex to make it run
faster. Sorry about the typos above.


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

Date: 19 Apr 2004 20:42:11 -0700
From: wherrera@lynxview.com (Bill)
Subject: Re: regex compression?
Message-Id: <239ce42f.0404191942.adf2133@posting.google.com>

Brian McCauley <nobull@mail.com> wrote in message news:<u97jwb3npc.fsf@wcl-l.bham.ac.uk>...
> wherrera@lynxview.com (Bill) writes:
> 
> > I wonder if anyone is aware of a package that will rewrite a set of
> > regex patterns to reduce their number.
> 
> This question is oft asked here in various guises and I think the
> answer is "no".  I think the problem is quite possibly "hard" (in the
> CS sense of the word).
> 

Aha, just found Regexp::Optimizer. Silly, I'd been searching CPAN
using 'regex' instead of 'regexp'. Never mind :).


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

Date: 20 Apr 2004 03:55:40 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: regular expression module?
Message-Id: <c626vs$7kk$1@canopus.cc.umanitoba.ca>

I remember reading on this newsgroup, maybe about a year ago, of
a module that did a Finite State Machine implementation of "standard"
regular expressions -- i.e., just what can be built out of
concatenation, alternation, and repetition, (and perhaps
some syntactic sugar such as charactre-classes), without the perl
extensions that lift perl's regex's into a different parser class
entirely.

Unfortunately, when I tried to find the posting again, I could
not, and I could not find anything like that in CPAN.

The matter came to my mind again today when someone mentioned
the Yapp module and parsing speeds -- one of the points that
can really slow down perl's regexes is the backtracking that it
does. If one happens to be working with input whose grammar is
not overly complex, then one might be perfectly happy with
faster but less flexible RE's and a perl equivilent of
yacc and lex.

Would anyone happen to recall the name and location of that
finite-state RE module? Something like that could potentially speed
up a number of my programs.
-- 
Is "meme" descriptive or perscriptive? Does the knowledge that
memes exist not subtly encourage the creation of more memes?
   -- A Child's Garden Of Memes


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

Date: Mon, 19 Apr 2004 21:53:45 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Request for program test on different operating sytsems
Message-Id: <slrnc8945p.5cs.tadmc@magna.augustmail.com>

edgrsprj <edgrsprj@ix.netcom.com> wrote:
> "edgrsprj" <edgrsprj@ix.netcom.com> wrote in message
> news:iOVgc.13634$l75.5902@newsread2.news.atl.earthlink.net...
> 
> There are several lines which in that program which
> got "wrapped" somehow.  


You should refactor your code so that there _are no_ long lines,
then word wrap will never be a concern.


>> print 'then at the top, printed the following lines (preceded by number
>> signs)', "\n";


   print 'then at the top, printed the following lines ',
         '(preceded by number signs)',
         "\n";


> If you want to try running the test just go through the code and "unwrap"
> those lines.


Yes sir, right away sir.


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


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

Date: Tue, 20 Apr 2004 03:56:35 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Request for program test on different operating sytsems
Message-Id: <x7brlnqp3g.fsf@mail.sysarch.com>

>>>>> "TM" == Tad McClellan <tadmc@augustmail.com> writes:

  >> If you want to try running the test just go through the code and "unwrap"
  >> those lines.

  TM> Yes sir, right away sir.

you maggot!! get down and write me 20 modules!!! or i will have you
coding python for the next two months!!

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Mon, 19 Apr 2004 22:21:11 GMT
From: Steve Linberg <slinberg@crocker.com>
Subject: Re: stupid regexp question
Message-Id: <slinberg-C6D476.18211019042004@netnews.comcast.net>

In article <Pine.GSO.4.21.0404191232310.353-100000@mtwhitney.nsc.com>,
 Steven Kuo <skuo@mtwhitney.nsc.com> wrote:

> On Mon, 19 Apr 2004, Steve Linberg wrote:
> 
> (snipped) ...
> 
> > I just need a regexp that says "match any complete string not equal to 
> > 'mysql' or 'test'."
> > 
> > I can't use "!~ /^(mysql|test)$/" because this is an argument to feed to 
> > a script that uses a positive search and puts the regexp in 
> > $opt{regexp}, for use as in "=~ /$opt{regexp}/".  Yes, I can hack the 
> > script, but I'd rather not if I can avoid it.
> > 
> > The specific task is for mysqlhotcopy, where you can provide a regexp 
> > for databases to dump.  I want to tell it to dump everything EXCEPT 
> > "mysql" and "test", so I need a single positive regexp that matches 
> > everything except those two strings.  For the life of me, I just can't 
> > get my brain to spit it out.
> 
> 
> 
> 
> Negative look-ahead?  This will allow you to use the '=~' operator.
> For example,
> 
> 
> print if ( $_ =~ /^(?!mysql$|test$)/ );
> 
> # or less verbose:
> 
> print if /^(?!mysql$|test$)/;

Perfect.  Thank you very much. :)

I'd been messing with negative lookahead, but I hadn't hit on that 
syntax - if I recall, I had this:

/^?!(mysql|test)$/

 ...which I know is wrong, but I'll have to study it a bit more to find 
out why.  But your solution works great.  Thanks for the slap/pointer! :)

- Steve


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

Date: Tue, 20 Apr 2004 08:36:45 +1000
From: "Robert" <robert@the.com>
Subject: Thanks: Re: need Regular Expression to remove all non-numerical 
Message-Id: <40845480$1@dnews.tpgi.com.au>

Thanks folks,
I was completly off the track - I was doing a search for the specific characters,
$word = "+1-767-123456";
$word =~ s/\+- //g;
print "Word: $word\n";

but all this returns is the same string.
I was simply not understanding how the matching and substitution was supposed to work I think.


Now, thanks, I have three other methods to use that DO work.
$word = "+1-767-123456";
$word =~ tr/0-9//cd;
print "Word: $word\n";

$word = "+1-767-123456";
$word =~ s/[^\d]//g;
print "Word: $word\n";

$word = "+1-767-123456";
$word =~ s/[\D]//g;
print "Word: $word\n";
 ...................................
Word: 1767123456
Word: 1767123456
Word: 1767123456
Word: +1-767-123456



-- 
---
Serving The Mission of Our Lady of Fatima.
At: http://www.the-mission-of-our-lady-of-fatima.org

"Robert" <robert@the.com> wrote in message news:40839733$1@dnews.tpgi.com.au...
>
> I'm trying to come up with a regex that will remove all non-numeric characters from a string.
> ie: +01-876 003456
>
> to: 01876003456
>
> but am having an amazing amount of trouble - perhaps it's too late.
> but if anyone can point me in theright direction, I'd be most gratefull.
> thanks
> Robert
>
>




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

Date: 19 Apr 2004 18:31:19 -0700
From: supercell@carolina.rr.com (Mike Dross)
Subject: Upgrading perl from 5.02 to 5.8?
Message-Id: <45277b3.0404191731.1f8a019f@posting.google.com>

Hi,

I have Mandrake 7.1 which installed Perl 5.02. 

I have a number of perl scripts running on this system and specific appliations
that run stable on this version of OS. Now in order install an anti virus
software mandated by IT (F-Prot), I need Perl 5.8 installed. I have ftp'd
a perl 5.8 rpm for Red Hat. If I install this will it work or will it break
the perl? 

Is there anyway to upgrade perl 5.02 to 5.8 without installing a new OS?

Thanks for your help.

Mike


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

Date: Mon, 19 Apr 2004 21:44:19 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Upgrading perl from 5.02 to 5.8?
Message-Id: <odadnX0iduflHRndRVn-sA@adelphia.com>

Mike Dross wrote:

> I have Mandrake 7.1 which installed Perl 5.02.

Are you certain? 5.002 is from 1996 - 7.1 is old, but I don't think it's
*that* old. What version number does 'perl -v' report?

> have ftp'd a perl 5.8 rpm for Red Hat. If I install this will it work or
> will it break the perl?

I wouldn't expect it to work. You'd probably need a Mandrake RPM. I'm not a
Linux expert, though.

> Is there anyway to upgrade perl 5.02 to 5.8 without installing a new OS?

If the app you want to run can be told to use a different perl - i.e. if it
isn't stuck on /usr/bin/perl - you can keep as many different versions as
you want, simply by installing them under different prefixes. You'd have to
build and install it yourself though, which might be more trouble than
you're willing to go through.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Mon, 19 Apr 2004 21:50:49 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Upgrading perl from 5.02 to 5.8?
Message-Id: <slrnc89409.5cs.tadmc@magna.augustmail.com>

Mike Dross <supercell@carolina.rr.com> wrote:

> Is there anyway to upgrade perl 5.02 to 5.8 without installing a new OS?


Yes. That is in fact the _normal_ situation.

What makes you think that a new OS is involved?

I see a "new perl" but what does that have to do with chaning the OS?


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


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

Date: 19 Apr 2004 23:58:19 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: Writing fast(er) performing parsers in Perl
Message-Id: <c61p2r$j21$1@canopus.cc.umanitoba.ca>

In article <slrnc87923.rg7.clint@poly.0lsen.net>,
Clint Olsen  <clint@0lsen.net> wrote:
:Since this project is fairly complex, I'm using Parse::Yapp to handle the
:parsing functionality.  Perl's natural pattern matching ability makes it
:pretty simple to code up an lexical analyzer by hand.

:After running the profiler on the tool, I found that over 70% of the
:runtime was being taken up in the scanner (the function actually scanning
:tokens from the file).  So, I decided to start there.

In my parsing programs, I fairly consistantly find that 70% or more of
the runtime is being spent simply split()'ing the lines into fields
(using the default whitespace splitting.)

I haven't tried Parse::Yapp, but I did find that performance improved
a fair bit when I "guess" that a key field will start at the same
string offset as it did on the previous line, and use substr() to probe
for it there, and only doing the more general split() if that probe failed
[or if the context of the keyword is such that I need the full split to
understand the line anyhow.]
-- 
   IEA408I: GETMAIN cannot provide buffer for WATLIB.


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

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


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