[13723] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1133 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 20 15:05:41 1999

Date: Wed, 20 Oct 1999 12:05:17 -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: <940446316-v9-i1133@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 20 Oct 1999     Volume: 9 Number: 1133

Today's topics:
    Re: %hash array problem <jon@midnightbeach.com>
    Re: 'last' behaviour differences between Perl4 & Perl5 <jbreukelman@netcom.ca>
    Re: 'last' behaviour differences between Perl4 & Perl5 <jbreukelman@netcom.ca>
    Re: Card shuffling (Kragen Sitaker)
    Re: Card shuffling (Kragen Sitaker)
        Clearing Variables? <bgintz@airlinksystems.com>
    Re: Emulating grep (and map) syntax? (Tad McClellan)
    Re: Exact pattern match <lr@hpl.hp.com>
    Re: Examining Win32 processes (Michel Dalle)
    Re: Help - Can't figure this out <partner@casinofantasy.com>
    Re: Help - Can't figure this out (Tad McClellan)
    Re: How to get file size? (Kragen Sitaker)
    Re: How to get file size? (Kragen Sitaker)
    Re: Ignore the idiots (including Tad) (Matthew Bafford)
    Re: Ignore the idiots (including Tad) <lr@hpl.hp.com>
    Re: Ignore the idiots (Malcolm Ray)
    Re: Ignore the idiots (Greg Andrews)
    Re: Ignore the idiots (Randal L. Schwartz)
    Re: New Perl/TK Tutorial on perl.com <lr@hpl.hp.com>
    Re: New Perl/TK Tutorial on perl.com (Ilya Zakharevich)
    Re: Newbie - Help on installing perl (Kragen Sitaker)
    Re: Substitution (Craig Berry)
    Re: Substitution (Randal L. Schwartz)
        upload file help <fmartin@steel.ucs.indiana.edu>
    Re: what is SHTML ? <et@telus.net>
    Re: Working on an Array of Hashes: "using $_->{ }" <marshalc@americasm01.nt.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 20 Oct 1999 11:42:13 -0700
From: Jon Shemitz <jon@midnightbeach.com>
Subject: Re: %hash array problem
Message-Id: <380E0D05.4C752A3@midnightbeach.com>

Bart Lateur wrote:

> No it's not. Not if you like some order in your printout that makes some
> sense to human beings. Try looking up a name in a list of 200 names when
> they're pseudo-randomly shuffled!

The camel book implies on page 160 that each and map have the same
order: "There is a single iterator for each hash, shared by all each,
keys, and values function calls in the program."

Obviously, if you want to do something in a particular order, you want
to use foreach (sort keys) - but that's not what Marc posted three
articles up. There are plenty of problems where you might need to do
several operations on all elements of a hash before you need to worry
about output order, and in these while each is going to take less time
and (as Paul Hanbury points out) use less memory than foreach (keys).

-- 

http://www.midnightbeach.com    - Me, my work, my writing, and
http://www.midnightbeach.com/hs - my homeschool resource pages


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

Date: Wed, 20 Oct 1999 14:16:16 -0400
From: JBreukelman <jbreukelman@netcom.ca>
Subject: Re: 'last' behaviour differences between Perl4 & Perl5
Message-Id: <380E06F0.314AABD6@netcom.ca>

Thank you.

Perl5 likes 'return 0' just fine.

When I wrote this, it may have been Perl4 or just the version I used, but
using the command 'return x' would not prevent the rest of the function
from being executed, hence the 'last' command to skip the rest of the
function.

Also, Perl5 may be different, but in Perl4 (return 0, last) actually
executes both commands.  I use this frequently - ie

$Boolean && ($x=1, $y=2, $z=3, print("whatever\n"), next);

etc.

Thanks again,


Jeff Breukelman.

Eric Kuritzky wrote:

> In article <380CE9BD.FAD36486@netcom.ca>,
> JBreukelman  <jbreukelman@netcom.ca> wrote:
> >Hello.
> >
> >I wrote a script a couple of years ago which uses a number of
> >subroutines (30 or so).  Most of these scripts will return 0 if they
> >come across an error.  To do this I used the following command;
> >
> >(return 0, last) if($Error);
> >
> [perl5 doesn't like this]
> >
> >Does anyone know of a way I can fix this without rewriting _every_
> >subroutine?
>
> Well, if you really wanted the subroutine to return zero to the
> calling routine, then rewriting every subroutine will produce cleaner
> code, since the 'last' wasn't ever necessary.  (In fact, the line
>
> return 0 if $Error;
>
> is perfectly adequate.)
>
> Note that
>
> (return 0, last) if($Error);
>
> is the same as
>
> return(0, last) if($Error);
>
> which is equivalent to
>
> last if($Error);
>
> since the return is never executed (the last transfers control out of
> the block first).  This may have been different in perl4.  Is that
> really what you wanted to do?
>
> (Yes, you _can_ use last in a subroutine to exit a loop in the calling
> routine... I'm not sure I wanted to know that.)
>
> --Eric Kuritzky
> print "Just a wannabe perl hacker\n";



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

Date: Wed, 20 Oct 1999 14:16:51 -0400
From: JBreukelman <jbreukelman@netcom.ca>
Subject: Re: 'last' behaviour differences between Perl4 & Perl5
Message-Id: <380E0712.F226E9F1@netcom.ca>

Thank you.

Perl5 likes 'return 0' just fine.

When I wrote this, it may have been Perl4 or just the version I used, but
using the command 'return x' would not prevent the rest of the function
from being executed, hence the 'last' command to skip the rest of the
function.

Also, Perl5 may be different, but in Perl4 (return 0, last) actually
executes both commands.  I use this frequently - ie

$Boolean && ($x=1, $y=2, $z=3, print("whatever\n"), next);

etc.

Thanks again,


Jeff Breukelman.

Eric Kuritzky wrote:

> In article <380CE9BD.FAD36486@netcom.ca>,
> JBreukelman  <jbreukelman@netcom.ca> wrote:
> >Hello.
> >
> >I wrote a script a couple of years ago which uses a number of
> >subroutines (30 or so).  Most of these scripts will return 0 if they
> >come across an error.  To do this I used the following command;
> >
> >(return 0, last) if($Error);
> >
> [perl5 doesn't like this]
> >
> >Does anyone know of a way I can fix this without rewriting _every_
> >subroutine?
>
> Well, if you really wanted the subroutine to return zero to the
> calling routine, then rewriting every subroutine will produce cleaner
> code, since the 'last' wasn't ever necessary.  (In fact, the line
>
> return 0 if $Error;
>
> is perfectly adequate.)
>
> Note that
>
> (return 0, last) if($Error);
>
> is the same as
>
> return(0, last) if($Error);
>
> which is equivalent to
>
> last if($Error);
>
> since the return is never executed (the last transfers control out of
> the block first).  This may have been different in perl4.  Is that
> really what you wanted to do?
>
> (Yes, you _can_ use last in a subroutine to exit a loop in the calling
> routine... I'm not sure I wanted to know that.)
>
> --Eric Kuritzky
> print "Just a wannabe perl hacker\n";



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

Date: Wed, 20 Oct 1999 18:25:41 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Card shuffling
Message-Id: <FOnP3.22244$E_1.1215811@typ11.nn.bcandid.com>

In article <380DE396.CA7A3F34@ife.ee.ethz.ch>,
Alex Rhomberg  <rhomberg@ife.ee.ethz.ch> wrote:
>The problem is that your random generator allows only for 2^32
>possibilites, while shuffling the cards can have much much more (see the
>zeroes above for the relation)
>
>Mathematica says:
>52!/46! > 2^33
>
>meaning that if you take *six* cards with your method and a 32 bit
>random generator, _all_ the remaining cards are _known_. (it can vary.
>some deals might be unique after less cards, some might differ after
>more)
>After the first *six* cards, all the randomness has gone out of your
>method!

Good point.  This is probably something to think about if you want your
card shuffles to be fair.  (It's probably possible, given the simple
algorithms rand() uses, for an attacker to figure out what the rest of
the deck is by looking at any six cards.)

Does perl rand() in fact use the platform rand()?  I'd think it'd use
random() or drand48() if it could.

(Testing on my perl [0] shows that it does use rand().)

A little fiddling around with GNU bc [1] suggests we need at least 226
bits of randomness to shuffle a card deck properly.  By default,
random() uses 31 long ints, which is 31 * 32 = 992 bits of state.
While the random() function's man page claims it has a period of 16 *
2^31 -- i.e. 2^35 -- I assume it can actually produce 2^992 different
random sequences or so.

drand48() only uses 48 bits of state, which is still not enough to
shuffle cards.

Using Linux's /dev/random might be helpful, but might be rather slow --
especially for a web server, since bits of randomness are not collected
from network activity or timer interrupts.  The TrulyRandom module is
probably a viable solution, though -- again -- slow.

>Best to quote Knuth here (from the mind)
>
>"It is not good to construct a random number generator randomly. Some
>theory should be used"

I believe he was describing the interesting phenomenon that, if you
construct a random set of numerical operations to use as a RNG, it is
likely that they will have a short period -- not what we're concerned
about here.

[0] My system is
SunOS kirk 5.6 Generic_105181-13 sun4m sparc SUNW,SPARCstation-20
and my perl is
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos shadow 5.6 generic sun4m sparc sunw,sparcstation-20 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.8.1
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -lgdbm -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under solaris
  Compiled at May 17 1999 23:47:08
  @INC:
    /usr/local/lib/perl5/5.00503/sun4-solaris
    /usr/local/lib/perl5/5.00503
    /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.005
    .

[1] bc -l:
define f(m) {
        if (m==0) {
                return(1);
        }
        return(m*f(m-1));
}
f(3)
6
f(52)/f(51)
52.00000000000000000000
l(f(52))
156.36083630307878519406
l(f(52))/l(2)
225.58100312370276194868
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Oct 19 1999
21 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 20 Oct 1999 19:02:15 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Card shuffling
Message-Id: <XkoP3.22432$E_1.1219502@typ11.nn.bcandid.com>

In article <380DE892.7DB2E2D9@vpservices.com>,
Jeff Zucker  <jeff@vpservices.com> wrote:
>Alex Rhomberg wrote:
>> Mikko Saari wrote:
>> >
>> > I need a perl script to handle decks of cards. My first and most obvious
>> > problem is shuffling, a problem which has bothered me previously. How do I
>> > arrange an array in random order?
>> 
>> It is not possible with any pseudo random generator.
>
>This is Off-Topic, but how do the failings of Perl's random number
>generator compare with the failings of a typical human shuffler?  Most
>people riffle the cards once or twice and deal.  So while Perl's random
>generator is not up to a full random shuffle, doesn't it approach the
>degree of randomness found in a typical card game among humans?  If it
>were to be truly random, wouldn't it produce very different results than
>found in a typical game among humans?

Well, I believe professional dealers are required to shuffle the deck
six times, enough for every card to be able to be anywhere in the deck,
but not enough to stack it very well.  [I can't remember what the
number is, though.]

Ideally, every card getting shuffled -- except for the last two or
three -- contributes one bit of entropy, because it's equally likely to
be the left or right card.  If this is the case, we have about 50 bits
of entropy per shuffle, so we only need one shuffle to do better than
rand(), and five shuffles to do things perfectly.  [This suggests
something is wrong with my reasoning, because we know it takes six --
right?  Or does it?]

A rather bad shuffler whose shuffles usually consist of alternating
sets of five or so cards can be modeled by a Markov process, where the
next card has some probability of being the same (left or right) as the
previous card.  It is not immediately obvious to me how to measure the
entropy of such a process, nor how to calculate the probabilities
necessary to give normal chunk sizes.  So I can't really answer your
question.

I do suspect, though, that the entropy is not less than 10 bits per
shuffle, sort of intuitively (thinking of the five-card chunks as
individual cards in a smaller deck, which, of course, they aren't).
That suggests that if you shuffle badly once or twice, you will indeed
have less randomness than rand().

But there's an important difference.  The computer's nonrandomness is
totally deterministic.  Given a sufficiently clever algorithm, or a
sufficiently powerful computer, you could look at some six cards and
*know* what the rest of the deck holds.  Even if I shuffled the deck
once, very badly, you still wouldn't know *for sure* what the next card
was, ever.

To answer your very-different-results question: probably.  Even
shuffling this way with rand() won't e.g. leave runs of cards together
from the previous game's discard pile.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Oct 19 1999
21 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 20 Oct 1999 13:59:26 -0500
From: Bryan Gintz <bgintz@airlinksystems.com>
Subject: Clearing Variables?
Message-Id: <380E110E.60229EEF@airlinksystems.com>

Does anyone know how to clear variables.  e.g. if i am going through a
loop and I have 3 variables, if only 2 show up through the first
iteration, I do not want the third variable from the first iteration
showing up.  let me know, thanks

Bryan Gintz



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

Date: Wed, 20 Oct 1999 09:48:21 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Emulating grep (and map) syntax?
Message-Id: <57hku7.kce.ln@magna.metronet.com>

Jon Shemitz (jon@midnightbeach.com) wrote:
: I had a case where I wanted to check if a list contained a given value.
                                          ^^^^^^
                                          ^^^^^^

:   grep /^$next$/, @thislist
                    ^^^^^^^^^

   That isn't a list. It is an array. 

   A "list" and an "array" are different things in Perl.

   Sometimes it makes a difference.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 20 Oct 1999 11:02:59 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Exact pattern match
Message-Id: <MPG.1277a3b1605c32a198a0d4@nntp.hpl.hp.com>

In article <qqacu7.hk8.ln@magna.metronet.com> on Sun, 17 Oct 1999 
07:10:18 -0400, Tad McClellan <tadmc@metronet.com> says...
> ¿¤BaX¤¿ (paschal1@mindspring.com) wrote:
> : I'm trying to get an EXACT match for user names from a flat file,

 ...

>       if ( lc($qfield) eq lc($aname) ) {
> 
>    If you insist on using the (much slower) regex approach,
>    then anchor both ends:
> 
>       if ($qfield =~ /^$aname$/i ) {
> 
>    And maybe throw in a \Q too...

I know that conventional wisdom says that 'eq' is faster than a regex 
match.  Perhaps someone can explain away this benchmark, which compares 
two string case-independently for complete match, late mismatch, and 
immediate mismatch.

Benchmark: timing 262144 iterations of eq0, eq1, eq2, regex0, regex1, 
regex2...
       eq0:  6 wallclock secs ( 4.91 usr +  0.00 sys =  4.91 CPU)
       eq1:  4 wallclock secs ( 4.80 usr +  0.00 sys =  4.80 CPU)
       eq2:  4 wallclock secs ( 4.23 usr +  0.00 sys =  4.23 CPU)
    regex0:  5 wallclock secs ( 4.00 usr +  0.00 sys =  4.00 CPU)
    regex1:  3 wallclock secs ( 3.83 usr +  0.00 sys =  3.83 CPU)
    regex2:  3 wallclock secs ( 2.88 usr +  0.00 sys =  2.88 CPU)

#!perl -w
use strict;
use Benchmark;

my $x = 'x' x 100;
my $y = 'x' x 99 . 'y';
my $z = 'z' . 'x' x 99;

timethese(1 << (shift || 0), {
	eq0      => sub { my $r = lc($x) eq lc($x) },
	eq1      => sub { my $r = lc($x) eq lc($y) },
	eq2      => sub { my $r = lc($x) eq lc($z) },
	regex0   => sub { my $r = $x =~ /^\Q$x\E$/io },
	regex1   => sub { my $r = $x =~ /^\Q$y\E$/io },
	regex2   => sub { my $r = $x =~ /^\Q$z\E$/io },
});

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


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

Date: Wed, 20 Oct 1999 17:54:37 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Examining Win32 processes
Message-Id: <7ukvu6$91l$1@news.mch.sbs.de>

In article <380e24a3.17138104@news.vnet.net>, mirak63@yahoo.com wrote:
>I need to examine the System Idle process to see how long it has been
>running. I've checked the Perl for win32 book by Dave Roth. It shows
>clearly how to create and manipulate your own processes. However, I
>can't seem to find any way to access the standard processes.  

Is this a disguised way of determining how long ago the system was started ?
If so, you might try another Win32 API function, namely GetTickCount :

The GetTickCount function retrieves the number of milliseconds that have 
elapsed since Windows was started. 

DWORD GetTickCount(VOID)

See the documentation of Win32::API for more details on how to use this.

Have fun,

Michel.


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

Date: Thu, 21 Oct 1999 04:44:09 +1000
From: Anonymous <partner@casinofantasy.com>
Subject: Re: Help - Can't figure this out
Message-Id: <380E0D79.4A3037D3@casinofantasy.com>

somebody in here is a bitch and a half...



Abigail wrote:

> Anonymous (partner@casinofantasy.com) wrote on MMCCXLI September MCMXCIII
> in <URL:news:380D4E2F.B1ABC968@casinofantasy.com>:
> `` your actually a female who is a perl hacker? way too cool marry me please please
> `` please.
>
> Leave your teenage attitude at home.
>
> Abigail
> --
> package Z;use overload'""'=>sub{$b++?Hacker:Another};
> sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
> $,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail
>
>   -----------== 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: Wed, 20 Oct 1999 09:58:03 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help - Can't figure this out
Message-Id: <bphku7.lde.ln@magna.metronet.com>

Elaine -HFB- Ashton (elaine@chaos.wustl.edu) wrote:
: Anonymous wrote:
: > 
: > your actually a female who is a perl hacker? way too cool marry me please please
: > please.
: > ;).

: Sorry dude, us chicks stick together :) She's mine! 


    I hate it when that happens.


: *smoochies*


    I love it when that happens.

    :-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 20 Oct 1999 18:32:00 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: How to get file size?
Message-Id: <AUnP3.22313$E_1.1215394@typ11.nn.bcandid.com>

In article <I1mP3.7416$7G2.40591@news1.online.no>,
Acacia <acacia@online.no> wrote:

>Vincent Murphy <vincent.murphy@cybertrust.gte.com> wrote in message
>news:xjg3dv6f1w9.fsf@gamora.ndhm.gtegsc.com...
>> perl -e '$size= -s "/tmp/core"; print qq(size is $size\n)'
>
>i would really like to be able to put $filepath instead of /tmp/core .... is
>it possible ?

If $filepath is the path to a file, not a URL, yes.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Oct 19 1999
21 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 20 Oct 1999 18:34:30 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: How to get file size?
Message-Id: <WWnP3.22331$E_1.1216782@typ11.nn.bcandid.com>

In article <7snP3.7504$7G2.41491@news1.online.no>,
Acacia <acacia@online.no> wrote:
>didn't work... in the html code the output looks like this...
>
><td width=95 height=20 bgcolor=DADADA><font face=Verdana size=1
>color=007AB5>npskin_v2.ZIP
></font></td>

That's a newline, not a space.  Remove the newline; chomp or s/\n// may
be good, depending on context.  And the newline isn't s###'s fault.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Oct 19 1999
21 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 20 Oct 1999 18:11:56 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Ignore the idiots (including Tad)
Message-Id: <slrn80rvbe.1e9.*@dragons.duesouth.net>

On Wed, 20 Oct 1999 17:41:57 GMT, Matthew Bafford) held some poor
sysadmin at gunpoint, and typed the following into comp.lang.perl.misc: 
: We ask questions on our own time, for YOUR benefit.

Well, that, too.

: --Matthew

--Matthew


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

Date: Wed, 20 Oct 1999 11:06:39 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Ignore the idiots (including Tad)
Message-Id: <MPG.1277a48772417dc598a0d5@nntp.hpl.hp.com>

In article <slrn80ru8p.1e9.*@dragons.duesouth.net> on Wed, 20 Oct 1999 
17:41:57 GMT, Matthew Bafford <*@dragons.duesouth.net> says...

 ...

> We ask questions on our own time, for YOUR benefit.

    s/ask/answer/;

But critiques of the answers are useful for the person who answered, 
perhaps most of all.

> We don't get paid, other than the occasional thank you email.

Which I, for one, appreciate a lot.  But see my previous comment for 
other forms of payment.

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


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

Date: 20 Oct 1999 18:14:25 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Ignore the idiots
Message-Id: <slrn80s1k1.6vb.M.Ray@carlova.ulcc.ac.uk>

On 20 Oct 1999 16:52:09 GMT, Greg Snow <snow@statsci.com> wrote:
>>This is comp.lang.perl.misc right? Maybe there should be a
>>comp.lang.perl.peoplewhoknowitallalready so that us newbies don't feel
>>like we're encroaching on the elitists' turf.
>
>This has been suggested before, but think about it for a minute, if there
>were a newbies group and an experts group

Stop right there!  While I agree with most of what you say, I think
you're falling into a trap here.  This classification of clpm posters
into 'newbies' and 'experts' is, IMO, something of a straw man put
forward by those guilty of the sin of False Laziness.  It allows them
to accuse clpm of elitism, and (I suspect) scares off some potential
answerers who don't consider themselves experts.  clpm has room for
programmers of all levels of expertise, answering as well as asking.

If a new poster appeared on the scene and steadily answered a dozen
FAQs a day, each answer beginning "I'm no expert, but...", do you
think they'd be received with hostility by the real experts?  I don't.
Any volunteers?
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: 20 Oct 1999 11:28:45 -0700
From: gerg@shell.ncal.verio.com (Greg Andrews)
Subject: Re: Ignore the idiots
Message-Id: <7ul1kt$7ja$1@shell1.ncal.verio.com>

M.Ray@ulcc.ac.uk (Malcolm Ray) writes:
>
>If a new poster appeared on the scene and steadily answered a dozen
>FAQs a day, each answer beginning "I'm no expert, but...", do you
>think they'd be received with hostility by the real experts?  I don't.
>

It would depend on whether the answers being given were right or wrong.
I've seen plenty of flames directed toward a new poster who answered
a question with a bad answer.

As long as the answers aren't bad ones, I agree with you that the new
poster would not be received with hostility.

  -Greg
-- 
:::::::::::::::::::  Greg Andrews  gerg@wco.com  :::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


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

Date: 20 Oct 1999 11:32:41 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Ignore the idiots
Message-Id: <m14sflnara.fsf@halfdome.holdit.com>

>>>>> "Greg" == Greg Snow <snow@statsci.com> writes:

Greg> This has been suggested before, but think about it for a minute,
Greg> if there were a newbies group and an experts group and you had a
Greg> question that you thought was important, would you go to the
Greg> newbies group where the only people who would answer the
Greg> question might know less than you, where you might get an answer
Greg> that works, but does not have the experiance behind it to be the
Greg> BEST answer, or would you go over to the experts group hoping to
Greg> get an expert to answer.  The fear is that if we split it into 2
Greg> groups, all the newbies would flood the experts group expecting
Greg> help from experts and it would be no different from what we have
Greg> now (maybe we could set up an experts group as a decoy and all
Greg> the experts could hang out on the newbie group where the newbies
Greg> are afraid to ask questions :)

It's more than a fear.  It really happened with comp.unix.questions
and comp.unix.wizards.  So much so that comp.unix.wizards finally had
to be moderated, and comp.unix.questions gets the same FAQing
questions over and over and over again.  (Along with "useless use
of cat" responses, which I tend to poke fun at.)

print "Just another Perl hacker," # and usenet user since 1980...

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 20 Oct 1999 11:09:12 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: New Perl/TK Tutorial on perl.com
Message-Id: <MPG.1277a51f5f575f7898a0d6@nntp.hpl.hp.com>

In article <7ukv54$bd9$1@charm.magnus.acs.ohio-state.edu> on 20 Oct 1999 
17:46:12 GMT, Ilya Zakharevich <ilya@math.ohio-state.edu> says...

 ...

> Look as they suppose people will read docs from *GIFs*!  My Lord!

Welcome (in 14+ months) to the 21st Century.

Not much browsing is done with lynx these days, or (for that matter) 
with images turned off.

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


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

Date: 20 Oct 1999 18:59:37 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: New Perl/TK Tutorial on perl.com
Message-Id: <7ul3ep$c53$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Larry Rosler 
<lr@hpl.hp.com>],
who wrote in article <MPG.1277a51f5f575f7898a0d6@nntp.hpl.hp.com>:
> Not much browsing is done with lynx these days, or (for that matter) 
> with images turned off.

Well, if people tolerate PDF, they might tolerate GIFs too.  But note
that PDF at least provides scaling/antialiasing.

But I do not tolerate even PDF as online-book format.  I'm spoiled.  I
have seen IBM online book.  Technology of 80s with nothing else
comparable up to today.  [And IBM is changing (in hurry!) its docs
from INF format to HTML.  When suits can do technical decisions...]

Ilya


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

Date: Wed, 20 Oct 1999 18:35:44 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Newbie - Help on installing perl
Message-Id: <4YnP3.22335$E_1.1216903@typ11.nn.bcandid.com>

In article <380DDFD3.C10CB4FE@chaos.wustl.edu>,
Elaine -HFB- Ashton  <elaine@chaos.wustl.edu> wrote:
>Noira Hadi wrote:
>> I am installing perl on a Sun machine running Solaris 2.6. I encountered
>> error message below. Need to know where I can get the C compiler? And do
>> I have to re-install the perl again?
>
>*sigh* Ask your system admin to install gcc if they haven't already. If
>you are root, well, may some deity help you. I would recommend reading
>the docs included with the source that might tell you how to install
>Perl. 

If you are root, you could install S/Linux, which comes with gcc
already installed.  Oh, and there are places from which you can
download gcc for Solaris, too.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Oct 19 1999
21 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 20 Oct 1999 18:10:04 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Substitution
Message-Id: <s0s1bsk8r0112@corp.supernews.com>

oliver.cookYTTFIT@ukonline.co.uk wrote:
: I'm having trouble with substitution. What I am trying to do, is write
: a perl script that will prepare my .plan file for display on the web.
: That means changing \n for <p> and changing *text* to <b>text</b>.

You might consider changing \n to <br> instead; it's a better mapping for
many purposes.

: I wrote this script, but it bombs with the error "Can't modify array
: deref in substitution at /usr/local/apache/cgi-bin/plan.pl line 6,
: near "s/\n/\<p\>/;""
: 
: The script is:
: 
: #!/usr/bin/perl
:  print "content-type:text/html\n\n";
:  open (PLAN, "/home/ollie/.plan") || die "could not open plan file";  
:  
:  @plan = <PLAN>;    
:  close(PLAN)||die "could not close plan file";  
:  @plan =~ s/\n/\<p\>/;       
:  print @plan; 

The lefthand side of a =~ must be a scalar lvalue for s/// (thought I must
admit I've often wanted to use this nonexistent syntax to iterate over a
list, substituing on each element!).  Here's how I'd code it:

  my $plan = do { local $/; <PLAN>; };
  close PLAN or die "could not close plan file: $!";

  $plan =~ s/\n/<p>/g;                 # Change newline to <p>
  $plan =~ s/\*(\w+)\*/<b>$1<\/b>/g;   # Change *word* to <b>word</b>

  print $plan;

-- 
   |   Craig Berry - cberry@cinenet.net
 --*--  http://www.cinenet.net/users/cberry/home.html
   |   "They do not preach that their God will rouse them
      a little before the nuts work loose." - Kipling


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

Date: 20 Oct 1999 11:33:55 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Substitution
Message-Id: <m1zoxdlw4s.fsf@halfdome.holdit.com>

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

Larry> Par, at best.

Larry>     s/\n/<p>/ for @plan;

Larry> Eagle.

Birdie.  Eagle woudld have been:

	s/\n/<p>/g for @plan;

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 20 Oct 1999 18:25:40 GMT
From: F Timothy Martin <fmartin@steel.ucs.indiana.edu>
Subject: upload file help
Message-Id: <7ul1f4$nv3$1@flotsam.uits.indiana.edu>

I'm a beginner so be gentle...

Is it possible to upload a file from an html form using cgi?  I know what
to do on the html side to get an upload form box, what do I need to write
in the cgi?  Right now I can get the name of the file, but can't retrieve
the actual file.

Many thanks in advance.

tim


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

Date: Wed, 20 Oct 1999 11:33:43 -0700
From: "Ed Toivanen" <et@telus.net>
Subject: Re: what is SHTML ?
Message-Id: <mYnP3.49$lR3.109473@news.bctel.net>


Martien Verbruggen <mgjv@wobbie.heliotrope.home> wrote in message
news:slrn80ogcj.1vv.mgjv@wobbie.heliotrope.home...
> On 19 Oct 1999 01:16:24 -0500,
> Abigail <abigail@delanet.com> wrote:
> > Ally Kwon (ewha95@shinbiro.com) wrote on MMCCXL September MCMXCIII in
> > <URL:news:380BF886.71538C91@shinbiro.com>:
> > ~~ i know what HTML is, but what is SHTML ?
> > ~~ how is it different from HTML ?
> >
> >
> > A lot. It has nothing at all to do with HTML. SHTML stands for
> >
> >    Standford High Throwing Midget League.
> >
> > Not to be confused with SFTML, the
> >
> >    Standford Far Throwing Midget League.
>
> Please do not encourage people to post offtopic questions to clp.misc.
> If you must answer, at least tell them something nonsensical, and also
> refer them to the correct group (alt.binaries.pictures.erotica.midgets
> or alt.sex.midgets, the only groups in my .newsrc mentioning midgets).
>
> Thank you
>
> Martien
> --
> Martien Verbruggen                      |
> Interactive Media Division              | "In a world without fences,
> Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
> NSW, Australia                          |


Why is it ok for you to post off topic, then?
Must be nice to be so special.

Ed




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

Date: Wed, 20 Oct 1999 13:36:12 -0500
From: Marshall Culpepper <marshalc@americasm01.nt.com>
Subject: Re: Working on an Array of Hashes: "using $_->{ }"
Message-Id: <380E0B9B.2B0AC3A7@americasm01.nt.com>

Pfash1 wrote:

> I will bestow great appreciation on the helper of:
>
> Trying to compare two arrays of hashes. There is confirmation of a match but
> when I try to use the $_->{ } to get string I end up with nothing. See my
> comments in the code below:

[cut]

I didn't see any immediate errors, but you've only shown part of your script so we can't exactly help all the
way...the best advice I can give is to check for the existance of the different variables you are having
trouble with using 'defined()'

~Marshall



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

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


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