[12690] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 99 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 10 02:07:18 1999

Date: Fri, 9 Jul 1999 23: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           Fri, 9 Jul 1999     Volume: 9 Number: 99

Today's topics:
    Re: array stuff.. <uri@sysarch.com>
    Re: array stuff.. <rick.delaney@home.com>
    Re: Changing case local-specifically (Larry Rosler)
        environment variables <Gened@ohinter.net>
    Re: environment variables (Abigail)
    Re: Formatting a number to a currency string (Michael Budash)
    Re: Freelance perl/cgi/cookie help wanted. (Abigail)
    Re: getpwent will not share array data outside while. <john@hendigital.com.au>
    Re: getpwent will not share array data outside while. <rick.delaney@home.com>
    Re: Not Learning Perl <uri@sysarch.com>
    Re: Not Learning Perl <rick.delaney@home.com>
    Re: Not Learning Perl <dgris@moiraine.dimensional.com>
    Re: Pattern match counting <rick.delaney@home.com>
    Re: Perl & mySQL - Please Help! (Abigail)
    Re: Random Numbers <uri@sysarch.com>
        Reading from NT serial port (George Avison)
    Re: Receiving binaries (Neko)
    Re: Receiving binaries (Abigail)
    Re: single instance log file (Scott Skinner)
    Re: Suggestions: efficient way to compare large text fi <evrabel@earthlink.net>
    Re: Using perlcc to compile a perl prog (Abigail)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 10 Jul 1999 00:22:53 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: array stuff..
Message-Id: <x7so6xqgki.fsf@home.sysarch.com>

>>>>> "A" == Abigail  <abigail@delanet.com> writes:

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

  A> And for my Perl golf entry:

  A>    s//$str/

even better. and to complete it for the original poster:

	s//$str/ for @out ;

not too shabby as the poster asked for a simple and short way to do
this.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Sat, 10 Jul 1999 05:25:49 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: array stuff..
Message-Id: <3786D92A.4077577C@home.com>

[posted & mailed]

Uri Guttman wrote:
> 
> even better. and to complete it for the original poster:
> 
>         s//$str/ for @out ;
> 
> not too shabby as the poster asked for a simple and short way to do
> this.

Very nice, as long as there are no successful pattern matches before
using it.  Perhaps one extra character for correctness.

    s/^/$str/ for @out;

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Fri, 9 Jul 1999 22:28:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Changing case local-specifically
Message-Id: <MPG.11f079c12d21579c989c96@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <Atyh3.82$xEh.179233792@news.frii.net> on Sat, 10 Jul 1999 
02:45:52 GMT, Jack Applin <neutron@bamboo.verinet.com> says...
> I'm trying to change the case of a string.  That is, "Jack" would
> become "jACK".  Here's my first attempt:
> 
> 	$_ = "Jack\n";
> 	tr/a-zA-Z/A-Za-z/;
> 	print;
> 
> Of course, this will fail for non-ASCII letters such as ö.
> This seems to work:
> 
> 	use locale;
> 	$_ = "AeÎö\n";
> 	s/\w/$& ne uc($&) ? uc($&) : lc($&)/ge;
> 	print;
> 
> I don't like it.  It executes code for each \w character found,
> which can't be too fast.  I'd like to do one whopping tr for the
> entire string, but constructing the tr and eval'ing it would be ugly.
> Any ideas?

How ugly would it be?  Presumably it would be done once, and its costs 
amortized over many uses.  I'll use your own code to construct the tr.


#!/usr/local/bin/perl -w
use strict;
use locale;

# Initialization.
my $left  = join "" => map chr, ord('A') .. 0xFF; # No letters lt 'A'.
(my $right = $left) =~ s/(.)/$1 ne uc($1) ? uc($1) : lc($1)/ge;
eval "sub Tr { \$[0] =~ tr/$left/$right/ }";
$@ and die $@;

# Use.
$_ = "AeÎö\n";
print;
Tr($_);
print;

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


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

Date: Fri, 09 Jul 1999 23:40:26 -0400
From: Gene Dolgin <Gened@ohinter.net>
Subject: environment variables
Message-Id: <3786C0AA.D28D78F6@ohinter.net>

does anyone know for which browsers http_from will still work?

-geme



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

Date: 10 Jul 1999 00:43:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: environment variables
Message-Id: <slrn7odnav.h7.abigail@alexandra.delanet.com>

Gene Dolgin (Gened@ohinter.net) wrote on MMCXXXIX September MCMXCIII in
<URL:news:3786C0AA.D28D78F6@ohinter.net>:
"" does anyone know for which browsers http_from will still work?


Lalapolazapoosie



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== 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 22:23:57 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: Formatting a number to a currency string
Message-Id: <mbudash-0907992223570001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <3786A180.30332D72@mustangone.com>, Doc Data
<docdata@mustangone.com> wrote:

>How can I format a number to a string in currency format?
>
>Thanks

if i understand your question, here's the answer straight from the perlfaq:


>How can I output my numbers with commas added? 
>
>This one will do it for you: 
>
>    sub commify {
>        local $_  = shift;
>        1 while s/^(-?\d+)(\d{3})/$1,$2/;
>        return $_;
>    }
>
>    $n = 23659019423.2331;
>    print "GOT: ", commify($n), "\n";
>
>    GOT: 23,659,019,423.2331
>
>You can't just: 
>
>    s/^(-?\d+)(\d{3})/$1,$2/g;
>
>because you have to put the comma in and then recalculate your position. 

hth-
-- 
| Michael Budash Consulting     | 707-252-7670 voice |
| Perl, Javascript, PHP, MySQL  | 603-250-8679 fax   |
| Official Extropia Developer   | mbudash@sonic.net  |


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

Date: 10 Jul 1999 00:44:54 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Freelance perl/cgi/cookie help wanted.
Message-Id: <slrn7odne0.h7.abigail@alexandra.delanet.com>

Tomh (fetch@fetchound.com) wrote on MMCXXXVIII September MCMXCIII in
<URL:news:931561279.827@www.remarq.com>:
__ 
__ 
__ Have a create/set/get/use cookie project.


I'll volenteer for the 'use cookie' part. Just send them to me,
and I'll eat them!



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^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: 10 Jul 1999 11:41:21 -0800
From: "John Hennessy" <john@hendigital.com.au>
Subject: Re: getpwent will not share array data outside while.
Message-Id: <01beca85$a8034400$f34f39cb@stingray>

The getpwent() function eventually runs out of lines in the /etc/passwd
file and falls out of the
while loop through to the rest of the program. It is here that I foreach
the items of the array @list
expecting it to contain all lines from the /etc/passwd but it is an emtpy.

My understanding was that its values should be global not just private
whithin the while loop.

John.

Rick Delaney <rick.delaney@home.com> wrote in article
<37862C88.743F147B@home.com>...
> [posted & mailed]
> 
> John Hennessy wrote:
> > 
> > If I attempt a foreach $login (@list) outside
> > of the while I get an empty list.
> 
> [snip]
> 
> > while (@list = getpwent())
> 
> To get outside the while, the condition must be false (unless you break
> out with last).  How many elements must @list have to make the while
> condition false?
> 
> -- 
> Rick Delaney
> rick.delaney@home.com
> 


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

Date: Sat, 10 Jul 1999 05:18:55 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: getpwent will not share array data outside while.
Message-Id: <3786D78B.A7A4E5F0@home.com>

[posted & mailed]
[post rearranged to flow like natural conversation.  Very well
Jeopardy-speak I don't understand]
[My .sig trimmed as it contains nothing that isn't in the attribution
line.  Plus it's just plain wrong to quote it]

John Hennessy wrote:
> 
> Rick Delaney <rick.delaney@home.com> wrote in article
> <37862C88.743F147B@home.com>...
> >
> > > while (@list = getpwent())
> >
> > To get outside the while, the condition must be false (unless you break
> > out with last).  How many elements must @list have to make the while
> > condition false?
>
> The getpwent() function eventually runs out of lines in the /etc/passwd
> file and falls out of the
> while loop through to the rest of the program. 

You don't just fall out of a while loop because you reach end-of-file. 
Even in a construct like

    while (<FILE>) {

that is not what happens.

From perlsyn:

    LABEL while (EXPR) BLOCK

    The while statement executes the block as long as the expression is 
    true (does not evaluate to the null string ("") or 0 or "0"). 

So in other words, a while loop will not finish looping until the
expression between the parentheses is false.  In the case of 

    while (<FILE>) {

which is actually internally implemented as

    while (defined($_ = <FILE>)) {

the expression happens to become false at end-of-file.  However, this
does not mean that eof always causes control to break out of the loop. 
The expression evaluates to false because at eof the assignment to $_ is
undefined and the defined function returns false.  

This while loop will never terminate, despite eventually reaching eof.

    while (defined($_ = <FILE>) . 'x') {

Now, in the case of

    while (@list = getpwent()) {

there is only one way that the expression can evaluate to false.  That
is if the list assignment (which is in a scalar context imposed by
while) returns 0.  This will only happen if getpwent() returns an empty
list, ().  Again, it just so happens that this occurs at eof, but it is
the value of the expression that matters, not the eof.


> It is here that I foreach the items of the array @list
> expecting it to contain all lines from the /etc/passwd but it is an emtpy.

No, it could never contain all lines from /etc/passwd because you assign
to @list on each iteration of the loop, wiping out what was previously
there.

It should be obvious by now why @list is empty upon exiting the loop.
 
> My understanding was that its values should be global not just private
> whithin the while loop.

It is global, but this is irrelevant.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 10 Jul 1999 00:47:43 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Not Learning Perl
Message-Id: <x7n1x5qff4.fsf@home.sysarch.com>

>>>>> "J" == Jason  <jason@killdare.demon.co.uk> writes:

  J> I can't be bothered to learn Perl.

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

  J> TMTOWNTDI

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

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


this was done much better last year. someone posted a long troll which
hit every hot button this group has. he wanted instant help and didn't
want to rtfm etc. it should be reposted every so often. it actually
suckered some of us into thinking the poster was a real nutcase. anyone
remember the name (or is the author still here?) of the author so we
could find it on deja?

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Sat, 10 Jul 1999 05:34:26 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Not Learning Perl
Message-Id: <3786DB2E.56542ACC@home.com>

[posted & mailed]

Uri Guttman wrote:
> 
> this was done much better last year. someone posted a long troll which
> hit every hot button this group has. he wanted instant help and didn't
> want to rtfm etc. it should be reposted every so often. it actually
> suckered some of us into thinking the poster was a real nutcase. anyone
> remember the name (or is the author still here?) of the author so we
> could find it on deja?

Patrick Timmins, I believe.  He posted some stuff earlier this week so
he's still around to deny the charge.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 09 Jul 1999 23:54:40 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Not Learning Perl
Message-Id: <m3g12x123j.fsf@moiraine.dimensional.com>

Uri Guttman <uri@sysarch.com> writes:

<snip attempted troll>

> this was done much better last year.

Yes, it was.  Funniest thing to happen here all year long.  :-)

> anyone remember the name (or is the author still here?) of the
> author so we could find it on deja?

It was Patrick Timmins under the subject 
 `QUESTIONS (was: Perl Programmer Needed)'.

http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=389453285&fmt=text

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Sat, 10 Jul 1999 04:35:36 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Pattern match counting
Message-Id: <3786CD63.C5DFDE59@home.com>

[posted & mailed]

Larry Rosler wrote:
> 
> 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

Okay, now what do you think this prints?

    $\ = "\n";
    $c = () = (undef, undef);
    print $c;
    $c = () = (undef, undef)[0..1];
    print $c;

No fair looking at the development release documentation where this bug
is documented as a special-case feature.  Talk about arcane!

-- 
Rick Delaney
rick.delaney@home.com


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

Date: 10 Jul 1999 00:50:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl & mySQL - Please Help!
Message-Id: <slrn7odnnq.h7.abigail@alexandra.delanet.com>

elaine ashton (elaine@chaos.wustl.edu) wrote on MMCXXXIX September
MCMXCIII in <URL:news:Pine.GSO.4.05.9907092033160.18443-100000@chaos.wustl.edu>:
`` > Can anyone give me some examples on adding a value to a mySQL database,
`` > then getting that value?  Please help!  Any examples would be great!
`` 
`` *boggle* mySQL is so heavily documented I find it hard to believe you
`` could have possibly missed it. 
`` 
`` elaine@chaos src/mysql-3.22.22/Docs> ls
`` INSTALL-BINARY      Makefile.in         manual.texi         mysql.info
`` Img/                include.texi        manual.txt          texi2html*
`` Makefile            manual.html         manual_toc.html
`` Makefile.am         manual.ps           mysql-for-dummies


He probably doesn't have an account on 'chaos'.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-


  -----------== 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: 10 Jul 1999 00:26:04 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Random Numbers
Message-Id: <x7pv21qgf7.fsf@home.sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  >> how would you classify /dev/rand which is based on data in the kernel? i
  >> don't know exactly how it creates the numbers, but it is not predictive
  >> as it is influenced by random input like kernel interrupts.

  LR> I would classify it thus:

  LR> 2.  Something system-specific.

true. solaris doesn't seem to have it.

  LR> 3.  Sort of like special hardware ('/dev/...' :-).

pseudo device, not hardware. :-)

  LR> 5.  Probably slow itself, if it relies on randomly occurring kernel 
  LR> interrupts. 

i doubt it. i think that the kernel is always being scanned or random
info in it is being collected. you are supposedly able to read it like
/dev/zero and just slurp random numbers forever. i have to check a linux
box for details.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Sat, 10 Jul 1999 03:09:03 GMT
From: avisong@widomaker.com (George Avison)
Subject: Reading from NT serial port
Message-Id: <3786b86d.52961680@news.widomaker.com>

I'm new to Perl and I'm trying to write a script that will read (into
an array) a text file that is being dumped across a serial port onto
an NT 4.0 system.  Can anyone tell me how I tell Perl I want it to
read from this port rather than from STDIN or a file?  Thanks for any
help.


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

Date: 10 Jul 1999 03:18:22 GMT
From: tgy@chocobo.org (Neko)
Subject: Re: Receiving binaries
Message-Id: <7m6e1u$lnu$0@216.39.141.200>

On Sat, 10 Jul 1999 01:18:55 GMT, tamcgee@home.com (Tom McGee) wrote:

>In article <slrn7o5fu6.tch.abigail@alexandra.delanet.com>,
>abigail@delanet.com wrote:
>
>>>I usually just point to the nearest church tower.
>
>I usually tell them what time it is. But that's why computer people have
>such a reputation as warm, caring, accessible people.

And five minutes later, impatiently waiting for the number 9 bus, he turns to
you and asks you once again, "What time is it?"  The bus is late, so four
minutes later, he again repeats his query.  He asks again and again and again
until the bus arrives.

I can see why Abigail would helpfully point to the nearby church tower.

>Why do you feel you're exempt from the norms of civilized behavior towards
>others just because you're on the net?

How rude of her.  Forcing someone to interpet what it means when the liitle
hand is on the four and the big hand is on the one.

-- 
Neko | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=


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

Date: 10 Jul 1999 00:36:42 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Receiving binaries
Message-Id: <slrn7odmue.h7.abigail@alexandra.delanet.com>

Tom McGee (tamcgee@home.com) wrote on MMCXXXIX September MCMXCIII in
<URL:news:tamcgee-0907992114390001@cc1017583-a.union1.nj.home.com>:
&& In article <slrn7o5fu6.tch.abigail@alexandra.delanet.com>,
&& abigail@delanet.com wrote:
&& 
&& >>I usually just point to the nearest church tower.
&& 
&& I usually tell them what time it is. But that's why computer people have
&& such a reputation as warm, caring, accessible people.

I'm sorry, but I went to a school where they teached me more than
just facts. We were also taught how to learn things.

I'm sorry you have missed that.

&& Why do you feel you're exempt from the norms of civilized behavior towards
&& others just because you're on the net?

That depends on your definition of 'civilized'. I consider it rude to
tell others they should do the same as me, lest they be classified
as uncivilized.



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


  -----------== 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: Sat, 10 Jul 1999 01:22:51 -0400
From: sskinner@cloud9.net (Scott Skinner)
Subject: Re: single instance log file
Message-Id: <sskinner-1007990123190001@sskinner.dialup.cloud9.net>

In article <37863F65.F4421E16@mail.cor.epa.gov>, David Cassell
<cassell@mail.cor.epa.gov> wrote:

> > >>open (FILEHANDLE, "+>> $myPath"); # read/append mode
> > > Where's the check for success?
> > 
> > I'm an optimist.
> 
> Come on, be fair.  Lots of times the poster has failed
> to check this, and it is in fact the real problem!
> Particularly when issues of CGI or directory movement
> or file permissions come up.  Check the return, or
> expect to get hammered on this every time you post here.
> Ditto for your flock().  There's no point in using
> flock() if you're not going to check that it worked.

To be honest, I really just assumed Anno was some kind of Perl bot that
automatically kicks in with smug comments whenever someone posts. Am I
wrong?

I am not a Perl Jedi, but neither is Anno--particularly since he doesn't
know the difference between the various flags of the open function. So I
really don't think Anno is in any position to patronize me with comments
like "Where's the -w?". I'm not saying Anno was wrong; I'm saying his tone
was unfriendly, and hardly in the spirit of this community, as is evident
from reading other posts.

[snip]

> Except that this won't work, will it?  Read the FAQ answer that
> Anno's comment pointed you toward.  You're more likely to
> want grep() and a hash.  One doesn't compare a scalar and an

I checked the perldoc and using a hash does sound like the way to go.
Thank you Anno-bot. Thank you Dave.

> array the way you're thinking.  Besides, is there a *good*
> reason for parsing the HTTP_USER_AGENT [which can be spoofed
> anyway]?  You're surely not going to write pages which differ
> depending on the user's browser, are you?  That's considered
> poor web coding around here.

[off topic]

Yes, you can spoof a web server, turn off Java, turn off JavaScript, turn
off cookies, remove all your fonts, make your font size 72 points, etc.,
etc. All of this would hardly take away from the usefulness in determining
what HTTP_USER_AGENT the other 99.9 percent of your web audience is using.
Still, you've made me curious: what is considered meritorious web coding
in this case? Design for the lowest common denominator? One size fits all?
After all, the lowest common denominator can sink pretty low...

-S


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

Date: Sat, 10 Jul 1999 04:31:31 GMT
From: Eric Vrabel <evrabel@earthlink.net>
To: mercurius_1@yahoo.com
Subject: Re: Suggestions: efficient way to compare large text files?
Message-Id: <7m6ib3$tge$1@nnrp1.deja.com>

You may want to try finding a tool to do this for you instead of
writing your own code.  For example, Windiff can be run from a command
line (or ASPExec) but it doesn't give very much information without the
GUI.  You may be able to find an existing component/utility to do this.

HTH

Eric

In article <7m5t7t$n09$1@nnrp1.deja.com>,
  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).
>
> 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.
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 9 Jul 1999 23:12:54 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Using perlcc to compile a perl prog
Message-Id: <slrn7odi13.h7.abigail@alexandra.delanet.com>

richardwchin@my-deja.com (richardwchin@my-deja.com) wrote on MMCXXXVIII
September MCMXCIII in <URL:news:7m4v3g$att$1@nnrp1.deja.com>:
;; 
;; In any case the FAQ says:
;; "In general, the compiler will do nothing to make a Perl program
;; smaller, faster, more portable, or more secure. In fact, it will
;; usually hurt all of those."
;; His main concern is security and if the compiler makes it less secure
;; the whole exercise is pointless.


Picking another language doesn't make it more secure either.



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


  -----------== 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: 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 99
************************************


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