[13495] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 905 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 25 06:07:39 1999

Date: Sat, 25 Sep 1999 03:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <938253909-v9-i905@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 25 Sep 1999     Volume: 9 Number: 905

Today's topics:
    Re: ${$hashref}[$s] and ${$hashref[$s]} (Larry Rosler)
    Re: ./  -- why? (Abigail)
    Re: ./  -- why? (Abigail)
    Re: automatic news poster script (Abigail)
    Re: beauty of a Y2K bug (Abigail)
    Re: can I do this easier? nileshnimkar@my-deja.com
    Re: can I do this easier? (Larry Rosler)
        content needed for oklinux.yi.org <blkstar@mail.com>
    Re: finding number of items in an array (Abigail)
    Re: Pass by reference (Abigail)
        Perl error message <webmaster@worldwidejewels.com>
        perl program terminates unexpectedly <rcook@pcug.org.au>
    Re: Pie and Bar Charts? nileshnimkar@my-deja.com
    Re: Regex & URL parsing... <sunfox@home.com>
    Re: remove the html tag in the file (Kragen Sitaker)
    Re: remove the html tag in the file <gellyfish@gellyfish.com>
    Re: sort depth (Abigail)
    Re: sort depth (Kragen Sitaker)
    Re: Strict? (Abigail)
    Re: toLowercase?? (Abigail)
        WEB  server in Pearl <rommelhereNOroSPAM@YAHOO.COM.invalid>
    Re: You should be admired (Abigail)
    Re: You should be admired (Henry Penninkilampi)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 25 Sep 1999 00:42:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: ${$hashref}[$s] and ${$hashref[$s]}
Message-Id: <MPG.12561ca9ac350702989fda@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7she6d$5hd$1@nnrp1.deja.com> on Sat, 25 Sep 1999 03:05:55 
GMT, j_chris@sprynet.com <j_chris@sprynet.com> says...
> Need to have a better understanding of the two referents in the subject
> of this question. Have read relevant parts of the Camel book and the
> perlref manpage. Have a grasp of the first (believing that it resolves
> the contents of "hashref" to point to an hash and then uses "s" as a
> subscript to pick up either a value or another referent). But when
> perlref says that ${$hashref[$s]} accesses "a variable called %hashref"
> rather than "dereferencing through $hashref to the hash it's presumably
> referencing" then I'm lost.

In neither of the two expressions in your subject do I see a reference 
to a hash.  In the first one, the reference '$hashref' is to an array. 
In the second one, '$hashref[$s]' is an element of the array @hashref, 
which is an array of references to scalars.

Are you sure each of those '[$s]' shouldn't be '{$s}'?  Then they would 
indeed be hashes, not arrays.


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

my $s = 2;

my $ref = [ 'a' .. 'd' ];

print ${$ref}[$s], "\n";

my @ref = ( \'A' , \'B' , \'C' , \'D' );

print ${$ref[$s]}, "\n";

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


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

Date: 25 Sep 1999 01:04:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: ./  -- why?
Message-Id: <slrn7uopkq.faj.abigail@alexandra.delanet.com>

Jeff (post.it@in.newsgroup.pls) wrote on MMCCXIV September MCMXCIII in
<URL:news:7scaag$91b$1@gaddy.interpath.net>:
^^
^^ I am wondering why would I need to precede my Perl script with a " ./ " to
^^ get it to execute?

You don't need to. If you set up your environment in a potentially
dangerous way, you don't need to. This, however, has nothing to do with
Perl. It would be true for any executable file.

^^                     I am using a Red Hat server.

Does that serve Hats using the Red protocol? ;-) I've heard of 'Red Hat'
as a distribution of a certain Unix operating system, but I kind of doubt
that you have a piece of software that distributes operating systems.

What makes you think that using a "Red Hat server" matters?

^^                                                   When I run this script on
^^ a Slackware server it doesn't need the ./ in front of the file name.

Red herring. "Red Hat" and "Slackware" are irrelevant for this problem.
You might as well have said "I need to put ./ in front of my scripts on my
banana flavoured machine, but I don't need to on my chocolate flavoured 
machine". 



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: 25 Sep 1999 01:08:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: ./  -- why?
Message-Id: <slrn7uoprk.faj.abigail@alexandra.delanet.com>

Randal L. Schwartz (merlyn@stonehenge.com) wrote on MMCCXIV September
MCMXCIII in <URL:news:m1g105x12q.fsf@halfdome.holdit.com>:
^^ >>>>> "Philip" == Philip 'Yes, that's my address' Newton <nospam.newton@gmx.net> writes:
^^ 
^^ Philip> 2) This opens yourself up to things such as your favourite co-worker
^^ Philip> putting a shell script containing "rm -rf *" and called "ls" into your
^^ Philip> directory. '.' shouldn't be the first component of your path, and
^^ Philip> probably shouldn't be in it at all.
^^ 
^^ Speaking of cargo cult programming... why do people type:
^^ 
^^ 	rm -rf *
^^ 
^^ when it should be
^^ 
^^ 	rm -rf .

Really? Did you _try_?

    $ rm -rf .
    rm: cannot remove `.' or `..'
    $

You probably want:

      rm -rf `pwd`


Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== 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: 25 Sep 1999 01:13:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: automatic news poster script
Message-Id: <slrn7uoq4o.faj.abigail@alexandra.delanet.com>

Job-Base (info@job-base.com) wrote on MMCCXIII September MCMXCIII in
<URL:news:37E94B1F.4B527C96@job-base.com>:
;;                              At the risk of being flamed again I would
;; even invite you to visit my site and will appreciate the comments you
;; would have.

I'll flame you: you post Jeopardy style. *plonk*



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== 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: 25 Sep 1999 01:16:39 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: beauty of a Y2K bug
Message-Id: <slrn7uoqau.faj.abigail@alexandra.delanet.com>

Sam Holden (sholden@pgrad.cs.usyd.edu.au) wrote on MMCCXV September
MCMXCIII in <URL:news:slrn7umb1t.nou.sholden@pgrad.cs.usyd.edu.au>:
__ On Fri, 24 Sep 1999 05:53:07 GMT, Kragen Sitaker <kragen@dnaco.net> wrote:
__ >
__ >Missing handrails like no type safety and no bounds-checking and no
__ >garbage collection I can understand.  It makes your program faster and
__ >compilers simpler, and sometimes makes your program simpler, too.
__ >
__ >But what does tm_year being (year -1900) buy you?  You can fit it into
__ >a byte instead of two bytes?  It certainly doesn't make your program
__ >any faster or simpler, and it doesn't make the library any faster or
__ >simpler either.  All it does is cause bugs.
__ 
__ It shows you who are the idiots that don't read the specs and thus
__ should not be employed.


Nice try, but that didn't really work, did it?



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\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: Sat, 25 Sep 1999 05:20:48 GMT
From: nileshnimkar@my-deja.com
Subject: Re: can I do this easier?
Message-Id: <7shm37$aog$1@nnrp1.deja.com>

In article <7sh2ju$bo1$1@paxfeed.eni.net>,
  "Cipo Fuzo" <cipofuzo@hotmail.com> wrote:
> hello,
>
> I would  like to load in 8 line cunks from a text file. Is there an
> easier/nicer way, than this:
>
> while (($chunk[0]=<INPUT>) && ($chunk[1]=<INPUT>) &&
($chunk[2]=<INPUT>) &&
> ($chunk[3]=<INPUT>) && ($chunk[4]=<INPUT>) && ($chunk[5]=<INPUT>) &&
> ($chunk[6]=<INPUT>) && ($chunk[7]=<INPUT>))
> {
>     ...
> }
>
> Thanks.
>
>

Of course you can !!. Instead of loading each line seperately, load the
whole file at once in an array.

@chunk = <INPUT> ; # loads whole file. Each line a element.
$#chunk = 8 ; # trunkates your array to only 8 elements. Now you
have 			       # your firsr 8 lines !!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sat, 25 Sep 1999 00:23:11 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: can I do this easier?
Message-Id: <MPG.125618308d23057e989fd9@nntp.hpl.hp.com>

In article <7sh2ju$bo1$1@paxfeed.eni.net> on Fri, 24 Sep 1999 16:47:57 -
0700, Cipo Fuzo <cipofuzo@hotmail.com> says...
> I would  like to load in 8 line cunks from a text file. Is there an
> easier/nicer way, than this:
> 
> while (($chunk[0]=<INPUT>) && ($chunk[1]=<INPUT>) && ($chunk[2]=<INPUT>) &&
> ($chunk[3]=<INPUT>) && ($chunk[4]=<INPUT>) && ($chunk[5]=<INPUT>) &&
> ($chunk[6]=<INPUT>) && ($chunk[7]=<INPUT>))
> {
>     ...
> }

until (eof INPUT) {
    my @chunk;
    push @chunk, scalar <INPUT> for 0 .. 7;
    print grep(defined, @chunk), "\n"; # for example
}

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


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

Date: Sat, 25 Sep 1999 00:08:33 -0400
From: blkstar <blkstar@mail.com>
Subject: content needed for oklinux.yi.org
Message-Id: <37EC4AC1.9AA6F43@mail.com>

Hello,
I am creating a site (oklinux.yi.org) that will focus a great deal on
Perl and CGI. One thing that I don't want to do
is use content from other programming pages, having noticed that most of
them contain the exact same stuff.
If you have any information to share (tutorials/articles/comparisons,
etc.) then send them to oklinux@mail.com and it will be put to good use.
Any questions or comments that you may have are also welcome.

                                                        -Ryan
oklinux@mail.com





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

Date: 25 Sep 1999 01:48:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: finding number of items in an array
Message-Id: <slrn7uos5o.faj.abigail@alexandra.delanet.com>

mikej (mikej@1185design.com) wrote on MMCCXIII September MCMXCIII in
<URL:news:37E95F26.E05B2164@1185design.com>:
,, 
,, What would be the easisest way to find out how many items I have in an
,, array?

If you know some math, and especially some tricks related to logarithms,
it's incredibly easy!

     my  $i = 1;
     my ($nr_of_items) = reverse map {$i <<= 1} @array;
         $nr_of_items  = log ($nr_of_items or 1) / log (2 or $nr_of_items);


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: 25 Sep 1999 00:53:54 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Pass by reference
Message-Id: <slrn7uop09.faj.abigail@alexandra.delanet.com>

David Cassell (cassell@mail.cor.epa.gov) wrote on MMCCXV September
MCMXCIII in <URL:news:37EBDB55.9F17DC28@mail.cor.epa.gov>:
\\ 
\\ I think the glob/reference horse is dead now.  But what's wrong
\\ with a judicious use of $a and $b?  Sure, they're special when
\\ sorting.  But outside of a sort routine they're legit.

Legit, but different.

    $ perl -e 'use strict; $a = 1'
    $ perl -e 'use strict; $x = 1'
    Global symbol "$x" requires explicit package name at -e line 1.
    Execution of -e aborted due to compilation errors.
    $


Whether they are bad or not, I have no opinion.



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: Fri, 24 Sep 1999 22:20:03 -0700
From: Webmaster <webmaster@worldwidejewels.com>
Subject: Perl error message
Message-Id: <37EC5B83.88A2F8F5@worldwidejewels.com>

HI all;

I am having a problem with the error message below that perl gives me
everytime I use it. 

For exmaple, If I type perl -v, the following output is given before the
response:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "us"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Once I get this output it goes back to normal.

This is quite extrange since I have the date and time setup right in the
computer. I am using FreeBSD 3.2-RELEASE and perl 5.005_03. 

any suggestions will be welcome

-Max


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

Date: Sat, 25 Sep 1999 19:51:07 +1000
From: Owen Cook <rcook@pcug.org.au>
Subject: perl program terminates unexpectedly
Message-Id: <4o7sN9jkbQvk8Kff8aDfB6fp+3R=@4ax.com>

Windows DUN produces a modem log and I used a perl program to give a
summary of connection times, as well as up and down bytes.

With a change to V90 on the ISP side, I am now getting occassional
renegotiations (I presume) during the logon phase which generates high
ascii into the log. See below.

The perl program terminates somewhere in these points.

I found a package, Text::Striphigh, but when I couldn't untar it,
started looking at other solutions. I tried reading in all the data, and
if the line length was > 75 characters, deleted the line, but again, the
program terminated at some point, although some of the high acsii lines
were deleted before termination.  

It seems to me that there is a high ascii character sequence which zaps
the perl I have on Windows. I can manually edit out all the high ascii
stuff, and the program works as normal. 

Two questions.

Is it possible for a high ascii character sequence to kill of a perl
program?

If not, what other reasons could cause the program to terminate? 


TIA

Owen
 
It is most likely that this typical modem log entry wont come out
faithfully as my news poster cannot cope with some of the characters 

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

09-13-1999 04:19:22.62 - Interpreted response: Informative
·············································································································································································································································································································································
····························································ìT85ŒX<aÆ(ÉŠs/°fF,óUeЕOá"å§E&CH 
T/Òß4õwÃúñå7åÑÃäǶfénåãÔí¨ä1·î—¤có¼ÝVõmÑ=F‡òýšr§QaÒÉXc
µê‹09-13-1999 04:19:23.63 - Recv: SQ:031 LL:025<cr><lf><cr><lf>CONNECT
28800<cr>
09-13-1999 04:19:23.63 - WARNING: Unrecognized response.  Retrying...
09-13-1999 04:19:23.63 - Connection established at 28800bps.
09-13-1999 04:19:23.63 - Error-control on.
09-13-1999 04:19:23.63 - Data compression on.
7 šl¤û&ƒV§Q“žøÈ¡G—›jŸ’0ˆNŸ—\õpé™ó…—™p5/!¨A#^†Ø6ëR2
æ¿õèòDÌ•,J‚xAÁY™Qkd¤›
âΘ7¸È¤
õÜ«lå–é·S
€¹sEZ9rÅ
HÃ^QKSN•&ƒÝÚ´âÅ.waý›Ž
锳Š#$¥¶„®D46ÓHõá‘G/~Ò¶lKÆ
Ä…*%‚`“0#K

---------------------------------------------------------------
and the program that reads line by line, and deletes lines > 75 is

while (<MODEMDATA>) {
$in=$_;
#$in=~s/·//g;
$l = length ($in);
if ($l > 75 ){$_=""}
print NEWMODEMDATA "$_\n";
}

and terminates here;

09-13-1999 04:19:23.63 - Data compression on.

7 šl¤û&ƒV§Q“žøÈ¡G—›jŸ’0ˆNŸ—\õpé™ó…—™p5/!¨A#



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

Date: Sat, 25 Sep 1999 05:14:38 GMT
From: nileshnimkar@my-deja.com
Subject: Re: Pie and Bar Charts?
Message-Id: <7shlnm$ads$1@nnrp1.deja.com>

In article <O5UG3.22$1F3.4043@news.goodnet.com>,
  burt@ici.net (Burt lewis) wrote:
> OK, I have gd-1.7.1 in a Unix dirictory of my cgi-bin area.
>
> It has over 50 files like gd.c, gdio.h, etc. I'm not the
administartor, how do I get the GD.PM library out of
> this?
>
> Appreciate any help.
>
>

This is NOT the GD.pm library. This will only build the C library for
you. You will have to get GD.pm seperately which will allow you to
interface this C library thru perl.
Also if you plan to plot graphs check out the CHART library. Avaliable
at CPAN.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sat, 25 Sep 1999 07:06:12 GMT
From: "SHC" <sunfox@home.com>
Subject: Re: Regex & URL parsing...
Message-Id: <Ev_G3.3627$5t2.80580@news1.rdc1.bc.home.com>

Kragen Sitaker wrote in message
<0XDG3.7655$QJ.490239@typ11.nn.bcandid.com>...

<SNIP>

>So here's a program that slurps tails like you said.  (Sorry about the
>truly inane sample text.)
>
>#!/usr/bin/perl -w
>use strict;
>$_ = 'this is a re-mark/able.experience.isn\'t.it?' . "\n" .
> 'how?bad?can?this.get...pal? wadda ya think?';
>print "$&\n" while m{ (?: [^\s<!.,?] | [!.,?] [^<\s!.,?] )+ }gx;


<SNIP>

Hmm, seems to work. This is the code I'm working with:

$text =~ s {((http://|www\.)(?: [^\s<>!.,?] | [!.,?] [^<>\s!.,?] )+)} {<A
HREF="$1">$1</A>}xg;

Now, do you know of a way to get it to IGNORE the replacement if the string
ends with, say </A> (meaning it's already hotlinked)? This is my first
experience working with regex's.

SHC




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

Date: Sat, 25 Sep 1999 05:22:11 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: remove the html tag in the file
Message-Id: <7_YG3.821$ru1.68336@typ11.nn.bcandid.com>

In article <EVRG3.18678$m4.75164111@news.magma.ca>,
Samuel Kilchenmann <skilchen@swissonline.ch> wrote:
>You may want to use a more appropriate tool than Perl for things like
>that
>(see http://www.rebol.com):
>One of their example scripts (slightly modified):
>
>REBOL [
>    Title: "Web HTML Tag Extractor"
>    File:  %websplit.r
>    Date:  20-May-1999
>    Purpose: "Separate the HTML tags from the body text of a document."
>]
>
>tags: make block! 100
>text: make string! 8000
>html-code: [
>    copy tag ["<" thru ">"] (append tags tag) |
>    copy txt to "<" (append text txt)
>]

Does this fail if the input document is 12 kilobytes?  What does the
'8000' mean?  And what happens if the last character of the input file
is '<'?  Does the '|' mean, "if the first copy fails, try the second one"?

REBOL looks like a fun language; I'd probably download it if it were
free.  (Yes, I know I don't have to pay for it.)
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 24 Sep 1999 21:54:02 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: remove the html tag in the file
Message-Id: <7sgrtq$amg$1@gellyfish.btinternet.com>

On Fri, 24 Sep 1999 21:19:32 GMT Samuel Kilchenmann wrote:
> turboman <turboman34@hotmail.com> wrote in:
> news:7sgfib$t84$1@winter.news.rcn.net
> 
>> Is anyone know how can I use perl to remove all the HTML TAGs in
>> the html file. Thanks.
>>
> You may want to use a more appropriate tool than Perl for things like
> that
> (see http://www.rebol.com):
> One of their example scripts (slightly modified):
> 

Ho Ho Ho.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 25 Sep 1999 01:52:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: sort depth
Message-Id: <slrn7uose1.faj.abigail@alexandra.delanet.com>

Uri Guttman (uri@sysarch.com) wrote on MMCCXIII September MCMXCIII in
<URL:news:x7u2om4m9f.fsf@home.sysarch.com>:
?? >>>>> "KS" == Kragen Sitaker <kragen@dnaco.net> writes:
?? 
??   KS> Lexicographic sorting will, indeed, sort "2000" ahead of "300".
??   KS> However, it will sort " 300" ahead of "2000".  This is why
??   KS> right-justifying numeric fields is a Good Thing.
?? 
?? better to zero pad on the left than to right justify. make more sense as
?? you could do numeric or string compares as desired. assuming blank sorts
?? below digits works but is not nice.


And neither will work well when - or + might be present. Doing string
comparison on numbers is generally a bad idea.



Abigail
-- 
               split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_)  {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


  -----------== 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, 25 Sep 1999 07:23:19 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: sort depth
Message-Id: <HL_G3.870$ru1.81759@typ11.nn.bcandid.com>

In article <slrn7uose1.faj.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>Uri Guttman (uri@sysarch.com) wrote on MMCCXIII September MCMXCIII in
><URL:news:x7u2om4m9f.fsf@home.sysarch.com>:
>?? >>>>> "KS" == Kragen Sitaker <kragen@dnaco.net> writes:
>?? 
>??   KS> Lexicographic sorting will, indeed, sort "2000" ahead of "300".
>??   KS> However, it will sort " 300" ahead of "2000".  This is why
>??   KS> right-justifying numeric fields is a Good Thing.
>?? 
>?? better to zero pad on the left than to right justify. make more sense as
>?? you could do numeric or string compares as desired. assuming blank sorts
>?? below digits works but is not nice.
>
>And neither will work well when - or + might be present. Doing string
>comparison on numbers is generally a bad idea.

Well, ten's-complement might be a solution, err, ugly kludge.  How do
*you* suggest sorting possibly-negative 23-digit numbers?
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 25 Sep 1999 00:58:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Strict?
Message-Id: <slrn7uop8p.faj.abigail@alexandra.delanet.com>

Ala Qumsieh (aqumsieh@matrox.com) wrote on MMCCXV September MCMXCIII in
<URL:news:x3yd7v8w4vm.fsf@tigre.matrox.com>:
 .. 
 .. Juse a minor clarification. When using strict, you *have* to declare
 .. all your variables as lexical using my(). The only variables you are
 .. allowed to local()ize are Perl's special global variables. But you
 .. don't have to declare those to use them.


Does that mean "$main::foo" is a Perl special global variable?

    $ perl -wle 'use strict; $main::foo = "Hello, world"; print $main::foo'
    Hello, world
    $


Abigail
-- 
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ++ $_'


  -----------== 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: 25 Sep 1999 01:59:37 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: toLowercase??
Message-Id: <slrn7uosr5.faj.abigail@alexandra.delanet.com>

Thomas Fischer (tfischer@deakin.edu.au) wrote on MMCCXIV September
MCMXCIII in <URL:news:37ea2133.28232656@news.deakin.edu.au>:
`` How can I convert a mixedcase string to 100% lowercase with perl?


     $ perl -l
     $_ = "mIxEDcaSe";
     @&{A..Z} = a..z;
     s/./$&{$&}||$&/ge;
     print;
     __END__
     mixedcase



HTH. HAND.



Abigail
-- 
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'


  -----------== 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, 25 Sep 1999 01:13:08 -0700
From: rommelhere <rommelhereNOroSPAM@YAHOO.COM.invalid>
Subject: WEB  server in Pearl
Message-Id: <164c000c.f00d98d1@usw-ex0108-059.remarq.com>

Hello All,
I'm a perl newbie. i have to write a Webserver in perl.

Please suggest resources\modules and  possible approach i
should take.

Any help will be greatly appreciated,
regards,

rommel



* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: 25 Sep 1999 00:42:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: You should be admired
Message-Id: <slrn7uoob5.faj.abigail@alexandra.delanet.com>

Kent Perrier (kperrier@blkbox.com) wrote on MMCCXIV September MCMXCIII in
<URL:news:07D5F91C223384A9.F50F7DD1F6BE7C8E.62E89B43770FD0CD@lp.airnews.net>:
__ spamfree@metropolis.net.au (Henry Penninkilampi) writes:
__ 
__ > Tell me, Abigail, how does a petulant child gain respect in life?  I'm
__ > wondering if you know - you seem to be an authority on the subject.
__ 
__ Unfortunately, he/she/it will never see your reply as the *plonk* 
__ indicates that she kill filed you.

Well, yes. But there might be exceptions.... [1]

I've *smart* kill files.... ;-)


[1] deja.com can tell you about them.


Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== 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, 25 Sep 1999 19:18:08 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: You should be admired
Message-Id: <spamfree-2509991918080001@d6.metropolis.net.au>

In article <slrn7uolme.faj.abigail@alexandra.delanet.com>,
abigail@delanet.com wrote:

> "" Has anyone ever considered CFDing [comp.lang.perl.worthy] and (veteran
> "" Perl users) moving serious discussions to that group?
> 
> Have you ever read this group? Your suggestion is being made, oh, 
> about 50 times a year.


:^)  good to see you back  :^)

My approach to clmp is to skim the article subject lines and only read the
threads that sound interesting.

I can't remember *ever* seeing a subject line with CFD in it, and none of
the threads I have been involved in have ever brought the subject up
either.  This was the first.

So, I've been actively 'reading' this group for about two years and this
is the first time I've ever stumbled across the issue.  Either I have been
amazingly un/lucky, or the threads that discuss the issue don't have
interesting subject lines (to me, that is), or you are exaggerating the
frequency.

You tell me.

In any case, if such a suggestion *is* being made about 50 times a year,
then that sounds like an *awful lot of people* who want to change the way
this group works.  Rather than constantly defending the status quo, have
you ever *seriously* contemplated just letting 'them' have their way?

No matter how much you help, no matter how much you know, no matter how
hard you try, no matter how much time you spend, you can't withstand the
flood forever.  Eventually you'll burn out and get swamped.  A short fuse
is evidence that you are already on your way.

Hey, it's your call.  It's your time.  It's also your health.  Do what you will.

Henry.

PS:  There's a Chinese saying that goes something like "rocks placed at
the side of a river can channel it's flow, but rocks placed in the middle
of a river are merely worn into pebbles."  A wise people, the Chinese.


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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


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