[10406] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3999 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 17 20:02:04 1998

Date: Sat, 17 Oct 98 17:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 17 Oct 1998     Volume: 8 Number: 3999

Today's topics:
    Re: Are there no PERL experts out there?? Is there no o <ljz@asfast.com>
    Re: Are there no PERL experts out there?? Is there no o <matt@whiterabbit.co.uk>
    Re: Are there no PERL experts out there?? Is there no o (Larry Rosler)
    Re: Are there no PERL experts out there?? Is there no o (Bart Lateur)
    Re: ARGV and Use of uninitialized value ullrich@math.okstate.edu
    Re: array references <rick.delaney@shaw.wave.ca>
    Re: comparing variables out of list array? <matt@whiterabbit.co.uk>
    Re: comparing variables out of list array? (Ok1aGo)
    Re: I'm new, but know what I need <alain@sonic.net>
        Insecure $ENV{PATH} while running setuid at /home/xxx/c <dlenox@ssix.net>
    Re: Insecure $ENV{PATH} while running setuid at /home/x (Michael Budash)
        Javascript and perl <spurling@mindspring.com>
    Re: Javascript and perl (Michael Budash)
        Memory problems <amorgan@vsol.com>
    Re: my perl programs can't use sendmail - HELP please!  <alain@sonic.net>
    Re: New Module: File::Finder -- OO version of File::Fin (Ilya Zakharevich)
        Perl routine needed. <waylen@ntx.com>
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi (Daniel E. Macks)
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <matt@whiterabbit.co.uk>
    Re: Slow Sort? <charis@texas.net>
        Storing object attributes in a DB_HASH? <jc_cann@ix.netcom.com>
    Re: sub and return <matt@whiterabbit.co.uk>
    Re: sub and return (Craig Berry)
    Re: sub and return (Michael Rubenstein)
    Re: Syslog not puttting anything into the log (Fluffy)
    Re: Too stupid ullrich@math.okstate.edu
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 17 Oct 1998 14:58:57 -400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <ltzpav8172.fsf@asfast.com>

Matt Pryor <matt@whiterabbit.co.uk> writes:

> rafely@xxiname.com wrote:
> 
> > (snip) I've posted this questions several
> > times in this newsgroup and other CGI newsgroup and
> > CGI forums.
> 
> If you post a question and nobody replies, it's generally due to one or
> more of the following:
> 
> 1) This newsgroup is _busy_.  Posts get missed.
> 2) Nobody who sees the post knows the answer.
> 3) Everybody knows the answer but is tired of explaining it.
> 4) Your title is so crap that it gives no hint whatsoever to the content
> of your message.
> 5) Your title is crap and obnoxious, and makes people take an instant
> dislike to you before even reading what you have written.
> 
> And, in spite of loads of good answers here, I see no "thanks guys for
> your help"... kinda makes you wonder why people bother, doesn't it?

If you have a pre-conceived notion that no one ever expresses
gratitude in c.l.p.misc, then you are likely to overlook the many
instances of thanks that routinely are given here.  I respectfully
submit that it is my opinion that your assertion contains an unfounded
assumption.

And to demonstrate that *my* assertion is not unfounded, I ran an
investigation:

I have a local news spool that I maintain via `slrnpull', and I keep
articles for 4 days before expiring them.  I use `slrnpull' to
automatically filter out posts with sex and money-offer related
subjects before I even download the articles.  Therefore, most of
what's in my spool are non-spam usenet articles.

I currently have 923 articles in my comp.lang.perl.misc spool, and of
these, 152 separate articles contain at least one occurrence of the
string "thank" in non-quoted, non-signature lines (using a
case-insensitive match).  This is 16.5 percent of all non-spam
c.l.p.misc articles that arrived during this 4-day period.

These 923 articles consist of 271 non-matching 'Subject:' lines (after
'Re:' is removed), which for simplicity, I will treat as separate
threads.  It turns out that 122 out of these 271 separate threads
contain original (i.e., not quoted from other articles) instances of
the string "thank" outside of the signature.  This is 45.0 percent.
And if you consider the fact that some of the articles with differing
'Subject:' lines are likely to belong to the same thread, this
percentage would then go up.

This also shows that there were 30 instances where original thanks
were expressed in more than one article within a given thread.

This doesn't even count multiple original (non-quoted) instances of
the string "thank" within a single article.

I eyeballed my findings, and every one of these occurrences of "thank"
is either an expression of gratitude after the fact or some version of
"thanks in advance".  The advance thanks seem to be more plentiful
than the post-hoc instances ... my rough, "eyeball" estimate is that
60-70 percent of these expressions of thanks come in advance.

Note that I did not check for other words or phrases of gratitude such
as "I appreciate it", "I am in your debt", etc.

While I'm sure that there are a small number of inconsiderate people
who do not express gratitude for the help that is given here in
c.l.p.misc, the fact that 16.5 percent of the non-spam posts and 45.0
percent of the non-spam threads here contain original (i.e., not
quoted from other articles) explicit expresions of thanks outside of
signature lines shows that there are plenty of people who are gracious
and appreciative of the help that is given here.

-- 
 Lloyd Zusman   ljz@asfast.com
 perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
 $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
 $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'


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

Date: Sat, 17 Oct 1998 20:09:42 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
To: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <3628EB76.A85397C0@whiterabbit.co.uk>

Lloyd Zusman wrote:
> If you have a pre-conceived notion that no one ever expresses
> gratitude in c.l.p.misc, 

I have no such pre-conceived notion, that I'm aware of....

> then you are likely to overlook the many
> instances of thanks that routinely are given here.  I respectfully
> submit that it is my opinion that your assertion contains an unfounded
> assumption.

No assumption involved.  I have made no such assertion...
 
(statistics snipped for berevity)
> While I'm sure that there are a small number of inconsiderate people
> who do not express gratitude for the help that is given here in
> c.l.p.misc, the fact that 16.5 percent of the non-spam posts and 45.0
> percent of the non-spam threads here contain original (i.e., not
> quoted from other articles) explicit expresions of thanks outside of
> signature lines shows that there are plenty of people who are gracious
> and appreciative of the help that is given here.

I realize that (probably) the majority of people who post to c.l.p.misc
with their questions are grateful for the replies they receive, and the
work that often goes into those replies.  However, my post was referring
to that minority who show no gratitude, and often don't even acknowledge
people who take the trouble to answer their questions.  This I find
downright rude and offensive.

Matt
--




> 
> --
>  Lloyd Zusman   ljz@asfast.com
>  perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
>  $t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
>  $x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'

-- 
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons


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

Date: Sat, 17 Oct 1998 12:25:43 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <MPG.10928f15cdb36a69898c0@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <3628D325.66376935@whiterabbit.co.uk> on Sat, 17 Oct 1998 
18:25:57 +0100, Matt Pryor <matt@whiterabbit.co.uk> says...
 ...
> And, in spite of loads of good answers here, I see no "thanks guys for
> your help"... kinda makes you wonder why people bother, doesn't it?

In addition to the statistics offered by Lloyd Zusman:

I have received *many* thank-you notes by email, often accompanied by 
further thoughts or ideas, which are sometimes pursued off-line.  (Of 
course, I make it easy by habitually Cc'ing responses to those who don't 
munge their email addresses.)

I am gratified by these personal thank-yous, and believe that the 
newsgroup benefits by not being burdened by too many public thanks.

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


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

Date: Sat, 17 Oct 1998 21:03:29 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <362cfd3a.1520214@news.ping.be>

Larry Rosler wrote:

>You wouldn't want Mark-Jason to suffer the
>! disappointment of being rejected by your script, now would you?
>
>Don't forget Tim O'Reilly either!  Or Alfred E. Neuman, for that matter.

How about Frangois, or Hilhne?

	Bart.


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

Date: Sat, 17 Oct 1998 22:22:01 GMT
From: ullrich@math.okstate.edu
Subject: Re: ARGV and Use of uninitialized value
Message-Id: <70b5a9$4t8$1@nnrp1.dejanews.com>

In article <708bmk$mgv$1@nnrp1.dejanews.com>,
  mike_allen@my-dejanews.com wrote:
> Hello,
>
> Why does the following:
>
> #!/usr/bin/perl -w
>
> $ARGV[0] =~ s/,//;
> if( $ARGV[0] ) {           < error here
>     print "$ARGV[0]\n";
> }
>
> produce:
>
> $ temp.pl
> Use of uninitialized value at ./temp.pl line 4
>
> if passed no arguments, but:
>
> if( $ARGV[0] ) {
>     print "$ARGV[0]\n";
> }
>
> does not?

       Actually that's not the line that produces the error. Try

#!/usr/bin/perl -w

$ARGV[0] =~ s/,//;
__END__

This line does produce an error in the second version because it's not there.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 17 Oct 1998 18:40:18 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: array references
Message-Id: <3628E62F.34029BD5@shaw.wave.ca>

[posted & mailed]

nguyen.van@imvi.bls.com wrote:
> 
> Hi guys,
> 
> I want read a file with each line is assigned as an array reference 
> and also want to print out all of them. Please give me a general 
> format.

perldoc perllol

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: Sat, 17 Oct 1998 19:46:38 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
To: Ok1aGo <ok1ago@aol.com>
Subject: Re: comparing variables out of list array?
Message-Id: <3628E60E.9D0B38B1@whiterabbit.co.uk>

Claire,

This:
	($a =~ /\b$b\b/i)

will return 1 if $a contains $b as a word. "\b" represents a word
boundary, be it a space or a newline or whatever.  Following on from
your example:

if $a contains "Myself and I", then "myself" will match, however "my"
and "self" will not.

Hope this helps,

Matt
--




Ok1aGo wrote:
> 
> Hi, I am not a perl expert and would like help with the following:
> 
> I would like to know how to match
> if ($blabla eq $whatever) out of 2 different lists; what I can do is compare
> those variables when they are exactly the same. But how to verify that $blabla
> contains the word behind $whatever. (Ex $blabla would be "myself" and $whatever
> would be "myself and I": how to encode this?)
> How to exclude whenever a PART of a variable matches?
> I would like to know the code, similar to
> if ('blabla" eq " /^blabla/") but for variables out of a list array.
> 
> Thanks in advance,
> Claire

-- 
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons


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

Date: 17 Oct 1998 19:05:05 GMT
From: ok1ago@aol.com (Ok1aGo)
Subject: Re: comparing variables out of list array?
Message-Id: <19981017150505.25149.00002081@ng-fb1.aol.com>

This was it, thanks a lot

Claire


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

Date: Sat, 17 Oct 1998 13:59:23 -0700
From: alain samoun <alain@sonic.net>
Subject: Re: I'm new, but know what I need
Message-Id: <3629052B.37A15BEC@sonic.net>

Dominic wrote:
> 
> Hello
> 
> First, sorry if this kind of post has appeared many times before. I'm
> new and not sure of the "status" of this kind of post.
> 
> I'd like some help:
> 
> Sites giving an overview of the perl language instruction set.
> 
> A site showing a "how to" of getting a script to pass the information it
> collects from the form off the Web page and to invoke a .exe
> program.(which uses it)
> 
> I'd like to set up an online database. I have MS Access. Help please!
> What do I need to learn?
A lot, start with a good book for newbie, like: Learning Perl  (O'Reilly
edit.)
> 
> reply
> blueatihugdotcodotnz

-- 
----------------------------------
LAB INSTRUMENTS, INC.				1417 LAKE ST. CALISTOGA, CA 94515 U.S.A.
TEL: (1) 707 942 1167				http://www.sonic.net/labinc			
FAX: (1) 707 942 1167	      			ftp://ftp.sonic.net/pub/users/alain
email: alain@sonic.net   Key fingerprint =  9F 0F CA 9D 66 19 01 46  14
55 43 73 E0 FE 1D 14 

Map to visit us, click to:
http://www.napavalley.com/napavalley/directns/napamap.gif


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

Date: Sat, 17 Oct 1998 19:21:17 -0400
From: Daniel Lenox <dlenox@ssix.net>
Subject: Insecure $ENV{PATH} while running setuid at /home/xxx/cgi-bin/sendmail.pl
Message-Id: <3629266D.16CEA8F8@ssix.net>

Recently brought Linux 2.0.25 server and tried running sendmail.pl
(known working script)
called by .html form processing.

Offending line is :    open (MAIL, "|/usr/sbin/sendmail -t");

Script works fine executed from command prompt, permissions on sendmail
are 4755
any ideas what is happening here?  apache.org strongly suggested this
was strictly perl
related....

Dan Lenox



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

Date: Sat, 17 Oct 1998 16:38:24 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: Insecure $ENV{PATH} while running setuid at /home/xxx/cgi-bin/sendmail.pl
Message-Id: <mbudash-1710981638240001@d23.nas1.napa.sonic.net>

In article <3629266D.16CEA8F8@ssix.net>, dlenox@ssix.net wrote:

>> Recently brought Linux 2.0.25 server and tried running sendmail.pl
>> (known working script)
>> called by .html form processing.
>> 
>> Offending line is :    open (MAIL, "|/usr/sbin/sendmail -t");
>> 
>> Script works fine executed from command prompt, permissions on sendmail
>> are 4755
>> any ideas what is happening here?  apache.org strongly suggested this
>> was strictly perl
>> related....

have you tried using:

open (MAIL, "|/usr/sbin/sendmail -t") or die("cant open sendmail: $!");

to see exactly what the error ($!) was?

-- 
Michael Budash ~ Michael Budash Consulting
707-255-5371 ~ 707-258-7800 x7736
mbudash@sonic.net


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

Date: Sat, 17 Oct 1998 16:55:45 -0400
From: "Sam Spurling" <spurling@mindspring.com>
Subject: Javascript and perl
Message-Id: <70b02a$4ol$1@camel29.mindspring.com>

Does anyone know how to fire a perl script off from within a onmouseover
event.  This is a section of code I am trying.  The first table row is a
generic script I am trying to envoke.  The second table is a normal
onmouseover event that works fine.

<tr>
     <td width="110"><center><form
action="http://www.somesite.com/cgi-bin/db.pl" method="POST"><input
type="hidden" name="act" value="display"><input type="image" src="en1.gif"
value="display">
      onmouseover="window.status='Take a look at our stuff';
img_act('Button5'); return true" onmouseout="window.status='';
img_inact('Button5');return true"></center></form></td>
    </tr>
    <tr>
     <td width="110"><center><a href="factor.htm"
onmouseover="window.status='The page; img_act('Button6'); return true"
onmouseout="window.status=''; img_inact('Button6');return true"><img
name="Button6" img src="factor1.gif" width="105" height="20" border="0"
align="absmiddle"></a></center></td>
    </tr>





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

Date: Sat, 17 Oct 1998 16:17:24 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: Javascript and perl
Message-Id: <mbudash-1710981617250001@d23.nas1.napa.sonic.net>

In article <70b02a$4ol$1@camel29.mindspring.com>, "Sam Spurling"
<spurling@mindspring.com> wrote:

>> Does anyone know how to fire a perl script off from within a onmouseover
>> event.

never done it, but you could specify a cgi script for the source of the
image that's suppose to appear onmouseover. as long as the script return
an image, it should work.

hth-

-- 
Michael Budash ~ Michael Budash Consulting
707-255-5371 ~ 707-258-7800 x7736
mbudash@sonic.net


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

Date: Sat, 17 Oct 1998 12:12:18 -0700
From: Adam Morgan <amorgan@vsol.com>
Subject: Memory problems
Message-Id: <3628EC11.ECB5EE58@vsol.com>

Does anyone know how to monitor memory use in Perl? I keep running out.

Thanks,

Adam.



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

Date: Sat, 17 Oct 1998 13:54:49 -0700
From: alain samoun <alain@sonic.net>
Subject: Re: my perl programs can't use sendmail - HELP please! (urgent!)
Message-Id: <36290419.CA44F637@sonic.net>

It's probably because your files don't have the right authorization. Ask
your ISP to chmod 755 the files you'r writting to or reading from.

ultrabyte@my-dejanews.com wrote:
> 
> Hi!
> 
> Another stupid question:
> 
> Since i had to switch to another provider and server i have to re-configure my
> perl-scripts (formmail and guestbook written by Matt Wright and a unique
> postcard-service written by myself). Everything worked fine at my former
> server. Now the perl-scripts work, but no emails can be sent. The path is ok
> (my ISP told me that: /bin/sendmail/).
> My ISP told me that there has to be a sender defined in my scripts which
> exists on my server - otherwise sendmail wouldn't work in order to avoid
> unauthoruzed usage of sendmail. How can I add a sender?
> How do I have to configure my formmail-script to make it send emails? (I
> don't have a telnet account and can't change anything at the server and my
> ISP is not willing to change anything - he told me my scripts were wrong -
> but they worked fine on two other servers before).
> 
> One of the perl-codes i use for sending a message is:
> 
> ###############################################################
> sub send_it
> {
> open (MAIL, "|$sendmail_prog -t") || die "Can't open $sendmail_prog!\n";
> 
> print MAIL "To: $mail\n";
> print MAIL "From: $nachricht_absender ($nachricht_abs_name)\n";
> print MAIL "Reply-to: $replyto\n";
> print MAIL "Subject: Eine Postkarte von $sender!\n\n";
> 
> print MAIL "\nHallo $recipient,\n\n";
> print MAIL "Eine Postkarte wartet auf Sie!\n";
> print MAIL "Der Absender ist: $sender\n(E-Mail: $replyto)\n\n";
> print MAIL "Um die Karte abzuholen, gehen Sie bitte mit Ihrem Webbrowser
> zu\n\n";
> print MAIL "$scripts_url/$get_script?$key \n\n";
> print MAIL "Ihre Postkarte liegt $days_to_keep Tage bei dieser Adresse ";
> print MAIL "zur Abholung bereit.\n\n";
> print MAIL "Mit den besten Empfehlungen\nvom Webmaster bei $site_url/\n\n";
> print MAIL
> "----------------------------------------------------------------------\n\n"
> ;
> print MAIL "$nachricht_werbung\n\n";
> close MAIL;
> 
> } # end of &send_it
> 
> ###############################################################
> 
> $nachricht_absender is filled with a working pop-account
> (myname@mydomain.com)
> $sendmail_prog is filled with '/bin/sendmail'
> 
> How can I tell sendmail that I'm authorized to send mails from my virtual
> server?
> Please Help....
> 
> Thankyou
> 
> Rainer
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

-- 
----------------------------------
LAB INSTRUMENTS, INC.				1417 LAKE ST. CALISTOGA, CA 94515 U.S.A.
TEL: (1) 707 942 1167				http://www.sonic.net/labinc			
FAX: (1) 707 942 1167	      			ftp://ftp.sonic.net/pub/users/alain
email: alain@sonic.net   Key fingerprint =  9F 0F CA 9D 66 19 01 46  14
55 43 73 E0 FE 1D 14 

Map to visit us, click to:
http://www.napavalley.com/napavalley/directns/napamap.gif


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

Date: 17 Oct 1998 19:15:24 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: New Module: File::Finder -- OO version of File::Find
Message-Id: <70aqcc$4mi$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Christiansen 
<tchrist@mox.perl.com>],
who wrote in article <70a78u$ao5$1@csnews.cs.colorado.edu>:
> File::Find is perfectly simple.  Why obfuscate it?

Because this perfectly simple module is unusable in some situations?
You cannot have several of them running simultaneously.  You cannot
start one inside another one.

In 80% of cases File::Find is OK (witness pfind ;-), but sometimes it
should be useless.

I agree with you that adding 3 more fields to the argument hash, like

  find( { wanted => \&wanted, bydepth => 1,
	  _ => \$shortname, name => \$longname, dir => $dir },
        "." )

would be a better solution.  Done properly it is going to result in 3
extra dereferences per file found, thus no observable slowdown.

Hmm, maybe also a sub to call when going up the directory tree,

	   updir => \&updir,

Any volunteers to implement this?  Anything else to add (except
symlink traversal that Helmut  Jarausch is always promising to add),
and an extra flag to *always* stat() the file.

Ilya


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

Date: Sat, 17 Oct 1998 19:48:24 -0400
From: "Waylen" <waylen@ntx.com>
Subject: Perl routine needed.
Message-Id: <70bab7$tp6$1@node17.cwnet.frontiernet.net>

Any perl gurus out there who can help me with a sub routine
for a script. I need a sub routine for customshipping.pl
which can be seen at
http://www.securecommerce.com/ss6d7/cgi-bin/shoppro/customshipping.pl
What is needed is a minimum shipping charge of $5.00
and a cap of $20.00 in addition to the percentage that is
generated by the cgi program....
http://www.securecommerce.com/ss6d7/cgi-bin/shoppro/shoppro.cgi
The config file is at
http://www.securecommerce.com/ss6d7/cgi-bin/shoppro/shoppro.cfg
As is obvious I am no programmer.
Any takers?
Thanks!




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

Date: 17 Oct 1998 18:53:15 GMT
From: dmacks@sas.upenn.edu (Daniel E. Macks)
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <70ap2r$quh$1@netnews.upenn.edu>

Elaine -HappyFunBall- Ashton (eashton@bbnplanet.com) said:
: Adam Turoff wrote:
: 
: > Let's not forget the Pe[a]rl Sake, the oyster bar, roasted gecko,
: > good beer, or the mother-of-perl inlay at the bar.
: 
: That Pearl Sake you and Dave bought is disturbing. The mother-of-perl
: inlay would have to be of Larry, of course. :)

That'd be *father*-of-perl, no? Unless there's something Larry hasn't
told us...

dan
-- 
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks



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

Date: Sat, 17 Oct 1998 19:58:22 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <3628E8CE.798700E2@whiterabbit.co.uk>

> : That Pearl Sake you and Dave bought is disturbing. The mother-of-perl
> : inlay would have to be of Larry, of course. :)
> 
> That'd be *father*-of-perl, no? Unless there's something Larry hasn't
> told us...

Hmmm... I always did think that big handlebar moustache was a bit
suspicious.





-- 
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons


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

Date: Sat, 17 Oct 1998 14:24:02 -0500
From: Jim Sauber <charis@texas.net>
Subject: Re: Slow Sort?
Message-Id: <3628EED2.216A2D99@texas.net>

6 seconds on a Cyrix 233 128 meg Linux 2.033 - 40 minutes?



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

Date: Sat, 17 Oct 1998 15:00:23 -0600
From: Jeffery Cann <jc_cann@ix.netcom.com>
Subject: Storing object attributes in a DB_HASH?
Message-Id: <36290567.48189EF@ix.netcom.com>

Hello.

Given an object that stores its attributes as a hash:

my $obj = {
	key1 = value1,
	key2 = value2,
	...
};
bless ($obj,$pkg);

I would like to store the attributes for $obj in a DB_HASH DB_File.

The only way I can think of doing this is:

1. Concatenate the values of the hash into a single, comma-separated
string:
	$rec="value1,value2";

2. Insert this record with a key:
	$dbFile=add->($key,$rec);

This implementation seems okay.  But, when I read a record from the
database an rebuild the attributes of the object (and when I insert), I
will always need to keep the order of the records the same (step 1
above).  Sure, I can write a method to build the value list inserted
into $rec (and deconstruct it upon read from database), but this seems
like too much work!

Is there another, more flexible way to store an object's attributes in a
DB_File?

Thanks for suggestions.

-- 
Jeffery C. Cann              
Senior Software Engineer     
http://www.netcom.com/~jcds


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

Date: Sat, 17 Oct 1998 19:42:33 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
To: Todd R Koning <army.tennis@lineone.net>
Subject: Re: sub and return
Message-Id: <3628E519.FADECD70@whiterabbit.co.uk>

Tim,

Here you go:

#!/usr/bin/perl -w

while ($repeat ne "no") {
	print "Enter the radius of the circle. ";
	$radius = <STDIN>;
	chomp ($radius);
	$circumference = ((2 * 3.1415)* $radius);
	print "$circumference\n";
	print "Do you want to try again? yes or no? ";
	chomp($repeat=<STDIN>);
}

Note that brackets surrounding quotes isn't necessary with print
statements.

HTH

Matt
--

Todd R Koning wrote:
> 1    -    Is the subroutine idea a good way of doing  it?
> 2    -    How do I make the subroutine work?
> 3    -    How do I take the return value from the sub and say whether to
> re-run the prompt for input or quit the program?

-- 
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons


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

Date: 17 Oct 1998 20:09:08 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: sub and return
Message-Id: <70ath4$o8o$1@marina.cinenet.net>

Matt Pryor (matt@whiterabbit.co.uk) wrote:
: Here you go:
: 
: #!/usr/bin/perl -w
: 
: while ($repeat ne "no") {
: 	print "Enter the radius of the circle. ";
: 	$radius = <STDIN>;
: 	chomp ($radius);
: 	$circumference = ((2 * 3.1415)* $radius);
: 	print "$circumference\n";
: 	print "Do you want to try again? yes or no? ";
: 	chomp($repeat=<STDIN>);
: }

Or, in a form which avoids all use of variables, and the test-before-set
problem in the while conditional: 

  do {
    print "Enter radius of the circle: ";
    print 2 * 3.1416 * <STDIN>, "\n";
    print "Do you want to try again?  yes or no: ";
  } while <STDIN> ne "no\n";

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Sat, 17 Oct 1998 21:00:42 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: sub and return
Message-Id: <362a04be.93147208@nntp.ix.netcom.com>

On Sat, 17 Oct 1998 19:42:33 +0100, Matt Pryor
<matt@whiterabbit.co.uk> wrote:

>#!/usr/bin/perl -w
>
>while ($repeat ne "no") {
>	print "Enter the radius of the circle. ";
>	$radius = <STDIN>;
>	chomp ($radius);
>	$circumference = ((2 * 3.1415)* $radius);
>	print "$circumference\n";
>	print "Do you want to try again? yes or no? ";
>	chomp($repeat=<STDIN>);
>}

It's very nice to use -w in examples for beginners.  They should learn
to use the option.  It would be even nicer if the example did not
cause a warning :-)

	$repeat = "";

before the loop will fix it.
--
Michael M Rubenstein


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

Date: 17 Oct 1998 20:29:09 GMT
From: fluffy@meow.org (Fluffy)
Subject: Re: Syslog not puttting anything into the log
Message-Id: <slrn72hvgk.eoj.fluffy@meow.org>

Zrbj zrbj Richard F. Barham zrbj zrbj zrbj rfbarham@flash.net zrbj Kitty?

> Hi. I'm using Sys::Syslog with the examples in the pod and in the book. But
> it's not putting anything in the log. Everything looks ok, and I'm using the
> perl that came with Redhat 5.1 .

On perl 5.004_03 and later, you can add this to your script to make
linux dig it:

Sys::Syslog::setlogsock('unix');

Some may recommend that you enable your syslogd to listen on UDP, but
that isn't a very good security practice.



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

Date: Sat, 17 Oct 1998 22:16:20 GMT
From: ullrich@math.okstate.edu
Subject: Re: Too stupid
Message-Id: <70b4vk$4pv$1@nnrp1.dejanews.com>

In article <OZLV1.19821$tF.473@news-reader.bt.net>,
  "Tim Hicks" <tim.hicks@iname.com> wrote:
> I apologise for the utter stupidity of my post but it is driving me crazy.
>
[...]
>
> ... The problem is that the DOS window closes too quickly to actually see
> the result.  I'm not even sure if this is a perl or windows/dos problem, but
> how can I stop this happening.

        Huh - I thought it was just me who had that stupid problem.
The first solution I came up with was what people have suggested -
add an extra <STDIN> at the end.

        I never used DOS in my life til I started this Perl thing -
the old DOS guy down the hall had a better answer ("better" in that
it doesn't require that you change the Perl code): instead of
running Perl.exe run a batch file. Like DURunPerl.bat:

@ECHO OFF
perl.95.exe %1 %2 %3 %4 %5 %6 %7 %8 %9

You can associate *.pl with this batch file. Or if you know any
Windows programming it's easy to make a little Windows program
that lets you edit pl files and includes a SaveAndRun button
that gets switches from the top of the pl file, parameters
from the Parameters box, then says

Winexec(PChar(PerlBat +
                ' ' + Switches +
                ' ' + Filename  +
                ' ' + ParamBox.Text
                ), SW_SHOWMAXIMIZED);

(you can regard that as Delphi or as psuedocode, as you prefer).

       When I do this the window still closes in some cases, but it
seems to stay open if there's been anything printed to the screen,
which is the case when you want it to stay there.

David C. Ullrich

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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 V8 Issue 3999
**************************************

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