[13493] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 903 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 24 20:07:21 1999

Date: Fri, 24 Sep 1999 17: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: <938217909-v9-i903@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 24 Sep 1999     Volume: 9 Number: 903

Today's topics:
    Re: A better way to exclude a phrase in a PATTERN? (Eric Smith)
        can I do this easier? <cipofuzo@hotmail.com>
    Re: Case insensitive SQL query mrbog@my-deja.com
    Re: Case insensitive SQL query <uri@sysarch.com>
    Re: CGI sending email with attachment (Earl Hood)
    Re: challenge results <srooij@wins.uva.nl>
    Re: How to print file in two columns ? <tchrist@mox.perl.com>
    Re: How to split one variable into two? (Tal Yarkoni)
    Re: Interesting behavior of IO::Handle - bug? <brundlefly76@hotmail.com>
    Re: Is there an XML Sax module ? jeffnor@hollow.org
    Re: keys() and/or values() in %hash{x}{y}{z} <sariq@texas.net>
        Perl Win32::OLE with Lotus Notes <huynh@masfsun1.rsc.ray.com>
        Pie and Bar Charts? (Burt lewis)
    Re: Pie and Bar Charts? (Burt lewis)
    Re: Q on DB_File (Dan Wilga)
    Re: remove the html tag in the file <skilchen@swissonline.ch>
    Re: REQ: tell-a-friend script <flavell@mail.cern.ch>
    Re: REQ: tell-a-friend script <sjs@yorku.ca>
    Re: Spell Checker In Perl (Greg Snow)
        Still RPC/Taint problems <rockie@apk.net>
    Re: Strict? <tchrist@mox.perl.com>
    Re: Strict? <madebeer@igc.apc.org>
    Re: Unix password parser <madebeer@igc.apc.org>
        USENIX Windows Systems Symposium Call for Papers (Moun Chau)
    Re: using System function to run other programs (Larry Rosler)
    Re: WebTV and Perl CGI <flavell@mail.cern.ch>
    Re: Who is Matt Wright and Why is He Dangerous? <cassell@mail.cor.epa.gov>
    Re: You should be admired, or What does this have to do <flavell@mail.cern.ch>
    Re: You should be admired, or What does this have to do <AgitatorsBand@yahoo.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 24 Sep 1999 22:01:38 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: Re: A better way to exclude a phrase in a PATTERN?
Message-Id: <slrn7unt62.b2g.eric@plum.fruitcom.com>

Kragen

You have reconfirmed my convictions - 
it just looked a bit strange for perl to handle something like this as
clumsily as explained in the Camel book.

I am real happy with this.

thanx

kragen@dnaco.net (Kragen Sitaker) posted in comp.lang.perl.misc 
 > In article <slrn7un2s6.72r.eric@plum.fruitcom.com>,
 > Eric Smith <eric@fruitcom.com> wrote:
 > >Is there an easier way, perhaps?
 > 
 > You want lookbehind.  It has been added to recent perls, with the
 > hideous syntax of (?<=pattern).  HTH.
 > -- 
 > <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>


-- 
Eric Smith
eric@fruitcom.com
www.fruitcom.com

Byte perfect with perl. 


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

Date: Fri, 24 Sep 1999 16:47:57 -0700
From: "Cipo Fuzo" <cipofuzo@hotmail.com>
Subject: can I do this easier?
Message-Id: <7sh2ju$bo1$1@paxfeed.eni.net>

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.





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

Date: Fri, 24 Sep 1999 22:27:31 GMT
From: mrbog@my-deja.com
Subject: Re: Case insensitive SQL query
Message-Id: <7sgts8$qf4$1@nnrp1.deja.com>



> you are tangentially related to pond scum. and to elephant shit. and
to
> mars rocks. and to pustules. should we keep talking about you and
those
> topics too? why not, there are no rules here, it is the internet.
>
> mrbog is full of elephant shit and has a large pustule full of pond
scum
> and has mars rocks in his head.

Well, it's good to see you're acting mature when people disagree with
you.




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


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

Date: 24 Sep 1999 19:21:37 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Case insensitive SQL query
Message-Id: <x7g1033nge.fsf@home.sysarch.com>

>>>>> "m" == mrbog  <mrbog@my-deja.com> writes:

  >> you are tangentially related to pond scum. and to elephant shit. and
  m> to
  >> mars rocks. and to pustules. should we keep talking about you and
  m> those
  >> topics too? why not, there are no rules here, it is the internet.
  >> 
  >> mrbog is full of elephant shit and has a large pustule full of pond
  m> scum
  >> and has mars rocks in his head.

  m> Well, it's good to see you're acting mature when people disagree with
  m> you.

hey shit for brains, i act mature when it is warranted. you didn't post
properly here after many attempts to educate you. i waited patiently
until you might see the light. that never happened. the only light is
going from one of your ears to the other. so i had to get your attention
which seemed to work.

and my post was also full of sarcasm as it demonstrate how off topic
posts are not welcome. but you are too dense to get that either and you
responded which wasn't even asked for or necessary. so here i am trying
to educate you again. i might as well send stuff about business ethics
to bill gates as to try to educate you about usenet netiquette.

don't reply. i have no need to read your blather.

*Plonk*

my true first actual plonk of an asshole. i never did this to reese, the
dummy from nz or bottommind. this shows how low you have crawled in my
book.

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: 24 Sep 1999 22:36:06 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: CGI sending email with attachment
Message-Id: <7sgucm$125@news.service.uci.edu>

In article <37EBDF08.49A8E286@mail.cor.epa.gov>,
David Cassell  <cassell@mail.cor.epa.gov> wrote:

>> You missed the '--' needed to tell it that's the last boundary. Not sure
>> if it's strictly necessary but I always add it. You never know when you

It is required.

>> might want to toss the whole multipart into another multipart and I think
>> it is essential then.
>
>That's feasible, and certainly legal according to the RFC.  But
>I would recommend avoiding shoving a multipart inside another
>multipart.  Many of the mail readers it has been my misfortune
>to encounter will not handle this situation correctly.

This is pathetic.  I've had Perl code back in version 4 days that
handled arbitrarily nested multipart messages, and we still have
"modern" (PC) MUAs that cannot do it properly (btw, there is other old
open source code that handled nested multiparts also).

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: Sat, 25 Sep 1999 00:15:53 +0200
From: Steven de Rooij <srooij@wins.uva.nl>
Subject: Re: challenge results
Message-Id: <37EBF819.3BD44927@wins.uva.nl>

Atmittedly, not very readable :-)
I posed the challenge. I'll send you the program I started out with
together with the necessary comments.
Check your email.

Hi, 
Steven


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

Date: 24 Sep 1999 15:15:07 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to print file in two columns ?
Message-Id: <37ebe9db@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    tvn007@my-deja.com writes:
:Would someone give me some hints how to "reprocess"
:this file so that I can print the output in
:two columns ?

    % pr -2  regular_text
or
    % mpage -2 postscript_text

--tom
-- 
    Some are born to perl, some achieve perl, and some have perl
    thrust upon them.  


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

Date: 24 Sep 1999 21:54:58 GMT
From: tyarkoni@chat.carleton.ca (Tal Yarkoni)
Subject: Re: How to split one variable into two?
Message-Id: <7sgrvi$j2h$1@bertrand.ccs.carleton.ca>

Ok, I think I get it. Thanks for the lucid response (i.e. one I could
actually understand) :)

Tal


> What you are trying to do is called symbolic referencing. I would
> avoid this if I were you since it can get very confusing very easily.
> What you really need to use is a slightly more complicated data
> structure: a hash of arrays (see perldsc for more info on Perl's way
> of creating complex data structures).

> So, for every variable $x, you would do something like:

> 	$hash{$x}[0] = 'a';
> 	$hash{$x}[1] = 'b';

> The above says that you have a hash (%hash), with key $x. The value
> associated with the key $x is an array reference. The first element of
> this array is set to 'a', the second to 'b'.

> So, effectively, instead of you saying $test1, you would say
> $hash{test}[1].

> HTH,
> --Ala




----------------------------------------------------------------------
http://chat.carleton.ca/~tyarkoni/             tal@digitalprose.com


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

Date: Fri, 24 Sep 1999 23:49:06 GMT
From: Brundle <brundlefly76@hotmail.com>
Subject: Re: Interesting behavior of IO::Handle - bug?
Message-Id: <7sh2le$to6$1@nnrp1.deja.com>

In article <e_LG3.28297$I6.478103@typ12.nn.bcandid.com>,
  kragen@dnaco.net (Kragen Sitaker) wrote:
> In article <7sfub6$1pn$1@nnrp1.deja.com>,
> Brundle  <brundlefly76@hotmail.com> wrote:
> >In article <x7ln9z5x8t.fsf@home.sysarch.com>,
> >  Uri Guttman <uri@sysarch.com> wrote:
> >> if you are going to be the top poster here, at least learn to
research
> >> basic things yourself. the filehandle object after print and printf
> >must
> >> be a real filehandle or a single scalar variable with a file handle
> >> value
> >
> >In the both examples $PIPES[$CURRENTPIPE] *IS* a single scalar
variable
> >with a filehandle value.
>
> No, it's an array element.  A scalar variable is something like $asdf.

Since they both exclusively hold a scalar value, what's the
significance when using either in the same context?


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


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

Date: Fri, 24 Sep 1999 23:41:27 GMT
From: jeffnor@hollow.org
Subject: Re: Is there an XML Sax module ?
Message-Id: <H_TG3.127$L85.17639@ptah.visi.com>

John Robson <as646@freenet.carleton.ca> wrote:

> I found the XML::Parser and XML::DOM modules, but I couldn't find an XML
> Sax module.  Sax is an alternative API to DOM.  Is there a Sax module, or
> has anyone created one yet ?

Checkout XML::Parser::PerlSAX

-- 
  ...........................................................
  .  Jeff Norusis                                           .
  .  jeffnor@hollow.org      http://www.hollow.org/~jeffnor .
  ...........................................................


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

Date: Fri, 24 Sep 1999 16:52:07 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: keys() and/or values() in %hash{x}{y}{z}
Message-Id: <37EBF287.FE231C1D@texas.net>

Deviant Freak wrote:
> 
> I've torn apart the manpages and every Perl book in sight and can't
> seem to find an answer to this one.
> 
> I have a multidimensional %hash kinda like this (+/- 200k records, and
> about):
> 
> $hash{'record 1'}{'name'} = 'John Doe'
> $hash{'record 1'}{'city'} = 'San Francisco'
> $hash{'record 1'}{'state'} = 'CA'
> $hash{'record 1'}{'kids'} = [ 'Johnny:5', 'Mary:3', 'Baby:1' ]
> 
> $hash{'record 2'}{'name'} = 'Jane Smith'
> $hash{'record 2'}{'city'} = 'Albany'
> $hash{'record 2'}{'state'} = 'NY'
> $hash{'record 2'}{'pets'} = [ 'Rover:dog' ]
> $hash{'record 2'}{'hobbies'} = [ 'skiing', 'diving' ]
> 
> Note: Not all records have the same fields, and some fields contain
> lists, and the number of items in the list varies.
> 
> Problems to solve:

<snipped list of problems>

You must have missed:

perldoc perldsc

After you've read it, feel free to come back.

HTH.

- Tom


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

Date: Fri, 24 Sep 1999 10:48:44 -0400
From: Khanh Huynh <huynh@masfsun1.rsc.ray.com>
Subject: Perl Win32::OLE with Lotus Notes
Message-Id: <37EB8F4C.5DB51B57@masfsun1.rsc.ray.com>


--------------D0D81A2490CD573EE98A5DD4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hello Perl Experts,
I have to write a small script in Perl use Win32::OLE integrate  with
Lotus Notes, and I have a lot problems to make it
works . I need advises from your guys because I don't know Notes before.
I think it must be very easy for you, but me. I
don't know the structure of the Notes database or the AddressBooks.
1) The problem.
   I would like to get all the names of certain groups members in the
AddressBook
2) My code (in Perl).

  use strict;
  use Win32::OLE;
  my $Session = Win32::OLE->New('Notes.NotesSession')
          or die "Cannot start Lotus Notes Session Object.\n";
  my $Database = $Session->GetDatabase("", "names.nsf")
          or die "Could not open database.\n";
  my $doc = $Session->NotesDocument;
  my $view= $Session->NotesView;
  my $book = $Database->AddressBooks;
  foreach my $this_book (@$book){
        printf "Title %s", $this_book->Title;
        my $open = $this_book->Open(" ", "");
        my $view = $this_book->GetView('Groups');
        my $name= $this_book->GetFirstDocument;
        printf "Groups %s \n", $name;
        my $Values = $this_book->GetItemValue('Memmber');
        printf " Name %s\n", $Values;
}

3) The output.
       Title   RTS Name and Address Book
        Groups
        Name
        .....
        .....
Please help me how to get full name of members of a groups in Lotus
Notes AddressBooks since I don't know Notes.
Thank you so much for your help in advanced.

Khanh,


--

                               \VVVVV/
                              \/ . . \/
+----------------------------o0O--O--O0o-----------------------------------+
|--------------------------------------------------------------------------|
|                                                                          |
|                          Khanh T. Huynh                                  |
|                                                                          |
| Raytheon Service Company               E-Mail: khanh_huynh@raytheon.com  |
| 8000 Midlantic Dr.                     Phone : (609) 778-1717            |
| Suite 201 North           .oooO        Raycom:  344-1717                 |
| Mt Laurel, NJ 08054       (   )   Oooo.Fax   : (609) 778-8665            |
+____________________________\ (____(   )__________________________________+
                              \_)    ) /
                                    (_/



--------------D0D81A2490CD573EE98A5DD4
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp;
<br>Hello Perl Experts,
<br>I have to write a small script in Perl use Win32::OLE integrate&nbsp;
with Lotus Notes, and I have a lot problems to make it
<br>works . I need advises from your guys because I don't know Notes before.
I think it must be very easy for you, but me. I
<br>don't know the structure of the Notes database or the AddressBooks.
<br>1) The problem.
<br>&nbsp;&nbsp; I would like to get all the names of certain groups members
in the AddressBook
<br>2) My code (in Perl).
<p>&nbsp; use strict;
<br>&nbsp; use Win32::OLE;
<br>&nbsp; my $Session = Win32::OLE->New('Notes.NotesSession')
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or die "Cannot
start Lotus Notes Session Object.\n";
<br>&nbsp; my $Database = $Session->GetDatabase("", "names.nsf")
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or die "Could
not open database.\n";
<br>&nbsp; my $doc = $Session->NotesDocument;
<br>&nbsp; my $view= $Session->NotesView;
<br>&nbsp; my $book = $Database->AddressBooks;
<br>&nbsp; foreach my $this_book (@$book){
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf "Title %s", $this_book->Title;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $open = $this_book->Open("
", "");
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $view = $this_book->GetView('Groups');
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $name= $this_book->GetFirstDocument;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf "Groups %s \n", $name;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my $Values = $this_book->GetItemValue('Memmber');
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf " Name %s\n", $Values;
<br>}
<p>3) The output.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Title&nbsp;&nbsp; RTS Name and
Address Book
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Groups
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .....
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .....
<br>Please help me how to get full name of members of a groups in Lotus
Notes AddressBooks since I don't know Notes.
<br>Thank you so much for your help in advanced.
<p>Khanh,
<br>&nbsp;
<pre>--&nbsp;
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \VVVVV/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/ . . \/
+----------------------------o0O--O--O0o-----------------------------------+
|--------------------------------------------------------------------------|
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Khanh T. Huynh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
| Raytheon Service Company&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; E-Mail: khanh_huynh@raytheon.com&nbsp; |
| 8000 Midlantic Dr.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Phone : (609) 778-1717&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
| Suite 201 North&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .oooO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Raycom:&nbsp; 344-1717&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
| Mt Laurel, NJ 08054&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&nbsp;&nbsp; )&nbsp;&nbsp; Oooo.Fax&nbsp;&nbsp; : (609) 778-8665&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
+____________________________\ (____(&nbsp;&nbsp; )__________________________________+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_)&nbsp;&nbsp;&nbsp; ) /
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (_/</pre>
&nbsp;</html>

--------------D0D81A2490CD573EE98A5DD4--



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

Date: Fri, 24 Sep 1999 22:03:41 GMT
From: burt@ici.net (Burt lewis)
Subject: Pie and Bar Charts?
Message-Id: <1zSG3.11$1F3.2154@news.goodnet.com>

Hi,

I would really like the ability to turn some numbers into Pie or Bar Charts on 
Unix Perl.

I have ActivePerl running also on A PC with a web server which I use for 
development.

Appreiciate it if someone can lead me in the direction while I continue to 
search out answers.

Thank you 

Burt Lewis
burt@ici.net



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

Date: Fri, 24 Sep 1999 23:49:02 GMT
From: burt@ici.net (Burt lewis)
Subject: Re: Pie and Bar Charts?
Message-Id: <O5UG3.22$1F3.4043@news.goodnet.com>

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.



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

Date: Fri, 24 Sep 1999 17:11:23 -0400
From: dwilgaREMOVE@mtholyoke.edu (Dan Wilga)
Subject: Re: Q on DB_File
Message-Id: <dwilgaREMOVE-2409991711230001@wilga.mtholyoke.edu>

In article <37e96655@news1.prserv.net>, "tavi" <tavi367@ibm.net> wrote:

> I have a small script that uses DB_File to maintain control over an array
> and kep it to disk.
> 
> This works just fine on my NT machine, but when I try and use it on my UNIX
> (SunOS 5.0.5) it doesn't quite work right.
> 
> The data is retrieved from the submitting web form.
> 
> DB_File creates the text file for the data.
> 
> The text file is empty.
> 
> The array the data should be stored in is empty.
> 
> The error and access logs tel me nothing.
> 
> Any ideas on what I should look for?

It's impossible to tell without a code snippet.

A guess would be that your open mode might be wrong. DB_File tends to be
very picky about this. I find that O_RDWR|O_CREAT works best when opening
a database for write, which may not already exist. Be sure to use a file
mask like 0600 or 0660 which allow the owner to write, too.

And be sure to check the return code:

tie(%hash, 'DB_File', $file, O_CREAT|O_RDWR, 0600,$DB_HASH) || die "Can't
open DB: $!";

Dan Wilga          dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply  **


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

Date: Fri, 24 Sep 1999 21:19:32 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: remove the html tag in the file
Message-Id: <EVRG3.18678$m4.75164111@news.magma.ca>

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):

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)
]
; if you don't need to accumulate the tags, use a slight modification
; html-code: [
;    ["<" thru ">"] |
;    copy txt to "<" (append text txt)
; ]

page: read http://host.dot.somewhere/desired/page.html
; or if you want to read from a local path use
; page: read %/path/to/desired/file.html
parse page [to "<" some html-code]
; you don't need the tags
; foreach tag tags [print tag]
print text
; or write to a file
; write %/path/to/textfile.txt text

The commented lines arr inserted or modified by me; the rest is a REBOL
example script.

The size of rebol.exe is ~ 170k and you don't need any additional
libraries neither for networking nor for parsing.







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

Date: Fri, 24 Sep 1999 23:39:30 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: REQ: tell-a-friend script
Message-Id: <Pine.HPP.3.95a.990924233811.10740I-100000@hpplus03.cern.ch>

On Fri, 24 Sep 1999, J. Moreno wrote:

> > :I didn't say it wasn't intentional, it's still a typo.
[...]
> And you need to learn to read without looking at the dictionary.

Have you really nothing more important to do than making a fool of
yourself in public?




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

Date: 24 Sep 1999 18:54:51 -0500
From: Steven Smolinski <sjs@yorku.ca>
Subject: Re: REQ: tell-a-friend script
Message-Id: <m3aeqbj25w.fsf@hank.yorku.ca>

planb@newsreaders.com (J. Moreno) writes:

> Steven Smolinski <sjs@yorku.ca> wrote:
 
>> planb@newsreaders.com (J. Moreno) writes:
 
>>> I didn't say it wasn't intentional, it's still a typo.
>> 
>> Now you're not even speaking English. 
>> 
>> That's not a star!  It's the sun!
> 
> Rather the reverse.
> 
> My exact statement was "Uhm, elsif may be correct perl, but it's still a
> typo".  Which I think is clear enough, it's what was chosen, but it was
> (IMO) a bad choice.

That's why you're not speaking English.  A typo is not a 'bad choice.'  
A typo is an incorrect letter typed *by mistake.*  Tom's simply showing
that the choice was *intentional* proves it is not a typo.

My typing elseif in my Perl scripts is a typo.  (And it does still happen.)

Steve


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

Date: 24 Sep 1999 21:57:02 GMT
From: snow@statsci.com (Greg Snow)
Subject: Re: Spell Checker In Perl
Message-Id: <7sgs3e$fp7$1@junior.statsci.com>

In article <37eb3608_2@newsread3.dircon.co.uk>,
Jonathan Stowe  <gellyfish@gellyfish.com> wrote:
>Mace <mace@calweb.com> wrote:
>> Here is a question for you.  I asked one of my very PERL smart friends if it
>> was possible to make a spell check in perl.  He said yes, but you needed
>> some kind of moduel.  Does anyone have this, know where I can get it, or how
>> to make a spell checker?  Please email me.
>> 
>
>In addition to the suggestion by Martien - you might see my post 
>
><http://www.deja.com/getdoc.xp?AN=484604049&fmt=text>
>
>Which might indicate a possible way to do this.
>

There are also 2 versions already implemented and available at:
http://language.perl.com/ppt/



-- 
-------------------------------------------------------------------------------
     Gregory L. Snow         |  Inertia makes the world go round,
     (Greg)                  |   Love makes the trip worth taking.
     snow@statsci.com        |


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

Date: Fri, 24 Sep 1999 18:39:22 -0300
From: "R. Brockway" <rockie@apk.net>
Subject: Still RPC/Taint problems
Message-Id: <37EBEF8A.EC8E7E65@apk.net>

I am having a very difficult time trying to figure out how I can either
get backtick'd commands or system calls to actually return with results
having been called from a server script, which in turn is running the
function via RPC from the client script. The problem is -T Taint mode
and the fact that we have external data. Without -T on the server side
script, everything is peachy. I attempted some un-tainting lines
(http://www.perl.com/pub/doc/manual/html/pod/perlsec.html) but the calls
to the system in the server code still don't return. I would rather not
run the client/server without -T. Do I have a choice here, given the
nature of external system information combined with a client/server RPC
model in -T mode?

thanks

-rockie

Here is some code:

SERVER:

collapse:18:33:51:/home/rockie/perl/usermod$ more server_ex.pl
#!/usr/bin/perl -wT
use 5.005;
use strict;

use IO::Socket();
use RPC::pServer;

$ENV{PATH} = "/bin:/usr/bin";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};

my $MY_APPLICATION = "User_Mod";
my $MY_VERSION = 1.0;

# Function get_user
sub get_user ($$@) {
        # take $username and grep from /etc/passwd
        my ($con, $ref, @args) = @_;
        my $username = shift @args;
        print "$username\n";
#       my $get_user = `/bin/grep $username /etc/passwd`;
        my $cmd = "/bin/grep $username /etc/passwd";
        print "before\n";
############# Doesn't return from this next line #################
        my $get_user = system "$cmd";
        print "after\n";
        print "$get_user\n";
        (1, $get_user);
}

# Function quit
sub quit ($$) {
        my($con, $ref) = @_;
        my ($runRef) = $ref->{'running'};
        $$runRef = 0;
        (1, "Bye!");
}

# Function server
sub server ($) {
        # process client requests, set up function table
        my ($con) = shift;
        my %funcTable;
        my ($running) = 1;

        # Create function table
        %funcTable = (
          get_user              => { code => \&get_user },
          quit                  => { code => \&quit,
                                        data => \$running },
        );

        $con->{'funcTable'} = \%funcTable;
        while ($running) {
          if (!$con->Loop()) {
            $con->Log('err', "Exiting\n");
            exit 10;
          }
        }
        $con->Log('notice', "Client quits.\n");
        exit 0;
}

# Main

{
my $sock = IO::Socket::INET->new('Proto' => 'tcp',
                        'Listen' => 3,
                        'LocalPort' => 13000
                        );

if (!defined($sock)) {
        die "Could not bind to port: $!\n";
}

while (1) {
        # add configFile to this next line eventually
        my $con = new RPC::pServer('sock' => $sock);
        if (!ref($con)) {
                die "Cannot Create Server!: $con\n";
        } else {
                if ($con->{'application'} ne $MY_APPLICATION) {
                        $con->Deny("This is a USER_MOD Server, Go
Away");
                } elsif ($con->{'version'} > $MY_VERSION) {
                        $con->Deny("Sorry, but this is version
$MY_VERSION");
                } else {
                        # OK, accept the client, spawn child
                        my $pid = fork();
                        if (!defined($pid)) {
                                $con->Deny("Cannot fork: $!");
                        } elsif ($pid == 0) {
                                $con->Accept("Your Client is Accepted");

                                &server($con);
                        }
                }
        }
}


CLIENT:

#!/usr/bin/perl -wT
use 5.005;
use strict;

use IO::Socket();
use RPC::pClient;

$ENV{PATH} = "/bin:/usr/bin";
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};

# Constants
my $MY_APPLICATION = "User_Mod";
my $MY_VERSION = 1.0;

my $username = "rockie";

# Connect to server
my $sock = IO::Socket::INET->new('PeerAddr' => 'my.box.net',
                                                'PeerPort' => 13000,
                                                'Proto' => 'tcp');
if (!defined($sock)) {
        die "Cannot connect: $!\n";
}

#Login Procedure
my $client = RPC::pClient->new('sock' => $sock,
                                'application' => $MY_APPLICATION,
                                'version' => $MY_VERSION);

if (!ref($client)) {
        die "Cannot create client: $client\n";
}

# Call remote function (get_user)

my @a = $client->Call("get_user", $username);
if ($client->error) {
        die "An error occured : $!\n";
} else {
        my $element;
        foreach $element (@a) {
                print "$element\n";
        }
}



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

Date: 24 Sep 1999 15:07:54 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Strict?
Message-Id: <37ebe82a@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Ala Qumsieh <aqumsieh@matrox.com> writes:
:"Rasmus Rimestad" <rasmusr@online.no> writes:
:
:> When you are using strict, you will have to declare all variables
:> using my or local. 
:
:Juse a minor clarification. When using strict, you *have* to declare
:all your variables as lexical using my(). 

That's not right.

--tom
-- 
"Most Non-Unix managers conclude that VI is either extraterrestrial
in origin or was devised by the original Unix developers as part of a
secret communication s code to reach another dimension."
    --Communications Week - July 26, 1993.


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

Date: Fri, 24 Sep 1999 12:02:44 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Strict?
Message-Id: <APC&1'0'50775dc0'0ac@igc.apc.org>

If you don't know what a module does, first check the docs on that module.

perldoc strict

-Michael


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

Date: Fri, 24 Sep 1999 11:47:30 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Unix password parser
Message-Id: <APC&1'0'50775dbf'bde@igc.apc.org>

http://www.ja.net/CERT/Software/anlpasswd/  # .pl, based Larry Wall's code

Also, check out npasswd, written in C.

-Mike



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

Date: Fri, 24 Sep 1999 23:26:34 GMT
From: moun@usenix.org (Moun Chau)
Subject: USENIX Windows Systems Symposium Call for Papers
Message-Id: <FIL7sA.1zz@usenix.org>
Keywords: Windows, Windows 95, Windows 98, NT, System Administration, IT, Technical Conference, OS, Operating System, Networking, technical classes, Security, functionality, infrastructure, applications, configuration, maintenance, Development, integration, hardware, software, servers, USENIX, SAGE, UNIX, symposium, conference, Training, tutorials, refereed papers, research, network management, tools, homogeneous networks, NT Integration, PC, heterogeneous environments, Samba servers, licensing, engineering, authentication, debugging, tuning, benchmarking, Remote management, distributed services, firewall, fixes, Backups, restores, Manageability, Performance, scalability, Networking, Win32

4TH USENIX WINDOWS SYSTEMS SYMPOSIUM
(formerly the USENIX Windows NT Symposium)
August 3 - 4, 2000
Madison Renaissance Hotel
Seattle, Washington, USA
http://www.usenix.org/events/usenix-win2000

WINDOWS PROFESSIONALS: The USENIX Windows Systems Symposium is the
opportunity to connect with peers and experts on the issues and real
time solutions surrounding the maintenance and development of the
Windows platform.

We are currently seeking submissions for Technical White Papers,
tutorial sessions, and abstracts that demonstrate and discuss the
various techniques and innovations utilized in working Windows
environments. Suggested topics include but are not limited to:
development and deployment of mission critical applications in the
Windows infrastructure, scalability, the models/tools/strategies used to
manage large-scale Windows or mixed networks, devises and embedded
systems, user interfaces, Windows utilities, security, and programming.

Please see the detailed submission guidelines for more information. 


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

Date: Fri, 24 Sep 1999 14:31:54 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: using System function to run other programs
Message-Id: <MPG.12558da51e86923989fd7@nntp.hpl.hp.com>

In article <37EBE07A.F7EDA417@mail.cor.epa.gov> on Fri, 24 Sep 1999 
13:35:06 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
 ...
> system("whatever" "goes" "here") && die "system failed: $?\n";
> 
> or
> 
> system("whatever" "goes" "here") == 0 or die "system failed: $?\n";

There should undoubtedly be commas between those strings.

> I prefer the first form, the notorious "Rosler Idiom".  :-)

Well, OK, but that's not it.  I would use 'and' instead of '&&' in that 
statement, to signal a change of control flow instead of just a logical 
consequence.

The idiom is more like this:

  my $replace_value = $value && 'replacement';

or

  $value &&= 'replacement';

That is, if $value is TRUE, replace it with 'replacement'; otherwise 
retain the FALSE value of $value.  For example,

  print "$n marble", $n != 1 && 's', "\n";

instead of this Golf loser:

  print "$n marble", $n != 1 ? 's' : "", "\n";

because the FALSE value '$n != 1' in this case is a null string.

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


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

Date: Fri, 24 Sep 1999 23:35:16 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: WebTV and Perl CGI
Message-Id: <Pine.HPP.3.95a.990924232604.10740H-100000@hpplus03.cern.ch>

On 24 Sep 1999, developer wrote:

> The preview cgi, formats the body of the email (including newlines) to a
> variable and includes that as part of a POST method call.
 ..
> It works great....in IE or Netscape, but in WebTV all the newlines are
> missing and the body appears as a single run-on string when the email is
> received.

Maybe the user didn't insert any newlines?

If WebTV Viewer is a proper simulation of their real thing, then it
seems to me that it _does_ send newlines that were inserted by the user,
but the virtual linebreaks that it inserts into text areas for itself
when they reach the right-hand end of the window are not transmitted.
Which seems reasonable, from one point of view, even if it results in
"what they see" differing from what they get.

I haven't tried any of the NS/MS "wrap" extensions, though.  This was
with a plain, standard, TEXTAREA.  You _do_ have the WebTV viewer
yourself, yes?  Free download from developer.webtv.com  (IIRC).

good luck.  This isn't a Perl question, you know (f'ups set).




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

Date: Fri, 24 Sep 1999 14:08:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Who is Matt Wright and Why is He Dangerous?
Message-Id: <37EBE831.DBFA1B29@mail.cor.epa.gov>

Jeff S. wrote:
> 
> Lotsa stuff about bad scripting, y2k bugs, general scripting errors, and
> dangerous "script kiddies" appear all the time in this (and other
> similar) newsgroup. "Matt Wright" appears invariably in one of those
> type of threads. Now without trolling, i ask, who is he, why is he
> dangerous, what can be done (or has anything been) to stop him?

Kragen and Ethan already provided good answers.  But here's 
some insight.  Matt Wright wrote these scripts when he was
about 14 and still learning Perl.  I wouldn't want everyone
in the world to see the kludgy stuff I wrote when I was 14 and
just learning a programming language.  But his stuff is omni-
present on the web.  So he isn't dangerous.  What is dangerous
is the common belief amongst non-programmers that any script 
found on the web must be okay.  Now that his scripts have
metastatized all over the web, there is nothing that can be
done to stop *him*.  However, on 01/01/2000 a few people will
find out the embarrassing way that scripts lifted off the web
are worth every penny they paid for them.  :-)

>   I am a beginning programmer who does not want to fall prey to
> dangerous bugs or mistakes. I often look for scripts  on the internet to
> learn from and use. How the heck am i s'posed to be able to tell a
> "script kiddie" from JAPH?

Ethan gave some good suggestions here.  But there is really
no way for the novice to know the difference between a great
but complex program by Tom Christiansen, and a hideous kludge
of a script by J. Random Luser, until they know enough Perl
to be able to recognize good perlstyle and good coding when
they see it.  When I started out learning Perl, I just believed 
whatever Randal Schwartz and Tom Christiansen and Larry Wall 
[and a few others] said, and trusted they wouldn't lead me 
too far astray.

> anyways, i suppose these questions can be responded to in any way; maybe
> I *am* just trolling.

How could a nice Jewish boy like you be a troll?  :-)

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


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

Date: Fri, 24 Sep 1999 23:21:10 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: You should be admired, or What does this have to do with Perl?
Message-Id: <Pine.HPP.3.95a.990924231900.10740G-100000@hpplus03.cern.ch>

On Fri, 24 Sep 1999, David Cassell wrote:

> but now and then I give what I
> think is a helpful answer, and get flamed.  For what, I'm not
> quite sure.  Perhaps not spoon-feeding sufficiently.

The sure-fire test is to hint that you thought you were spoon-feeding
them.  If it brings a torrent of obscenities, then you know that you
were right. 

all the best.



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

Date: Fri, 24 Sep 1999 22:26:53 GMT
From: Scratchie <AgitatorsBand@yahoo.com>
Subject: Re: You should be admired, or What does this have to do with Perl?
Message-Id: <NUSG3.123$oy2.21236@news.shore.net>

David Cassell <cassell@mail.cor.epa.gov> wrote:
: a week.  There are not enough regular posters to deal with all
: of this trayf unless someone [or a squadron of someones] insists
: on making others adhere to the newsgroup charter, by means
: fair or foul.

Complete and utter bullshit. The solution to noise (newbie questions) is
not more noise (condescending put-downs, usually after someone else has
already posted "Look in the FAQ"). The "We've got to be nasty so these
ignorant newbies will learn how to behave" argument is a total sham, since
ignorant newbies, by definition, will not have been reading the group and
will not have been exposed to the edifying effects of Abigail's and Tom
C's insults.

--Art

-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

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


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