[7465] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1090 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 27 17:07:19 1997

Date: Sat, 27 Sep 97 14:00:21 -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, 27 Sep 1997     Volume: 8 Number: 1090

Today's topics:
     Re: a2p (newbie question) samdie@ibm.net
     Re: alarm(n) works but not consistently ..... (Charles DeRykus)
     Re: array assignment problem. <doug@tc.net>
     Re: CD width CPAN ? <ajohnson@gpu.srv.ualberta.ca>
     Re: Counter not Incrementing Past 254? <rootbeer@teleport.com>
     Re: Formdata to File & Missing Data (Mike Stok)
     Re: Formdata to File & Missing Data <rootbeer@teleport.com>
     Re: help for user authentication <godfrey@hnashe.com>
     HELP! on Attaching files to email. (Rob Nedelcu)
     Help:  PerlIS, STDOUT, and gif images (Erik Y. Adams)
     Re: Help:  PerlIS, STDOUT, and gif images <rootbeer@teleport.com>
     Re: Many CGI/PERL forms don't work with Lynx? <rootbeer@teleport.com>
     Re: Memory fails me (Andrew M. Langmead)
     Re: Msdos version stumps perl users ! (Andrew M. Langmead)
     Re: Perl CGI Script Invoking Expect Script (Christopher Masto)
     Re: Perl Generator? (Danny Aldham)
     Re: Perl sockets (Andrew M. Langmead)
     Re: PERL with TCP/IP (Neil Briscoe)
     Re: Searching a directory <rootbeer@teleport.com>
     Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
     Re: sysread() question (Trudno zhit' v derevne bez nagana.)
     Re: Training in Bay Area <tupshin@shell3.ba.best.com>
     Re: Typeglob - Temporary Aliases <creede@worldnet.att.net>
     Re: Typeglob - Temporary Aliases (Mike Stok)
     Web Helpdesk <Slammy@postoffice.worldnet.att.net>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 27 Sep 97 11:12:54 -0400
From: samdie@ibm.net
Subject: Re: a2p (newbie question)
Message-Id: <342d233b$4$fnzqvr$mr2ice@news-s01.ny.us.ibm.net>

In <01bccb53$bc7d8cc0$8314410c@boris>, on 09/27/97 
   at 02, "Creede Lambard" <creede@worldnet.att.net> said:

> I dunno. I tried both
> a2p reorg.awk
> and
> a2p <reorg.awk

> and they both worked on my system. :\ If you didn't try redirecting stdin
> you might see if that works better for you, but it looks like you've tried a
> lot. :D

Yup. Tried that too. Still no output/error message.

-- 
-----------------------------------------------------------
samdie@ibm.net
-----------------------------------------------------------



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

Date: Sat, 27 Sep 1997 18:58:59 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: alarm(n) works but not consistently .....
Message-Id: <EH6KqC.6qp@bcstec.ca.boeing.com>

In article <EH3Eqx.Fzx@bcstec.ca.boeing.com>,
Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
 >In article <60e372$4nn@cnj.digex.net>,
 >Atiqullah Hashmi <hashmi@cnj.digex.net> wrote:
  > >
  > >   [ omitted ... ] 
 >
 >
 >You might have more luck with a select time as Tom
 >mentioned or a die/eval block, e.g,
 >
 >$SIG{ARLM} = sub { die "time out" };
 >LOOP: {
 >    alarm(10);
 >    eval {  read .... };
 >    alarm(0);
 >    if ($@ =~ /^time out/) { 
 >        print "timed out\n"; 
 >        next LOOP;
 >    } elsif ($@) {
 >      die "eval error: $@";
 >    } else {
 >        #  ok
 >    }
 >}


or, if Randal's looking,  you should change slightly:


 ...
 eval {
                local $SIG{__DIE__} = 'DEFAULT';
                local $SIG{ALRM} = sub { die "time out" };
                alarm(10);
                read .... 
 };
 alarm(0);


Safer... and cooler.


Regards,
--
Charles DeRykus


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

Date: 27 Sep 1997 11:10:29 -0400
From: Douglas McNaught <doug@tc.net>
To: "Doug" <doug@3dlabs.com>
Subject: Re: array assignment problem.
Message-Id: <m2en6an66y.fsf@ono.tc.net>

[mailed and posted]

"Doug" <doug@3dlabs.com.remove> writes:

> Hi,
>   Thanks for the regex improvement :)
> 
>    My question though I think has been mis-interpreted.   the following
> works
> 	@areas = ('database','news');
>    but the following doesn't
> 	@areas = ('database','news','personal');

Define "works".  Define "doesn't work".  Post more code so we can see
what you're doing.

-Doug
-- 
sub g{my$i=index$t,$_[0];($i%5,int$i/5)}sub h{substr$t,5*$_[1]+$_[0],1}sub n{(
$_[0]+4)%5}$t='encryptabdfghjklmoqsuvwxz';$c='fxmdwbcmagnyubnyquohyhny';while(
$c=~s/(.)(.)//){($w,$x)=g$1;($y,$z)=g$2;$w==$y&&($p.=h($w,n$x).h($y,n$z))or$x==
$z&&($p.=h(n$w,$x).h(n$y,$z))or($p.=h($y,$x).h($w,$z))}$p=~y/x/ /;print$p,"\n";


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

Date: Sat, 27 Sep 1997 13:56:05 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: CD width CPAN ?
Message-Id: <342D56C5.234D1FC4@gpu.srv.ualberta.ca>

Clay Irving wrote:
> 
> In <342c5cc0.16659959@noticias.ibernet.es> juan@tres.com (Juan) writes:
> 
> >Please, where can I purchase a CD width the CPAN?
> 
> O'Reilly's Perl Resource Kit will have CPAN on a CD-ROM. See:
> 
>   http://perl.oreilly.com/


But if you are just looking for CPAN on cdrom then Walnut Creek
offers a September 1997 release CPAN cdrom (with Perl 5.00401)
for just $39.95

   http://www.cdrom.com/titles/prog/perl.htm 

and cdaccess lists the same product for $25 

   http://www.cdaccess.com/html/pc/perl.htm

I don't have my Perl Journal issues on hand at the moment,
but I recall ads in there for Jon Orwant's 'Perl Developers Kit'
from Advice Press(?)... but I can't remember if a CPAN snap is
included or how recent the releases are. Might also be worth
checking into though.

regards
andrew


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

Date: Sat, 27 Sep 1997 07:57:34 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Vik Rubenfeld <VikR@aol.com>
Subject: Re: Counter not Incrementing Past 254?
Message-Id: <Pine.GSO.3.96.970927075421.5897N-100000@usertest.teleport.com>

On Fri, 26 Sep 1997, Vik Rubenfeld wrote:

>     # open counter
>     $counter = 0;
>     if (-e $cntfilename)
>     {
>     	open(COUNTER,"+<$cntfilename") || die("Can't open file \"$cntfilename\" : $!\n");
>     	read(COUNTER, $counter, 20);

In this application, why not just do this?

    $counter = <COUNTER>;

>     	truncate(COUNTER,0);
>     	close COUNTER;
>     }

You have a concurrency problem. Suppose that, at this point, another
process updates the counter? Now, we return to your process...

>     open(COUNTER,">>$cntfilename") || die("Can't open file \"$cntfilename\" : $!\n");

Now, you'd be appending new data after whatever the other process left.
That's not what you want!

>     print COUNTER ++$counter;
>     close COUNTER;

I think you could use the methods in Randal's fourth Web Techniques
column, which explains how to use flock() to avoid problems when multiple
processes need to modify one file. Hope this helps! 

   http://www.stonehenge.com/merlyn/WebTechniques/

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 27 Sep 1997 15:59:39 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Formdata to File & Missing Data
Message-Id: <60jahb$f5l@news-central.tiac.net>

In article <342cb9ba.3330560@news.ilstu.edu>,
 <wviecht@rs6000.cmp.ilstu.edu> wrote:
>I am conducting some psychological research over the internet. I wrote
>this script to take some formdata and save it to a text file. Now in
>some cases, people don't want to fill out all the fields or answer all
>the questions. Let's say I have three radio button like questions.
>Person 1 picks answers 3, 5, and 2. With the commands:
>
>print DATA "$in{question1}";
>print DATA " $in{question2}";
>print DATA " $in{question3}\n";
>
>I will get 3 5 2 in the output file.
>
>Let's say, Person 2 picks 2, no answer, 6.
>
>Then I will get 2 6 in the data file ...
>
>But in order to match the variables up when I import the data into
>some database, I want it to read 2   6 or 2 9 6 (where 9 will indicate
>that the data is missing). I hope I am making myself clear ...
>
>So how do I check for missing data and then write a value such as 9 or
>empty space into the spot where the answer ought to be???
>
>Any suggestions or comments?

One way to do it (and this is verbose...)
@questions = ('question1', 'question2', 'question3');
@answers = ();

foreach $question (@questions) {
  $answer = $in{$question};
  if (defined ($answer) && $answer ne '') {
    push (@answers, $answer);
  }
  else {
    push (@answers, '?');
  }
}
print DATA "@answers\n";

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Sat, 27 Sep 1997 13:03:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: wviecht@rs6000.cmp.ilstu.edu
Subject: Re: Formdata to File & Missing Data
Message-Id: <Pine.GSO.3.96.970927125915.11874F-100000@usertest.teleport.com>

On Sat, 27 Sep 1997 wviecht@rs6000.cmp.ilstu.edu wrote:

> Let's say I have three radio button like questions.
> Person 1 picks answers 3, 5, and 2. With the commands:
> 
> print DATA "$in{question1}";
> print DATA " $in{question2}";
> print DATA " $in{question3}\n";
> 
> I will get 3 5 2 in the output file.
> 
> Let's say, Person 2 picks 2, no answer, 6.
> 
> Then I will get 2 6 in the data file ...
> 
> But in order to match the variables up when I import the data into some
> database, I want it to read 2 6 or 2 9 6 (where 9 will indicate that the
> data is missing).

I'd probably use code something like this. (Well, really, I'd use CGI.pm
instead of cgi-lib.pl.  :-) 

    my @answers = @in{ qw/question1 question2 question3/ };
    for (@answers) {
	$_ = "[blank]" unless defined $_ and not /^\s*$/;
    }
    print DATA "@answers\n";

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Sat, 27 Sep 1997 17:21:30 +0100
From: Godfrey Smith <godfrey@hnashe.com>
To: brian d foy <comdog@computerdog.com>
Subject: Re: help for user authentication
Message-Id: <342D328A.8E9@hnashe.com>

brian d foy wrote:
> 
> In article <m3202gdkoj.fsf@windlord.Stanford.EDU>, Russ Allbery <rra@stanford.edu> wrote:
> 
> >Mike Wang <wangyj@sro.cig.mcel.mot.com> writes:
> >
> >> I want to make the browser to pop user's authenticaton window when my
> >> perl cgi program is called. Please don't tell me to use ".htaccess" or
> >> some thing like that. I only want to know if there is any solution to do
> >> the same within cgi program.
> >
> >No.
> >
> >You have to use .htaccess.  Sorry.  (And a CGI programming newsgroup is
> >where you really want to ask these sorts of questions.)
> 
> no you don't.  it's just a matter of sending the proper HTTP response.
> Perl can do lots if you just give it a chance :)
> 
> #!/usr/bin/perl
> 
> print <<'HTTP';
> Status: 401 Authentication Required
> Host: computerdog.com
> Content-type: text/plain
> 
> Authentication is required to access this resource
> HTTP
> 
> __END__
> 
> of course, you'll need to handle the response yourself, but that's
> the point, isn't it ;)
> 


how can I make this script read my password file?


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

Date: Sat, 27 Sep 1997 20:51:29 GMT
From: nedelcu@algonet.se (Rob Nedelcu)
Subject: HELP! on Attaching files to email.
Message-Id: <342d7130.18440775@news.algonet.se>

Hi!

I need some help on attaching files when emailing individuals who have
filled in their email adress in a form. Collecting it and sending a
message is no problem, but I need to send 2 files along with it as
word documents. How do I do this one? I've tried almost anything!

I'm using sendmail...

Please, any help would be very appreciated...

Best regs...

Rob


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

Date: Sat, 27 Sep 1997 10:08:46 -0800
From: erik@earthlink.net (Erik Y. Adams)
Subject: Help:  PerlIS, STDOUT, and gif images
Message-Id: <erik-ya023180002709971008460001@news.earthlink.net>

I have a minor problem with PerlIS.  Here's a sample script:

   open(MYGIF, "image.gif");
   binmode MYGIF;

   print "HTTP/1.0 200 OK\nContent-type: image/gif\n\n";

   binmode STDOUT;
   print <MYGIF>;

   close MYGIF;

So, if I configure IIS to use perl.exe for perl scripts, this works as
expected - i.e. the browser displays image.gif.  But, if I configure IIS to
use PerlIS.dll, the image won't display.

I've done some poking around, and it looks PerlIS.dll isn't letting me set
STDOUT to binmode.

Performance is suffering, and I'd like to figure out a clever solution to
this.  Any ideas?

Erik


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

Date: Sat, 27 Sep 1997 12:56:54 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Erik Y. Adams" <erik@earthlink.net>
Subject: Re: Help:  PerlIS, STDOUT, and gif images
Message-Id: <Pine.GSO.3.96.970927125404.11874E-100000@usertest.teleport.com>

On Sat, 27 Sep 1997, Erik Y. Adams wrote:

>    open(MYGIF, "image.gif");

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check of the return value after opening a
file.

>    binmode MYGIF;
> 
>    print "HTTP/1.0 200 OK\nContent-type: image/gif\n\n";
> 
>    binmode STDOUT;

I believe that binmode needs to be called before using the filehandle. But
I'm not an expert on it, since it does nothing on my machines. :-)

>    print <MYGIF>;
> 
>    close MYGIF;
> 
> So, if I configure IIS to use perl.exe for perl scripts, this works as
> expected - i.e. the browser displays image.gif.  But, if I configure IIS
> to use PerlIS.dll, the image won't display. 

Does it output the image in some mangled form?

> I've done some poking around, and it looks PerlIS.dll isn't letting me
> set STDOUT to binmode. 

Maybe if you set it before you print the other data; that's worth a try.
Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Sat, 27 Sep 1997 12:43:51 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Patrick Kellum <patrick@syix.com>
Subject: Re: Many CGI/PERL forms don't work with Lynx?
Message-Id: <Pine.GSO.3.96.970927123929.11874C-100000@usertest.teleport.com>

On 27 Sep 1997, Patrick Kellum wrote:

> I've noticed for a while that quite a few PERL scripts have trouble with
> Forms and Lynx. 

Perl doesn't know whether the browser at the other end is Lynx or not. In
fact, when the perl binary starts up a CGI script, it doesn't even know
that there's a server involved - if there is.

> If I enter the info into a form and submit it the script tells me I
> forgot something. 

If you can make a small script (say, ten lines or so) which fails to get
the info it needs only when the remote browser is Lynx, please post it
here so that we can tell whether it's a bug in Lynx or in your code. :-)

Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Sat, 27 Sep 1997 16:26:13 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Memory fails me
Message-Id: <EH6Dnq.6rK@world.std.com>

"Rufus" <rste@greencathedral.com> writes:

>How do I pick out character n of a string of length N?

>I can clearly do this using substr, but I am sure that once I could clearly
>do it the right way.

Have you heard the phrase "There is more than one way to do it?"

There are a couple of different ways of getting an characters out of a
scalar, but certain methods work better in different situations.

For a single substring out of a scalar, substr is probably the best
you are going to do.

  $char = substr($string, $pos, 1);

If you have many substrings you want to extract at once, maybe using
unpack() with the "A" template option.

     ($uid, $pid, $ppid, $sched, $stime, $tty, $time, $cmd) =
          unpack 'A8A6A6A3A10A9A5A*', $_;

And if you are going to be looping through individual characters, you
might want to break it up into an list of one character strings.

       @chars = split //, $string;
       for $char ( @chars) {
       }

-- 
Andrew Langmead


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

Date: Sat, 27 Sep 1997 16:32:20 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Msdos version stumps perl users !
Message-Id: <EH6Dxw.94A@world.std.com>

"Creede Lambard" <fearless@io.com> writes:

>This is a multi-part message in MIME format.
(why?)

>This seems really odd. CLS has been in DOS since there was DOS. What =
>versions of DOS and perl are you using? 

Actualy, CLS got added in version 2. You did have BASICA though, and
it had CLS.

The problem might have something to do with "CLS" being built into
COMMAND.COM, and not a separate executable. Does 
   system('COMMAND /C cls');

work?

-- 
Andrew Langmead


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

Date: 27 Sep 1997 19:58:40 GMT
From: chris@netmonger.net (Christopher Masto)
Subject: Re: Perl CGI Script Invoking Expect Script
Message-Id: <60johg$d2q$1@schenectady.netmonger.net>

In article <874721085.24031@dejanews.com>,  <ads@websp.com> wrote:
>I am currently writing a set of Perl CGI scripts that allow adding users,
>changing passwords,.....  I plan to integrate Perl and Expect together.
>Well my first step was setting up sudo.  Done.  That works.  Next I
>thought I'd better write some expect scripts.  Here is my expect_passwd
>script:

[expect script that calls sudo passwd]

I get really nervous when people do stuff like this.  IMHO, you're
much better off using a more direct method.  BSD has, for example,
chpass, which allows you to generate the new encrypted password
yourself and just call chpass to put it into place.  Can't you make
your program setuid instead of calling sudo?
-- 
= Christopher Masto        = chris@netmonger.net = http://www.netmonger.net/  =
= NetMonger Communications = finger for  PGP key = $19.95/mo unlimited access =
= Director of Operations   =   (516)  221-6664 	 = mailto:info@netmonger.net  =



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

Date: 27 Sep 1997 11:11:26 -0700
From: danny@lennon.postino.com (Danny Aldham)
Subject: Re: Perl Generator?
Message-Id: <60ji8e$f4k$1@lennon.postino.com>

jack (jss@mailzone.com) wrote:
: I was wondering if anyone knows of a Perl generator where you either
: use common, pre-written commands (drop & drag) or write simple
: statements that are expanded into Perl modules?  I need to write some
: Perl and am pretty much a neophyte.

Sure, something like Visual Perl , soon to be release by MS. ;-)

--
Danny Aldham           SCO Ace , MCSE , JAPH , DAD
I wak'd, she fled, and day brought back my night. jm


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

Date: Sat, 27 Sep 1997 16:39:57 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl sockets
Message-Id: <EH6EAL.Bv0@world.std.com>

cubranic@cs.ubc.ca (Davor Cubranic) writes:

>However, I get the following situation: first client connects fine, second
>connects fine, but at that moment the first client's connection is dropped!
>Why? 

The Filehandle is bound to the global symbol NS, the next time you use
NS, it closes it filehandle it was previously bound to.

You can do some special typeglob trickery, or you can use the
IO::Socket module:

use IO::Socket;
# ...
    my $socket = S->accept();
    push @sockets, $socket;

-- 
Andrew Langmead


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

Date: 27 Sep 1997 20:16:40 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: PERL with TCP/IP
Message-Id: <memo.19970927211639.25841A@skep.compulink.co.uk.cix.co.uk>

In article <01bccb29$182c8600$144eaacf@miked>, miked@psiaustin.com
(Michael Duffy) wrote:

> I am trying to write a PERL script that will send an automatic "Thank yo
> u
> for visiting"   e-mail message when someone comes to our web site.
>
> Do you have any ideas on how to do this directly with TCP/IP without usi
> ng
> our mail.exe (which is outside of our firewall) or without using UNIX
> sendmail (we have MS IIS 3.0).
>
> This simple concept has turned into a major hassle.
>
> Your help would be appreciated.
>

Yup, you need to talk SMTP - you should be able to talk SMTP to the
Internet Connector on your Exchange server.

If the machine you're sending from is NT based, you might want to request
a copy of smtp.pl from me.  I hacked it up from the smtp.pm available from
CPAN - cos the module wouldn't work for me on that platform.

Regards
Neil




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

Date: Sat, 27 Sep 1997 12:51:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: TechMaster Pinyan <jefpin@bergen.org>
Subject: Re: Searching a directory
Message-Id: <Pine.GSO.3.96.970927124457.11874D-100000@usertest.teleport.com>

On Sat, 27 Sep 1997, TechMaster Pinyan wrote:

> use this:
> opendir(DIR, "/your/dir/tobe/opened");

As with open(), it's important to always check the return value of
opendir, since it won't necessarily succeed. 

> @contents = <DIR>;

That's not going to read the directory handle DIR!

> close (DIR); # or is it closedir(DIR); ???

Good question! In your copy of the Perl docs, you should be able to find
the answer.

> that will give you the contents of a directory.

Not likely. Please, learn more Perl before you answer more questions. 
And, before you post your answers, try them out to make sure that they
work reliably. That will make things nicer for all of us. Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 27 Sep 1997 19:25:38 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <60jmji$r6g$1@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 20 Sep 1997 21:05:35 GMT and ending at
27 Sep 1997 06:26:12 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" e-mail address and name.
    - Original Content Rating is the ratio of the original content volume
      to the total body volume.
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.

Excluded Posters
================

perlfaq-suggestions@mox.perl.com

Totals
======

Total number of posters:  389
Total number of articles: 871 (321 with cutlined signatures)
Total number of threads:  329
Total volume generated:   1524.7 kb
    - headers:    578.5 kb (11,938 lines)
    - bodies:     879.6 kb (26,398 lines)
    - original:   635.1 kb (19,353 lines)
    - signatures: 64.5 kb (1,420 lines)
Original Content Rating: 0.7220

Averages
========

Number of posts per poster: 2.24
    median: 1 post
    mode:   1 post - 259 posters
    s:      4.86 posts
Number of posts per thread: 2.65
    median: 2 posts
    mode:   1 post - 106 threads
    s:      1.79 posts
Message size: 1792.5 bytes
    - header:     680.1 bytes (13.7 lines)
    - body:       1034.1 bytes (30.3 lines)
    - original:   746.6 bytes (22.2 lines)
    - signature:  75.8 bytes (1.6 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   73   127.9 ( 61.4/ 50.8/ 31.5)  Tom Phoenix <rootbeer@teleport.com>
   32    56.8 ( 21.4/ 28.1/ 15.5)  Jeremy D. Zawodny <zawodny@hou.moc.com>
   30    64.0 ( 16.4/ 38.2/ 23.6)  Mike Stok <mike@stok.co.uk>
   28    44.3 ( 17.0/ 27.3/ 14.8)  Tad McClellan <tadmc@flash.net>
   23    34.5 ( 15.8/ 18.7/ 11.7)  Doug Seay <seay@absyss.fr>
   18    25.1 (  9.1/ 15.7/  9.3)  Andrew M. Langmead <aml@world.std.com>
   14    26.9 ( 10.8/ 16.1/ 11.9)  Russell Odom <russ@mail.org.uk>
   13    20.0 (  8.0/ 12.0/  5.7)  Jason Gloudon <jgloudon@bbn.com>
   11    17.1 (  7.5/  7.4/  4.4)  brian d foy <comdog@computerdog.com>
   10    23.7 (  8.6/ 15.0/  9.0)  abigail@fnx.com

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

 127.9 ( 61.4/ 50.8/ 31.5)     73  Tom Phoenix <rootbeer@teleport.com>
 105.9 (  0.5/105.4/ 95.7)      1  "Ramon Rodriguez" <ramonr@earthlink.net>
  64.0 ( 16.4/ 38.2/ 23.6)     30  Mike Stok <mike@stok.co.uk>
  56.8 ( 21.4/ 28.1/ 15.5)     32  Jeremy D. Zawodny <zawodny@hou.moc.com>
  44.3 ( 17.0/ 27.3/ 14.8)     28  Tad McClellan <tadmc@flash.net>
  34.5 ( 15.8/ 18.7/ 11.7)     23  Doug Seay <seay@absyss.fr>
  26.9 ( 10.8/ 16.1/ 11.9)     14  Russell Odom <russ@mail.org.uk>
  25.1 (  9.1/ 15.7/  9.3)     18  Andrew M. Langmead <aml@world.std.com>
  23.7 (  8.6/ 15.0/  9.0)     10  abigail@fnx.com
  23.2 (  5.3/ 16.3/ 13.0)     10  Greg Bacon <gbacon@cs.uah.edu>

Top 10 Posters by OCR (minimum of five posts)
==============================================

          (kb)    (kb)
OCR       orig /  body  Posts  Address
------  --------------  -----  -------

0.8253     7.0 /   8.4      7  Matthew Cravit <mcravit@best.com>
0.7976     4.2 /   5.3      6  Scott McMahan <scott@lighthouse.softbase.com>
0.7953    13.0 /  16.3     10  Greg Bacon <gbacon@cs.uah.edu>
0.7697     1.9 /   2.4      5  Trudno zhit' v derevne bez nagana. <alex@kawo2.rwth-aachen.de>
0.7641     6.0 /   7.8      6  Terry Michael Fletcher - PCD ~ <tfletche@pcocd2.intel.com>
0.7578     4.3 /   5.7      5  TechMaster Pinyan <jefpin@bergen.org>
0.7415     2.1 /   2.8      6  "Michael A. Watson" <fishrman@shell.wco.com>
0.7361    11.9 /  16.1     14  Russell Odom <russ@mail.org.uk>
0.7021     2.8 /   4.0      5  Bennett Todd <bet@network.rahul.net>
0.6959     6.5 /   9.3      8  Benjamin Holzman <bholzman@earthlink.net>

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

          (kb)    (kb)
OCR       orig /  body  Posts  Address
------  --------------  -----  -------

0.6176     3.8 /   6.2      6  Randal Schwartz <merlyn@stonehenge.com>
0.6016     4.4 /   7.4     11  brian d foy <comdog@computerdog.com>
0.5952     9.0 /  15.0     10  abigail@fnx.com
0.5918     9.3 /  15.7     18  Andrew M. Langmead <aml@world.std.com>
0.5839     7.6 /  12.9     10  "Creede Lambard" <fearless@io.com>
0.5511    15.5 /  28.1     32  Jeremy D. Zawodny <zawodny@hou.moc.com>
0.5408    14.8 /  27.3     28  Tad McClellan <tadmc@flash.net>
0.4726     5.7 /  12.0     13  Jason Gloudon <jgloudon@bbn.com>
0.4129     1.0 /   2.4      5  Ron Savage <rpsavage@ozemail.com.au>
0.2976     1.3 /   4.3      5  Peter Prymmer <pvhp@forte.com>

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   10  perl mail on solaris
    9  Julian Date Routine
    9  Perl to Java Compiler?
    8  Perl <=> C Server
    8  Need help with pesky warning...
    8  cgi data
    8  "here document" method of print erroring
    8  Statistics for comp.lang.perl.misc
    7  Regular expression
    7  printing variables...

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

 110.5 (  2.7/107.6/ 97.3)      4  Convert VB to Perl
  18.5 (  7.1/ 10.7/  6.5)      9  Perl to Java Compiler?
  16.2 (  5.6/ 10.3/  9.2)      8  Statistics for comp.lang.perl.misc
  15.9 (  6.7/  8.0/  4.3)     10  perl mail on solaris
  15.8 (  5.8/  9.1/  4.1)      8  cgi data
  14.7 (  4.7/  9.6/  5.5)      7  Date Algorithm needed
  14.5 (  5.8/  7.7/  4.7)      9  Julian Date Routine
  13.8 (  6.4/  6.5/  4.4)      8  "here document" method of print erroring
  12.9 (  4.1/  8.3/  6.1)      5  Perl5.004 and Solaris 2.6
  12.0 (  5.3/  6.5/  3.9)      8  Need help with pesky warning...

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      15  comp.lang.perl.modules
       8  de.comp.lang.perl
       6  comp.lang.perl
       5  comp.unix.programmer
       3  git.general
       3  teleport.support.cgi
       3  atl.general
       2  comp.lang.javascript
       2  alt.fan.e-t-b
       2  comp.unix.shell

Top 10 Crossposters
===================

Articles  Address
--------  -------

      15  Jackson Dodd <jackson@usenix.org>
       3  Jordan Samuels <samueljo@il.us.swissbank.com>
       2  Andreas Dieberger <NOSPAMandreas.dieberger@acm.org>
       2  NerveGas@nospam.inconnect.com
       2  "Authorized User" <matthew.kravitz@systecinc.com>
       2  sico@msh.xs4all.nl
       2  Tad McClellan <tadmc@flash.net>
       2  annerose@geocities.com
       2  alan.tidwell@conted.gatech.edu.removethis
       2  peter@widgetworks.com


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

Date: 27 Sep 1997 15:29:45 GMT
From: alex@kawo2.rwth-aachen.de (Trudno zhit' v derevne bez nagana.)
Subject: Re: sysread() question
Message-Id: <60j8p9$q34$1@news.rwth-aachen.de>

In article <6r0j06.3n.ln@localhost>, tadmc@flash.net says...
>: can someone please explain me, what i am doing wrong?
>: I am trying to sysread a byte sequence from a TCP-socket.
>: The first byte contains the number of bytes to follow:
>Perl FAQ, part 5:
>
>   "How can I make a filehandle local to a subroutine?  
>    How do I pass filehandles between subroutines?  
>    How do I make an array of filehandles?"

Tad,

thanks for help. You're right - i had to look into the FAQ.
Just forgot to do it after looking through the Camel and the 
scripts from CPAN the whole yesterday.

I guess the Perl is just a bad language for sockets and 
server stuff and stop converting my C-code to Perl.

Greetings
Alex

-- 
russkaya literatura v ------ http://www.simplex.ru/lit.html
internete http://www.friends-partners.org/~afarber/lit.html
java preferans ------------ http://www.simplex.ru/pref.html
besplatnye kommercheskie ob'yavleniya http://www.simplex.ru



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

Date: 27 Sep 1997 19:39:04 GMT
From: Tupshin Harper <tupshin@shell3.ba.best.com>
Subject: Re: Training in Bay Area
Message-Id: <60jnco$4u4$1@nntp1.ba.best.com>

Ali Ersheid <ali@cybercash.com> wrote:
:  Does anyone know of any Perl training for beginners in the SF Bay Area?

UC Berkeley Extension has night classes in Perl at various locations every
semester.
Home page at:
http://www.unex.berkeley.edu:4243/
Current Perl info at:
http://www.unex.berkeley.edu:4243/cat/cis1.html#929
The only course I find for this fall is Perl 5 Programming for the
World Wide Web, but if that's what you're looking for, the teacher
Jeff Okamoto is quite good.


-- 
-Tupshin Harper
-Product Marketing Manager
-Farallon Communications, Inc.


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

Date: 27 Sep 1997 14:56:55 GMT
From: "Creede Lambard" <creede@worldnet.att.net>
Subject: Re: Typeglob - Temporary Aliases
Message-Id: <01bccb55$997d0fa0$8314410c@boris>

$b = 10 because that's what you set it to in the first line. :D

I think the key to what's going on here is in line 3, where you create a
*local* group of variables called *b inside the block. That creates local
instances of $b, %b, @b, etc. Lines 4 and 5 effectively make these local
$b, %b, @b, etc. aliases for $a, %a, @a, etc. within the block. So, when
you set the local $b to 20, it sets $a to 20 as well, then when you exit
the block $a is still the same because it wasn't local but $b reverts back
to its original value of 10.

HTH,

-- Creede


Kevin Bass <akil1@mindspring.com> wrote in article
<60j3n6$e94@camel3.mindspring.com>...
> On page 43 of Advanced Perl Programming (O'Reilly & associates, Inc.)
> the answer to the problem below is $a = 20 and $b = 10.  In solving
> this problem, I got the result of $a = 20 and $b = 20.  Please explain
> why $b = 10.
> 
> $b = 10;
> {
> 	local *b;
> 	*b = *a;
> 	$b = 20;
> }
> 
> print $a;
> print $b;
> 
> 
> Kevin Bass
> 
> 


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

Date: 27 Sep 1997 15:54:22 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Typeglob - Temporary Aliases
Message-Id: <60ja7e$evv@news-central.tiac.net>

In article <60j3n6$e94@camel3.mindspring.com>,
Kevin Bass <akil1@mindspring.com> wrote:
>On page 43 of Advanced Perl Programming (O'Reilly & associates, Inc.)
>the answer to the problem below is $a = 20 and $b = 10.  In solving
>this problem, I got the result of $a = 20 and $b = 20.  Please explain
>why $b = 10.
>
>$b = 10;
>{
>	local *b;
>	*b = *a;
>	$b = 20;
>}
>
>print $a;
>print $b;

I get 

2010

printed out (perl 5.004_04 {a trial version}, 5.003) when I cut & pasted
your code into a file and ran it.  

That's because the local *b has the effect of stashing a copy of
everything currently called b that isn't a lexical until the end of the
block, and that includes $b. 

The simpler:

$b = 10;
@b = (1 .. 3);
{
        local $b;
        $b = 20;
        @b = (5 .. 10);
}

print "scalar $b, array (@b)\n";

prints scalar 10, array (5 6 7 8 9 10) as all we made a local copy of was
the scalar $b.  Changing the local $b to local *b makes copies of
everything called b, so $b and @b are both stashed and restored.

The *b = *a makes the local b an alias for a inside the block, as there's
no localaisation of a there's just one copy of things called a floating
around so the value set inside the block isn't discarded.

I hope that that makes some sense...

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 27 Sep 1997 16:26:52 GMT
From: "Samuel Lam" <Slammy@postoffice.worldnet.att.net>
Subject: Web Helpdesk
Message-Id: <60jc4c$bef@bgtnsc03.worldnet.att.net>

I'm trying to install a Web Helpdesk (it was downloaded from Capitol
Technologies) and mainly consists of a bunch of HTML files and a few Perl
scripts.  Everything appears to be installed correctly by when I bring the
site up I get the following error message:

ERROR: HTTPd: Malformed header from script 

followed by the filename of the Perl script.  I have everything running on
Solaris 2.5 and HTTPd 1.5.2.  I'm kind of new at this, so I don't know a
whole lot about Perl or HTTPd, so I can't provide a much more detail than
that.  Any help on the matter would be greatly appreciated.  Thanks.

Samuel Lam


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 1090
**************************************

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