[12688] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 97 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 9 21:07:21 1999

Date: Fri, 9 Jul 1999 18:05:10 -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, 9 Jul 1999     Volume: 9 Number: 97

Today's topics:
        ActiveState's PerlScript <john@dlugosz.com>
        ANNOUNCE: Ladnar :) <elaine@chaos.wustl.edu>
    Re: array stuff.. (Abigail)
    Re: array stuff.. (Abigail)
    Re: Assigning args with regular expressions (Larry Rosler)
    Re: Assigning args with regular expressions <anonymous@web.remarq.com>
    Re: Cookies won't work <emschwar@rmi.net>
    Re: DNS question then sorting by values (Kevin Johnson)
    Re: FAQ 5.7: How can I use a filehandle indirectly? <tchrist@mox.perl.com>
        Global variables from a module <mike@innercite.com>
        Help -- Modules using up all my memory <gjerde@avsupport.com>
    Re: Help!: trying to compile my scripts <smithda@webwide.net>
    Re: long long in perl? (M.J.T. Guy)
    Re: match multiple lines <cassell@mail.cor.epa.gov>
    Re: match multiple lines (Larry Rosler)
        Not Learning Perl <jason@killdare.demon.co.uk>
    Re: parse mail files:beginning Perl in UNIX environment <garyg@gator.net>
    Re: Pattern match counting (Larry Rosler)
    Re: perlscript in IE (Abigail)
    Re: please help regex! (Abigail)
    Re: please help regex! (Larry Rosler)
    Re: Problem using backticks <dennis.moreno@pop.safetran.com>
    Re: Problem using backticks <dennis.moreno@pop.safetran.com>
    Re: Strangeness re $#{$test{'foo'}{'bar'}} (Abigail)
    Re: Suggestions: efficient way to compare large text fi <cassell@mail.cor.epa.gov>
    Re: Suggestions: efficient way to compare large text fi <bwaibel@hotmail.com>
    Re: Too late for "-T" option at init.cgi line 1. (Abigail)
    Re: totally lost on an error message <chris.ice@cisco.com>
        Win32 Perl and globbing (Thomas j. Evans)
    Re: Win32 Perl and globbing <cassell@mail.cor.epa.gov>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Fri, 9 Jul 1999 18:34:18 -0500
From: "John M. Dlugosz" <john@dlugosz.com>
Subject: ActiveState's PerlScript
Message-Id: <EC86E2A5FF614A3A.ECF99CE076EA6184.7A15896E850CD86F@lp.airnews.net>

Is there a newsgroup for this, or any other information to be had?

I've been using it, and have discovered a lack of documentation, and some
weird problems.

For example, why does the File::Find module not work,
and why does any use of $main::document crash Perl?

--John





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

Date: Fri, 9 Jul 1999 19:12:14 -0500
From: elaine ashton <elaine@chaos.wustl.edu>
To: advocacy@perl.org, perl-visioneers@gadget.cscaper.com
Subject: ANNOUNCE: Ladnar :)
Message-Id: <Pine.GSO.4.05.9907091857360.21584-100000@chaos.wustl.edu>

Of Merlin wise I learned a song,--
Sing it low, or sing it loud,
It is mightier than the strong,
And punishes the proud.
I sing it to the surging crowd,--
Good men it will calm and cheer,
Bad men it will chain and cage.
In the heart of the music peals a strain
Which only angels hear;
Whether it waken joy or rage,
Hushed myriads hark in vain,
Yet they who hear it shed their age,
And take their youth again.
		-=[ R.W. Emerson - Merlin's Song ]=-

Not one to let Tom have all the fun this summer, I thusly present ladnar:
a parody in 25 parts. :) A send-up of sorts of one of the dramatis
personae of the Perl community. I doubt that it needs explanation.

http://history.perl.org/ladnar/

The product of an idea cooked-up by Adam Turoff and myself during last
year's Thanksgiving holiday, it is intended to be good clean fun for the
entire family.

Sadly, this is a graphic-laden site so the lynx crowd won't be able to
surf it with complete glee.

Enjoy! hee hee

e.


         -=]) elaine ashton // elaine@chaos.wustl.edu // HFB ([=-
   -=]) A dismal wasteland of banality, cliche' and casual obscenity ([=- 





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

Date: 9 Jul 1999 18:19:08 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: array stuff..
Message-Id: <slrn7od0ql.h7.abigail@alexandra.delanet.com>

Marshall Culpepper (marshalc@americasm01.nt.com) wrote on MMCXXXVIII
September MCMXCIII in <URL:news:378615A6.8736FB08@americasm01.nt.com>:
~~ hey kind of an intermediate skill level on perl..
~~ is there any quick function to add a certain string to every element of
~~ an array
~~ i.e;
~~ $str="a";
~~ @test=('0'..'5');
~~ and test would return as ('a0'..'a5')? any help would be greatly
~~ appreciated :)


map is your friend. Use map!



Abigail
-- 
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 9 Jul 1999 18:24:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: array stuff..
Message-Id: <slrn7od14v.h7.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCXXXVIII September MCMXCIII in
<URL:news:x7673tsl1u.fsf@home.sysarch.com>:
$$ 
$$ well, 4 arg beats that in perl golf (assuming normal use of white
$$ space). and as i said, i like 4 arg substr. 
$$ 
$$ substr($_, 0, 0, $str)
$$ substr($_, 0, 0) = $str

And for my Perl golf entry:

   s//$str/


HTH. HAND.



Abigail
-- 
perl -wle '$, = " "; print grep {(1 x $_) !~ /^(11+)\1+$/} 2 .. shift'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 9 Jul 1999 16:58:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Assigning args with regular expressions
Message-Id: <MPG.11f02c9cc4c7045d989c92@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7m5n38$td8$1@news.inc.net> on Fri, 9 Jul 1999 15:49:18 -
0500, theoddone33 <eoddonetha@akefilesqua.com> says...
> I know that this code works:
> ----
>  if( ($a,$b) = /(.*) blah blah blah (.*)) { }
> ----
> but this code doesn't
> -----
> sub mainrec {
>   my($arg1,$arg2) = @_;
>   #rest of function
> }
> #more code here
> if( mainrec($a,$b) = /(.*) yada yada (.*)/) { }
> -----
> 
> Am I missing something or is this assignment not possible?  Can I amend
> something to do it this way, or will I be forced to call the function from
> within the if statement?

  if( /(.*) yada yada (.*)/ and mainrec($1, $2)) { }

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 09 Jul 1999 16:25:38 -0800
From: theoddone33 <anonymous@web.remarq.com>
Subject: Re: Assigning args with regular expressions
Message-Id: <931566340.1398@www.remarq.com>

I should be ok within the if statement though.  I ended up
not even using the previous code.  It will end up something
like this:

if(/reg exp 1/) {
 mainrec($1,$2);
 $hash1{$1}++;
 $hash2{$2}++;
 next;
}

Go figure, as I didn't end up using either suggestion, this
entire thread has been a waste of bandwidth, except that I
learned a little. I guess that makes it worthwhile. Thanks
all.
Oh, and be careful with CCs to email addresses that are
spam-proofed like my own. =)

theoddone33



**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****


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

Date: 09 Jul 1999 17:58:45 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Cookies won't work
Message-Id: <xkfpv21e5oq.fsf@valdemar.col.hp.com>

Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc, backwards.saerdna@srm.hc (Andreas Fehr) writes:
> :BTW, wasn't there any discussion whether a signature starts
> :with '--' or with '-- '?
> 
> Nope.  It starts with "\n-- \n".   No discussion. :-)

Sheesh, that isn't even a real RFC, much less a standard, so discuss
away!

-=Eric, who has no .sig, so can say these things. :^)


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

Date: 9 Jul 1999 23:10:07 GMT
From: kevin@prism.ig.utexas.edu (Kevin Johnson)
Subject: Re: DNS question then sorting by values
Message-Id: <7m5vgf$15s$1@geraldo.cc.utexas.edu>

Kevin Johnson (kevin@prism.ig.utexas.edu) wrote:
: : This almost works correctly. It is printing the "\t",$key,"\n" part 
: : in correct sorted order. (My earlier code attempt fails in part to
: : the fact the values are not unique. duh.) This does not print the
: : $targetSums{$key} values though. I don't understand why not. Any
: : help would be much appreciated. Thanks again.

: Oddly, this would print out values if I printed the values inside
: the aforementioned loop that was setting the key/value pairs. I 
<SNIP>

Never mind. This is a programmer error of not checking whether
the test file open() succeeded or not + the mistake of not closing
the test file before running the program. ack. Time for the weekend.
Have a good one. 

Kevin

--
Kevin Johnson				University of Texas
Systems Analyst				Institute for Geophysics


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

Date: 9 Jul 1999 18:16:36 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FAQ 5.7: How can I use a filehandle indirectly?
Message-Id: <378690e4@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, jeromeo@atrieva.com (Jerome O'Neil) writes:
:>:It speaks thusly:
:> (Was there some reason that you did not find "thus" sufficiently
:> adverbial for your tastes? :-)
:Its shorter than "It speaketh thus:"

Um, "thusly" isn't a word.  "Thus" is already an adverb.

--tom
-- 
    "...this does not mean that some of us should not want, in a rather
    dispassionate sort of way, to put a bullet through csh's head."
		Larry Wall in <1992Aug6.221512.5963@netlabs.com>


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

Date: Fri, 09 Jul 1999 17:24:02 -0700
From: Mike Machado <mike@innercite.com>
Subject: Global variables from a module
Message-Id: <378692A1.34D82BA1@innercite.com>

I am trying to set a variable in my module and have it avaiable in the
user script without having to go $Package::var


I set my $var = "something" in the module and put $var in the
@EXPORT and the @EXPORT_OK but that did not work. In this example how
could I get
just '$var' avaiable in the user script easily.

Thanks.

--
Mike Machado
mike@innercite.com
InnerCite
Network Specialist





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

Date: Fri, 09 Jul 1999 18:26:24 PST
From: <gjerde@avsupport.com>
Subject: Help -- Modules using up all my memory
Message-Id: <07091999182624gjerde@avsupport.com>


Maybe this is a strange question, but I didn't know exactly where else to turn.

We're working on a project built from many small perl modules (.pm's) and sometimes when the script is run, it will work fine, but other times, perl will just grind and grind, eventually using up all the memory and locking up the machine.

It's Red Hat 6.0, and Perl 5.0005 (or so, whatever is the default version from Red Hat 6.0).

It seems to be related to the 'use' statement. Specifically, it seems to happen when module 'a' uses module 'b' and module 'b' also uses module 'a'. This seems to cause some kind of circular loading that just keeps loading and loading the files until running out of memory.

The funny thing is, we've been working on this project for months and have basically been doing this from the start and only recently has this started happening, but it's getting worse and worse (I suppose as the code is getting larger and more complex.) Can't you do this in Perl?

Of course, I don't think we've changed anything that should be causing this, but of course, the computer is usually right.






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

Date: Fri, 9 Jul 1999 18:42:01 -0500
From: "Don Smith" <smithda@webwide.net>
Subject: Re: Help!: trying to compile my scripts
Message-Id: <7m622u$d3u$1@news.unicomp.net>

Thank you for you enlightening response.  Didn't anyone wonder why my
question seemed similar to the one in the FAQ?  Which Ghostbuster was it who
said, "We mock what we don't understand"?

When one reads my entire posting, they will see that, although I did not
explicitly say "I read through the FAQ.", I actually did read through the
FAQ.  I also looked at other sources of information.

Permit me to try again...

I HAVE TWO QUESTIONS:

1.  WHERE MIGHT I FIND PERLCC?  THE LINKS FROM CPAN ARE BOGUS.

2.  WHERE MIGHT I FIND BYTEPERL?  IT DOESN'T SEEM TO BE PART OF MY LATEST
PERL DISTRIBUTION.

Only useful, constructive and/or informative responses, please.





Abigail wrote in message ...
>Don Smith (smithda@webwide.net) wrote on MMCXXXVIII September MCMXCIII in
><URL:news:7m45sa$5fd$1@news.unicomp.net>:
>||
>|| I am trying to find a method of hiding my sources from the public.
>
>Easy. Put the sources on a machine. Unplug all the network cables.
>Put the machine in a closet. Lock the closet. Throw away the key.
>
>Then read the FAQ.
>
>
>Abigail
>--
>perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
>          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
>          print chr 0x$& and q
>          qq}*excess********}'
>
>
>  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News
==----------
>   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
>------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers
==-----




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

Date: 9 Jul 1999 23:57:34 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: long long in perl?
Message-Id: <7m629e$197$1@pegasus.csx.cam.ac.uk>

Gareth Rees  <garethr@cre.canon.co.uk> wrote:
>On systems where "floating point" means "IEEE 754 double precision", you
>can accurately represent all integers from -2**52-1 to 2**52-1 inclusive
>(that is, -9_007_199_254_740_991 to 9_007_199_254_740_991).

Actually, it's -2**53-1 to 2**53-1 inclusive.    Don't be fooled by the
52 bits.

>If you really need a bigger range of integers, then get Mark Biggar's
>Math::BigInt module from CPAN.

Math::BigInt is part of the standard distribution.   And is not
necessarily the best module available.


Mike Guy


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

Date: Fri, 09 Jul 1999 16:54:41 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: match multiple lines
Message-Id: <37868BC1.B4BA1A96@mail.cor.epa.gov>

infogateinc@usa.net wrote:
> 
> Hi
> I try to extract a range of lines from a file containing patterns on
> different lines. How can I get the lines matching the pattern at the
> very first time? In the following example, I only want:
> [snip of example]
> 
> But If I run the program, I get the second match, too.
> 
> The program is like:

It can't be *too* much like this code, since you have some
undefined variables, etc...

> #! /usr/local/bin/perl

Even in an example program, use the -w flag.  And 'use
strict' too.  And don't forget -T if you're reading in external
data in a CGI program.

> use IO::File;

And this gets used nowhere in your code.  I hope that this
is not the case in your *real* code.  Bear in mind that 
submitting code which does not run to illustrate your
point will usually get you ignored here.  After all, how can
anyone tell what you did wrong in the *real* program?
 
> open (DUMP, "text")|| die ("open lynx failed: $text_data\n");

Well, you checked the return.  That's good.  But it looks
like you were using a piped open here, and you don't
check the return of your close().  Naughty, naughty!  Read
the docs for why.  Besides, IMHO you'd be better off using
LWP::Simple if you just want to snag a webpage.
 
> while (<DUMP>) {
>       print if (m#abc#i ... m#efg#i );

Let me guess.  There are slashes and stuff in the *real*
data, as opposed to the fake stuff you showed us.  What
if there are #'s in there too?

>     }
> close(DUMP);
> 
> [snip of example data]

Yes, ... is bistable.  It toggles back and forth, as many times
as you have this block of text occurring.  If you only want
the first one, you'll have to add your own flag to catch the
first case only.

my $flag=0;
while (<DUMP>) {
    print if ( $flag and m#abc#i ... m#efg#i );
    $flag++ if m#efg#i;
    }

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 9 Jul 1999 17:26:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: match multiple lines
Message-Id: <MPG.11f032fb98444440989c93@nntp.hpl.hp.com>

In article <37868BC1.B4BA1A96@mail.cor.epa.gov> on Fri, 09 Jul 1999 
16:54:41 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
 ...
> Yes, ... is bistable.  It toggles back and forth, as many times
> as you have this block of text occurring.  If you only want
> the first one, you'll have to add your own flag to catch the
> first case only.
> 
> my $flag=0;
> while (<DUMP>) {
>     print if ( $flag and m#abc#i ... m#efg#i );
>     $flag++ if m#efg#i;
>     }

Why keep on reading the file?

If /efg/ can't match before /abc/:

  while (<DUMP>) {
      print if m#abc#i ... m#efg#i;
      last if m#efg#i;
      }

Otherwise:

  my $flag = 0;
  while (<DUMP>) {
      ++$flag, print, next if m#abc#i ... m#efg#i;
      last if $flag;
      }

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 10 Jul 1999 01:10:03 +0100
From: Jason <jason@killdare.demon.co.uk>
Subject: Not Learning Perl
Message-Id: <KBgriDAb9oh3EwMk@shambolica.freeserve.co.uk>


I can't be bothered to learn Perl.

Can anyone help with that or is it in the FAQ, which I can't be bothered
to read?

TMTOWNTDI

I think I'll pop over to Larry Wall's witticisms first, just to see if
Perl is worth it.

How does one go about freeing oneself from being a Prisoner of Bill?

(Will Abigail take the bait?)
-- 
Jason@shambolica.freeserve.co.uk

Tom, is this signature OK? Maybe I need some ascii art and a biography attached?
Your opinion please? I did buy the books (which I haven't bothered reading)


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

Date: Fri, 09 Jul 1999 19:15:55 -0400
From: "Gary M. Greenberg" <garyg@gator.net>
Subject: Re: parse mail files:beginning Perl in UNIX environment
Message-Id: <378682AB.55B98A50@gator.net>

Loki wrote:
[ Posted and emailed; follow-ups reduced to c.l.p.m]
> 
> i wanted to
> [a] parse the mail file and
> [b] write each message to a file whose name is the sender and an
> incremental number: sender.1, sender.2

Take a look at the code at:
    http://www.gator.net/~garyg/txts/mailsplitter.pl.txt

It reads a Unix-style mail file and splits it into numerous files
where the name is based on what follows "Subject: " from the header
(with some optional additional regexp string removal) and appends
like subjects together. I use it for things like downloading the
c.l.p.mod newsgroup, reading it offline, deleting what I don't
want then making files from what I want. Yep, it's rather crude
at this time but it'll hopefully be illustrative && educational
for you.

Hope it's useful,
Gary
   -=-  Avenue Programmers' Reference  (Created with Perl)-=-
   Class Hierarchy, Requests, and Hyperlinked Sample Scripts:
	     http:/www.gator.net/~garyg/aveclass.htm


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

Date: Fri, 9 Jul 1999 16:33:57 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Pattern match counting
Message-Id: <MPG.11f026c2fdfaefa7989c91@nntp.hpl.hp.com>

In article <7m5jaa$ctl$5@info2.uah.edu> on 9 Jul 1999 19:42:02 GMT, Greg 
Bacon <gbacon@itsc.uah.edu> says...

<SNIP of bandwidth-wasting repetitive haranguing>

> : Just imagine explaining either your locution or mine to students using 
> : 'Learning Perl'.  The /g modifier is in the book for multiple matches; 
> : all they have to learn is that it can be looped on.
> 
> Now hear this!  Larry Rosler has declared that all Perl code must be
> accessible to those who have just completed the LLama.

In addition to benchmarks, I love Perl golf, and have no problem with 
actually using it in my production code.  It may be advanced, but I hope 
it's not obscure.  And it's not maintainable by entry-level Perl 
programmers, to be sure.

> : You are perfectly free to show obscure,
> 
> You keep using adjectives like `obscure' and `arcane' without
> justification.  Justify || retract;

Well let's see.

    $count = () = $str =~ /pattern/g;

Assign a list of pattern matches to a null list, and the number of 
elements in that which is assigned comes out the left side,  not the 
number of elements in the list assigned to.  How obvious!

perldata:  List assignment in a scalar context returns the number of 
elements produced by the expression on the right side of the assignment: 

    $x = (($foo,$bar) = (3,2,1));       # set $x to 3, not 2
    $x = (($foo,$bar) = f());           # set $x to f()'s return count

This is obscure enough to need two examples, AND superfluous sets of 
binding parentheses, yet.

To compound the obscurity, the discussion in the Blue Camel under 
Assignment Operators (p. 93) sees fit to point back to this, but the 
discussion in perlop doesn't.  Arcane indeed.

> : slow WTDI to consenting adults 
> : in private.  But expect some flak in public.
> 
> Your faith and reliance on benchmarks is laughable and pitiable.
> Sticks and stones may break my bones, but benchmarks never hurt me.

It isn't *only* the benchmarks (which at least you don't deny).

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 9 Jul 1999 18:17:09 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perlscript in IE
Message-Id: <slrn7od0mu.h7.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCXXXVIII September
MCMXCIII in <URL:news:3785ff1c@cs.colorado.edu>:
;;      [courtesy cc of this posting mailed to cited author]
;; 
;; In comp.lang.perl.misc, Frank de Bot <debot@xs4all.nl> writes:
;; 
;; Why oh why oh why did you quote all 27 lines of that posting, including
;; the offensively long signature?  And what is this 23-line signature
;; of yours?  That's way over the top.  You just hit us with fifty lines of
;; noise for two lines of content.  This just isn't the way things are done.
;; Either you need to learn about expected standards on Usenet, or theres'
;; a bug in your newsreader, or both.



%Score created by slrn on Tue Jul  6 19:25:56 1999

[*]
Score: -9999
  From: Frank de Bot <debot@xs4all\.nl>


Works like a charm.



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 9 Jul 1999 19:13:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: please help regex!
Message-Id: <slrn7od414.h7.abigail@alexandra.delanet.com>

hamed53@my-deja.com (hamed53@my-deja.com) wrote on MMCXXXVIII September
MCMXCIII in <URL:news:7m4sgm$9u7$1@nnrp1.deja.com>:
%% hi
%% i was wondering if any of you could help me with this:
%% i have a string i want to reverse the words containing olny these chars
%% (more than or equal 128, less than 176 or, more than or equal 224, less
%% than 255) :)
%% (ord($mychar) >= 128 && ord($mychar) < 176) or (ord($mychar) >= 224 &&
%% ord($mychar) < 255)

s/([\x80-\xAF\xE0-\xFF]+)/reverse $1/ge;



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 9 Jul 1999 17:42:11 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: please help regex!
Message-Id: <MPG.11f036c134e0825b989c94@nntp.hpl.hp.com>

In article <slrn7od414.h7.abigail@alexandra.delanet.com> on 9 Jul 1999 
19:13:58 -0500, Abigail <abigail@delanet.com> says...
> hamed53@my-deja.com (hamed53@my-deja.com) wrote on MMCXXXVIII September
> MCMXCIII in <URL:news:7m4sgm$9u7$1@nnrp1.deja.com>:
 ...
> %% i have a string i want to reverse the words containing olny these chars
> %% (more than or equal 128, less than 176 or, more than or equal 224, less
> %% than 255) :)
> %% (ord($mychar) >= 128 && ord($mychar) < 176) or (ord($mychar) >= 224 &&
> %% ord($mychar) < 255)
> 
> s/([\x80-\xAF\xE0-\xFF]+)/reverse $1/ge;
                       ^
                       E

Bart Lateur and I posted this nine hours ago, according to my newsfeed.  
Correctly.  Bart even caught the error in the specification that I 
overlooked.

Smirk.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sat, 10 Jul 1999 00:05:27 GMT
From: dennis <dennis.moreno@pop.safetran.com>
Subject: Re: Problem using backticks
Message-Id: <37868E52.7B344094@pop.safetran.com>

Yup.
That'll teach me to code without wearing glasses!! :-)
Thanks to everyone.
Dennis

Bob Walton wrote:
> 
> dennis wrote:
> 
> > Can anyone tell me what wrong with this code?
> > I want it print a single line for each user showing the Full Name, login
> > name and groups.
> > It prints the values of $comment and $name but not $groups.
> >
> > #!/usr/local/bin/perl
> > getpwent();
> > while (@list = getpwent()) {
> >     ($name,$comment) = @list[0,5];
> >     $goups = `/usr/bin/groups $name`;
> 
>      ^^^^^^^^^^^goups
> 
> >
> >     print "$comment $name $groups\n";
> 
>                                     ^^^^^^^^^^^^^^^^^^^groups
> 
> >
> > }
> > endpwent();
> >
> > Thanks


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

Date: Sat, 10 Jul 1999 00:08:21 GMT
From: dennis <dennis.moreno@pop.safetran.com>
Subject: Re: Problem using backticks
Message-Id: <37868EFF.5D13CF5C@pop.safetran.com>

Michael Carman wrote:
> 
> dennis wrote:
> 
> > Can anyone tell me what wrong with this code?
> > I want it print a single line for each user showing the Full Name, login
> > name and groups.
> > It prints the values of $comment and $name but not $groups.
> >
> > #!/usr/local/bin/perl
> > getpwent();
> > while (@list = getpwent()) {
> >     ($name,$comment) = @list[0,5];
> >     $goups = `/usr/bin/groups $name`;
> >     print "$comment $name $groups\n";
> > }
> > endpwent();
> 
> Hey, this one is easy! You never set $groups, you set $goups. Just a typo.
> But, to protect against such things, you should (say it with me, everyone):
> Always use -w and 'use strict'.

Always use -w and 'use strict'.
Always use -w and 'use strict'.
Always use -w and 'use strict'.
Always use -w and 'use strict'.
Always use -w and 'use strict'.
:-)

Thanks
Dennis


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

Date: 9 Jul 1999 19:21:11 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Strangeness re $#{$test{'foo'}{'bar'}}
Message-Id: <slrn7od4eo.h7.abigail@alexandra.delanet.com>

Adam Trojanowski (trojan@samurai.ruin.org) wrote on MMCXXXVIII September
MCMXCIII in <URL:news:Pine.BSF.4.10.9907091024330.15372-100000@samurai.ruin.org>:
** 
** Was wondering if anyone else has noticed that an 'empty' array on a hash
** of hash of array shows up with a record count of -1 instead of 0.  Also
** seems like even when it's not empty, the record count is off by -1.
** 
** #!/bin/perl
** use strict;
** 
** my (%test,$x,@test,$y);
** 
** # what is number of elements of 'empty' hashs of hashes of arrays
** $y = $#{$test{'foo'}{'bar'}};
** print $y."\n\n";

Try: perl -wle '@aa = (); print $#aa'


Would you claim that $# is broken for all arrays, or would you
consider that you might be wrong about the meaning of $#?

Shall we look it up in the manual?



Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 09 Jul 1999 17:01:38 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Suggestions: efficient way to compare large text files?
Message-Id: <37868D62.55C57B26@mail.cor.epa.gov>

[Followups set to c.l.p.misc only]

mercurius_1@yahoo.com wrote:
> 
> Using active server pages written in either Javascript or Perl, I would
> like to be able to compare two plain text files of 5-15 pages in length
> -- an original and a revised file. When additions are made to the
> revised file, I want to be able to distinguish this new text from the
> original (so it can be colored differently).
> [snip]

I would suggest going to http://language.perl.com/ppt/
and getting a copy of mjd's diff program, which will do what
the unix diff does for you.  It's all Perl, too.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Fri, 9 Jul 1999 17:35:26 -0700
From: "Bryn Waibel" <bwaibel@hotmail.com>
Subject: Re: Suggestions: efficient way to compare large text files?
Message-Id: <7m64kb$iiv@news.dns.microsoft.com>


I'm not sure how this is done in practice with programs like Visual
SourceSafe which produces a difference file for each new version of a file,
but I am guessing that it's not a good idea to compare every character of
one file to every character of another.  It's probably a better idea to
compare the files line by line, and then only focus on the lines that were
different.  Also, it's probably a good idea to ignore empty lines, or lines
with only whitespace, plus, in doing this, you will find that when one file
has a line added or removed, the program will lose it's place, so it's a
good idea to implement something which will find the next 'similar' line in
the file, so that you can recapture a starting point when a file has major
changes, and so it doesn't mark everything after the first new line as
changed.  I think you'll find that regular expressions are very useful for
these types of comparisons.  I don't know if this is the most efficient way
of doing something like this, because I think when you implement the
'similar' function, you'll see that it will have to loop through the whole
file and then when it doesn't find a match, it will have to loop through
again with the next line of the source file (this is the case of a deleted
line)  but I'm not sure you're going to find a really efficient way to get
good results for this type of algorithm, especially on a web server where
you want the script to run multiple times per second.

Just my $.02
Bryn

<mercurius_1@yahoo.com> wrote in message news:7m5t7t$n09$1@nnrp1.deja.com...
> Using active server pages written in either Javascript or Perl, I would
> like to be able to compare two plain text files of 5-15 pages in length
> -- an original and a revised file. When additions are made to the
> revised file, I want to be able to distinguish this new text from the
> original (so it can be colored differently).
>
> Does anyone have any suggestions on how best to do this in an efficient
> way? I've used strcmp in the past for smaller tasks, but I wonder how
> well that will work in a long document that may be up to 15 pages in
> length. Suggestions on how best to compare the old/new versions of the
> document would be very much appreciated.
>
> Thank you.
> Mercury
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.




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

Date: 9 Jul 1999 19:29:47 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Too late for "-T" option at init.cgi line 1.
Message-Id: <slrn7od4sp.h7.abigail@alexandra.delanet.com>

mike cardeiro (mikecard@my-deja.com) wrote on MMCXXXVIII September
MCMXCIII in <URL:news:7m55mk$dbh$1@nnrp1.deja.com>:
 .. i am making a program that will create and use data files.  i am a
 .. little worried about users being able to rewrite these data files
 .. outside of the perl script and wreaking havoc on my site (if thats
 .. possible) so i searched low and high and someone suggested the taint
 .. option, but when i try to invoke it i get:
 ..      Too late for "-T" option at init.cgi line 1.
 .. 
 .. why is it too late and am i barking up the wrong tree by using taint


-T should be in the first group of command line options. But taint
checking isn't going to magically prevent others from rewriting
your data files.



Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 09 Jul 1999 16:22:50 -0700
From: Chris Ice <chris.ice@cisco.com>
Subject: Re: totally lost on an error message
Message-Id: <3786844A.9060E38D@cisco.com>

Dodger wrote:
> 
> dragon-lord html/magick> !p
> perl test.pl
> Using Magick
> Have a new image
> perl: can't resolve symbol 'FormatString'
> dragon-lord html/magick>

The ImageMagick module probably has some XS code in it, and I feel your
suspicions are correct about this being a C error sneaking thru.  This
is probably a linking problem and the module was either installed while
ignoring 'make test' errors, or built on a different machine and
"transplanted" to where you're using it.

Best bet would be to rebuild ImageMagick.pm on the machine it's going to
run on, make test it, and then install.

My $.02

Chris
-- 
                               --------
 +----------------------------| _   /| |-----------------------------+
 | Chris Ice, Software Artist | \`o_O' | Cisco Systems, Inc.         |
 | http://www.trub.com/       |   ( )  | http://www.cisco.com/       |
 | mailto:chris.ice@cisco.com |    U   | 170 W. Tasman Dr., SJ-05/1  |
 | 408.525.7373               |  Syn,  | San Jose, CA 95134-1706 USA |
 +----------------------------|  Ack!  |-----------------------------+
  My opinions may not reflect  --------  the views of my employer.


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

Date: Fri, 09 Jul 1999 23:06:59 GMT
From: thomas@skyweb.net (Thomas j. Evans)
Subject: Win32 Perl and globbing
Message-Id: <37867be9.1076596@news.skyweb.net>

Hi.

I'm trying to have a Perl script delete a number of files, but it
seems globbing doesn't work in Win32 Perl.  For example:

unlink <Info\\June*.htm> || die "Unlink: $!";
# This dies with no error message.

The directory location is correct, because deleting a single file
specifically does work:

unlink "Info\\June9_24.htm";  # This works

Nutshell:  How can I delete a group of files that begin with a certain
word from within a Win32 Perl script?

-T


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

Date: Fri, 09 Jul 1999 17:09:17 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: "Thomas j. Evans" <thomas@skyweb.net>
Subject: Re: Win32 Perl and globbing
Message-Id: <37868F2D.FFE87302@mail.cor.epa.gov>

[courtesy email to poster, since he hasn't munged up his address]

Thomas j. Evans wrote:
> 
> Hi.
> 
> I'm trying to have a Perl script delete a number of files, but it
> seems globbing doesn't work in Win32 Perl.  For example:

Yep.  globbing is a feature of the shell, and Perl assumes that
the shell will do it.  So it works in unix, and fails in win32.

> [snip]
> Nutshell:  How can I delete a group of files that begin with a certain
> word from within a Win32 Perl script?

There are several ways to do it, but I would suggest using
opendir(), readdir(), and closedir() to get the files from
the directory; then a grep() to pull out the files you want;
then a loop to unlink() the files one-by-one, with an
error in case of failure.  That's one way to ensure that
you know which files you failed to delete.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V9 Issue 97
************************************


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