[10949] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4550 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 5 03:17:29 1999

Date: Tue, 5 Jan 99 00:00:31 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 5 Jan 1999     Volume: 8 Number: 4550

Today's topics:
        BEGIN { local $/="\n" } clobbers global $/ (Alan Curry)
    Re: BEGIN { local $/="\n" } clobbers global $/ <tchrist@mox.perl.com>
    Re: BEGIN { local $/="\n" } clobbers global $/ <dgris@moiraine.dimensional.com>
    Re: BEGIN { local $/="\n" } clobbers global $/ <ajohnson@gatewest.net>
        bulletin board w/o registering kurweb@mailexcite.com
    Re: Downloading files : help !! <chatmaster@c-zone.net>
        fork under Win32 -- Activestate!? <richardb@byu.edu>
        Getting at stderr <evs@sds.lcs.mit.edu>
    Re: hash of hashes (Tad McClellan)
    Re: hash of hashes <chatmaster@c-zone.net>
        OK I give up (After a WEEK!) (Marc Austin)
    Re: OK I give up (After a WEEK!) (Shirley Fowler)
    Re: Perl file handling (Tad McClellan)
        Perl help needed! (Bill )
    Re: Please Help!! (Tad McClellan)
    Re: Retrospective on comp.lang.perl.moderated? (Ronald J Kimball)
    Re: Retrospective on comp.lang.perl.moderated? (Ronald J Kimball)
    Re: Retrospective on comp.lang.perl.moderated? (John Stanley)
        Simple sockets <shawn@liveassist.com>
    Re: Thanks! and happy new year! <chatmaster@c-zone.net>
    Re: Unusual behavior of the int function. (Pythagoras Watson)
    Re: When hashing won't work... (Brendan O'Dea)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Tue, 05 Jan 1999 05:21:47 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: BEGIN { local $/="\n" } clobbers global $/
Message-Id: <Ljhk2.581$NN6.2743@news14.ispnews.com>

The behavior of this script changed between 5.004_04 and 5.005_02:

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

BEGIN { local $/="\n"; }

print(defined($/),"\n");

5.004_04 does what I expected: it doesn't change the global $/, which was
already a \n since that's the default value. 5.005_02 somehow leaves the
global $/ undefined after the BEGIN block, which is surprising, since that
wasn't even its previous value. What happened?

In case you're wondering, in the real code from which my example is derived,
I used local $/="\n" in a module's import function, just in case some other
module's import function has done something to it.

On further investigation, I found that the surprising behavior can be seen in
an even smaller example:

#!/usr/bin/perl

BEGIN { print(defined($/),"\n"); }

This shows that on entry to a BEGIN block, the global $/ loses its default
value. Why?

Complete perl -V follows (it's from an rpm at contrib.redhat.com)

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=linux, osvers=2.0.35, archname=i386-linux-thread
    uname='linux caliban.xs4all.nl 2.0.35 #2 sat jul 18 01:37:18 cest 1998 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.7.2.3
    cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Aug  9 1998 10:17:03
  @INC:
    /usr/lib/perl5/5.00502/i386-linux-thread
    /usr/lib/perl5/5.00502
    /usr/lib/perl5/site_perl/5.005/i386-linux-thread
    /usr/lib/perl5/site_perl/5.005
    .
-- 
Alan Curry                                echo cnpzna@pdp.pbz | tr a-z n-za-m
The lbxproxy program has various options, all of which are optional.
                                                               -- lbxproxy(1)


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

Date: 5 Jan 1999 06:13:40 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: BEGIN { local $/="\n" } clobbers global $/
Message-Id: <76saik$7sb$1@csnews.cs.colorado.edu>


In comp.lang.perl.misc, pacman@defiant.cqc.com (Alan Curry) writes:

:The behavior of this script changed between 5.004_04 and 5.005_02:
:
:#!/usr/bin/perl -w
:use strict;
:
:BEGIN { local $/="\n"; }
:
:print(defined($/),"\n");
:
:5.004_04 does what I expected: it doesn't change the global $/, which was
:already a \n since that's the default value. 5.005_02 somehow leaves the
:global $/ undefined after the BEGIN block, which is surprising, since that
:wasn't even its previous value. What happened?

You must e seeing something I'm not:

    % perl5.00404 -le 'BEGIN { local $/ = "\n" } print defined $/'
    1
    % perl5.00502 -le 'BEGIN { local $/ = "\n" } print defined $/'
    1
    % perl5.00554 -le 'BEGIN { local $/ = "\n" } print defined $/'
    1

:On further investigation, I found that the surprising behavior can be seen in
:an even smaller example:
:
:#!/usr/bin/perl
:BEGIN { print(defined($/),"\n"); }

Again, I don't see that:

    % perl5.00404 -le 'BEGIN {  print defined $/ }'
    1
    % perl5.00502 -le 'BEGIN {  print defined $/ }'
    1
    % perl5.00554 -le 'BEGIN {  print defined $/ }'
    1

What am I missing?  

--tom
-- 
 "Everything should be made as simple as possible, but not simpler."
		 -- Albert Einstein.


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

Date: 04 Jan 1999 23:49:00 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: BEGIN { local $/="\n" } clobbers global $/
Message-Id: <m3vhimb4f7.fsf@moiraine.dimensional.com>

[posted and mailed]

Tom Christiansen <tchrist@mox.perl.com> writes:

> Again, I don't see that:
> 
>     % perl5.00404 -le 'BEGIN {  print defined $/ }'
>     1
>     % perl5.00502 -le 'BEGIN {  print defined $/ }'
>     1
>     % perl5.00554 -le 'BEGIN {  print defined $/ }'
>     1
> 
> What am I missing?  

I don't know, but I shee the same problem with _02

    $ perl5.00502 -le 'BEGIN{ print defined $/ } '
    
    $

It appears to have been fixed, though.

    $ perl5.00503 -le 'BEGIN{ print defined $/ } '
    1
    $ perl5.00553 -le 'BEGIN{ print defined $/ } '
    1
    $ perl5.00554 -le 'BEGIN{ print defined $/ } '
    1
    $ 

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Tue, 05 Jan 1999 01:46:47 -0600
From: Andrew Johnson <ajohnson@gatewest.net>
Subject: Re: BEGIN { local $/="\n" } clobbers global $/
Message-Id: <3691C367.7634FDDB@gatewest.net>

Daniel Grisinger wrote:
> 
> [posted and mailed]
> 
> Tom Christiansen <tchrist@mox.perl.com> writes:
> 
> > Again, I don't see that:
> >
> >     % perl5.00404 -le 'BEGIN {  print defined $/ }'
> >     1
> >     % perl5.00502 -le 'BEGIN {  print defined $/ }'
> >     1
> >     % perl5.00554 -le 'BEGIN {  print defined $/ }'
> >     1
> >
> > What am I missing?
> 
> I don't know, but I shee the same problem with _02
> 
>     $ perl5.00502 -le 'BEGIN{ print defined $/ } '
> 
>     $

odd... I don't see with 5.00502:

    $ perl -le 'BEGIN{print defined $/}'
    1
    $ perl -v

    This is perl, version 5.005_02 built for i586-linux
[snip]

regards
andrew


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

Date: Tue, 05 Jan 1999 07:05:48 GMT
From: kurweb@mailexcite.com
Subject: bulletin board w/o registering
Message-Id: <76sdkc$fg1$1@nnrp1.dejanews.com>

Does anyone know any bulletin board scripts that do not require visitors to
register a username and password?

Thanks!

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


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

Date: Mon, 04 Jan 1999 23:53:14 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Downloading files : help !!
Message-Id: <3691C4EA.965ADA51@c-zone.net>

[Posting and CC mail]

Sven Delmeiren wrote:
> 
> Hi everyone !!
> 
> I'm writing some sort of database containing files which can be
> downloaded. However, I'd like to see who downloads which files.
> Therefore I can use
> 
> print "Content-type: application/zip\n\n";
> open (DL, "<test.zip");
>    while (<DL>) {
>              print ();
>    }
> close (DL);
> 
> but, when the user gets the "Save as" window as to where he can save
> the file, it doesn't show test.zip as the filename for the file to be
> saved, but login2.cgi, the name of the cgi script. Can anyone tell me
> how I can let it show up the correct filename ??
> 
> Thanks in advance,
> 
> Sven Delmeiren

That's not so great, or effective. Go check out your local CPAN mirror
and browse through the modules and make your life a little easier. :-)
-- 
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application


       Copyright ) 1999 TRG Software and The Link Worm.


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

Date: Mon, 04 Jan 1999 22:05:15 -0700
From: Richard Bateman <richardb@byu.edu>
Subject: fork under Win32 -- Activestate!?
Message-Id: <36919D8B.A94E42A6@byu.edu>

Hi... I'm fairly new to perl, and I've been working with CGIs a lot... I
recently created a Web based email client, but now I'm trying to figure
out how to do the server.  I seem to have run into a brick wall as far
as spawning child processes to process the requests.  I figured out how
to have a program wait on a port, in this case port 110, but only one
person can connect to it at a time.  Does anybody know a way to work
around the missing "fork" function in WindowsNT?  I don't know if I'll
be able to check this, so if you could email me any input at
"richardb@byu.edu" I'd really appreciate it.  If you can't, I will try
to check for a reply later.

Thanx in advance,

Richard Bateman
Perl Beginner
richardb@byu.edu



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

Date: Tue, 5 Jan 1999 01:31:41 -0500
From: "David Evans" <evs@sds.lcs.mit.edu>
Subject: Getting at stderr
Message-Id: <76sbnu$ev2$1@grapevine.lcs.mit.edu>

I am trying to find a way to use the stderr output in a perl script.  For
example, I want to do:

 open(ROUT, "command |")
 while (<ROUT>) {
     print;
 }

But get the command's <stderr> output instead of its stdout.

Any suggestions?

Thanks,

--- Dave
evs@sds.lcs.mit.edu




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

Date: Mon, 4 Jan 1999 22:33:16 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: hash of hashes
Message-Id: <cm4s67.kg2.ln@magna.metronet.com>

Ernesto Gianola (netog@ziplink.net) wrote:

: In Perl you can assign a values to a hash of hashes as so.
: $hash{$key1}{$key2} = $value;

: But is it possible to assign it mulitple values?
: Why doesn't this work.

: $hash{$key1}{$key2} = [@values]


   That *does* work, so I guess you have no problem then  ;-)


--------------------
#!/usr/bin/perl -w

@values = qw/one two three four five/;

$hash{key1}{key2} = [@values];

foreach ( @{$hash{key1}{key2}} ) {
   print "$_\n";
}
--------------------

output:
one
two
three
four
five


   But since you already have it in an array, there is no need to
   copy it into an anonymous array (that's what the [] brackets
   are doing):


      $hash{key1}{key2} = \@values;



   You should read the 'perlref.pod' man page if you want
   to use references. (see 'perllol.pod' too while you are at it)


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


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

Date: Tue, 05 Jan 1999 00:01:26 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: hash of hashes
Message-Id: <3691C6D6.E9BF87E9@c-zone.net>

Ernesto Gianola wrote:
> 
> Hello. I have a simple question.
> 
> In Perl you can assign a values to a hash of hashes as so.
> $hash{$key1}{$key2} = $value;
> 
> But is it possible to assign it mulitple values?
> Why doesn't this work.
> 
> $hash{$key1}{$key2} = [@values]
> 
> thanks,
> 
> Ernesto

And why wouldn't it? Am I missing something?.. What are you trying to
do?

-- 
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application


       Copyright ) 1999 TRG Software and The Link Worm.


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

Date: Mon, 04 Jan 1999 22:24:42 -0800
From: placeit@easyad.com (Marc Austin)
Subject: OK I give up (After a WEEK!)
Message-Id: <placeit-0401992224420001@blv-lx100-ip18.nwnexus.net>


I need help with a script... bad.

The subroutine below is supposed to look in the file "temp.txt".
"temp.txt" is a two column text file that contains email address
and passwords... it looks like this...

joeblow@cool.com MyPasswd
joeblow2@cool.com  MyPasswd2

and so on...

if Joe loses his password, I want him to be able to request it again
using a simple online form...

Basically it should work like this...

Joe will submit his email address (requesting his lost password)
the script will look to see if it's in  the temp.txt file.  if Joe
Blows email address is in the text file then email joe his password...

Here's what I have, but when I get to the print statement, it is
printing the last line in the file, not the line containing
joeblows email address.

If anyone can help, I'd really appreciate it.




#!/usr/bin/perl

$email_file = "temp.txt";
$email = "someone\@xxxxx.com";

&split_key;

sub split_key {
$email_found = 0;

open(KEYEMAIL,"$email_file") || die "can't open $email_file\n";
@keyemail = <KEYEMAIL>;
chop(@keyemail);
close(KEYEMAIL);

foreach (@keyemail)  {

($field1,$field2) = split(/\\t/);

   if ($field2 = $email) {   #changed this
     $email_found = 1;
   }
}
if ($email_found == 1) {

   print "Content-type: text/html\n";
   print "\n";
   print "<html><head><title>Success!</title></head>\n";
   print "<body>\n";
   print "<center>This is a test<p>Field1 - $field1<p>Field2 - $field2
<p></center></body></html>\n";

}
}


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

Date: Tue, 05 Jan 1999 07:12:37 +0000
From: email@domain.com (Shirley Fowler)
Subject: Re: OK I give up (After a WEEK!)
Message-Id: <email-0501990712380001@pm5-106.nildram.co.uk>

> If anyone can help, I'd really appreciate it.

Do a Dejanews search on "subject line".

> #!/usr/bin/perl

The FAQ should recommend use of the -w switch. This warns about various
constructs which are frequently wrong, the result of mistyping
or an oversight.

use strict;

is useful, too.

> open(KEYEMAIL,"$email_file") || die "can't open $email_file\n";

some people write this as:

 open( KEYEMAIL,"$email_file" ) 
   or die "Can't open $email_file : $!";

The docs explain why.

Read up on the differences between '=', '==' and 'eq'.


Hope this helps.

Ben.

-- 
<http://www.leedsnet.com/> The public information service for and about Leeds and the West Riding.
<http://www.leedsnet.com/NetCall800/intro.html> Click - now you're talking.


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

Date: Mon, 4 Jan 1999 22:26:21 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Perl file handling
Message-Id: <d94s67.kg2.ln@magna.metronet.com>

fff (regevs@mishkei.org.il) wrote:

: A rather basic question:

: I have an ascii file, and a line number. All I want to do is delete the Nth
: line of the file. An alternative question might be, how can I quickly remove
: the Nth cell from an array.


   Perl FAQ, part 5:

      "How do I change one line in a file/
       delete a line in a file/
       insert a line in the middle of a file/
       append to the beginning of a file?"



   from 'perlvar' man page:

=item $.

The current input line number for the last...


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


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

Date: Tue, 05 Jan 1999 03:47:20 GMT
From: bcabana@"nospam"acun.com (Bill )
Subject: Perl help needed!
Message-Id: <36918b36.5978855@news.acun.com>

  Am in urgent need of help in the following project:

  I want to use a MS Access database  It will be relational with about
5 or 6 separate tables in it. Such as Cust, Info1, Info2, etc. Right
now, I am creating a demo using Frontpage97 and it's related server on
my machine. Later, if everything goes right, I will set up an MS IIS
server w/NT & MS SQL database.
  I need to be able to have a websurfer enter personal data, from a
webpage, to each and any of the tables. 

 * Prior to entering a data, I need to generate for each surfer a
userID and password to use in order to update the table. That same id
& password would enable the surfer or a third party access the
information from any another location. 
 
 * Each entrant needs to be given a CustID generated automatically so
that each table is keyed upon it. They would then need three items to
access the info: userID, password and a custID (that brings up the
required record). If the userID and custID can be used as one, then I
could eliminate userID and just use custID. The custID would need to
be generated by me for consistancy (probably AAAA#### where A=first 4
letters of last name and #=last 4 numbers of social security number.
 
 * Then I need all the tables to be able to be brought up by a third
party from any location and all the information is displayed on a
webpage. Assuming the 3rd party had the UserID and password and inputs
the CustID. 
 
  I understand that cgi/perl scripts might be necessary. I know
nothing of how to generate anything in perl or cgi. I am familiar with
html and am using Frontpage97. I know that somehow input is captured
with Forms and uses Action=Post (w/cgi) to send it somewhere. What I
would like to know is:
1. Is there a resource that can tell me how to manually put cgi
scripts on the server and how perl is related to making it operate.
Or, where can I get some fundamental hands-on knowledge as to how to
put things together. I wouldn't mind learning in time, but for now, I
am under a time constraint to get this demo up and running.
2. Are there any cgi scripts already written that could be used. Where
would they be located?
3. If there are scripts available, how in the world are they all tied
in to make them work.
4. How do I take the input and send to update the various tables in
the database? How do I set up the webpage to accept it? (Forms?)
5. I sure there is something I've forgotten to ask or let you know, so
please let me know so that I can get things operational. We have no
money available to hire things out, so I am elected to come up with
answers.

  Your help will be greatly appreciated. Please reply to my email box.
Many thanks in advance :-)

Stumped in Sarasota

Bill

Be sure to remove the "no spam" 
from the return address
************************
Banjo Bill
bcabana@nospamacun.com
****************************
"Pick 'til ya drop"
*************************


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

Date: Mon, 4 Jan 1999 22:52:02 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Please Help!!
Message-Id: <ip5s67.kg2.ln@magna.metronet.com>

Surgeman@concentric.net wrote:

: I have gotten myself into a fine mess!  

   That's what most people who do CGI programming without using
   the CGI.pm module say.

   use CGI;


: everything I try doesn't work.


   That is not a very helpful piece of information.

   What did you expect it to do?

   What is it doing instead?


: open(OP,">>triviaSub.dat") or die "Can't open the Log File";


   You are checking the return from your open() call.

   That is Very Good!

   You should also print the value of the $! special variable
   in your diagnostic message though. And you should give the
   name of the file that you could not open:

     open(OP,">>triviaSub.dat") or die "Can't open the 'triviaSub.dat'  $!";


: $in=(STDIN=~s/\+/" "/g);
       ^^^^^       ^ ^
       ^^^^^       ^ ^  do you really want to be inserting two double
       ^^^^^            quotes with a space between them?
       ^^^^^       
       ^^^^^ what are you expecting that to do?
             (it isn't going to read anything from STDIN if that
              is what you wanted...)


: $IN=($in=~s/\%40/"@"/);
: $In=($IN=~s/\%0D%0A/" "/g);
: $_IN=($In=~s/\%**/" "/g);


   Arrrrrg!

   Stop it. Right now. Go get the CGI module.

   use CGI; and it will do all of that stuff for you!


: @triv=split/&/g,$_IN,19;
                ^
                ^ I don't think you want that there


: print OP '$triv[0]\n\r';


   1) single quotes don't interpolate, so that will print: 

         $triv[0]\n\r
      
      is that what you wanted to print?


   2) I dunno what Operating System you are on, but I don't know of
      any that use that line-ending sequence...

      Unix: "\n"   (gotta use double quotes)
      Mac:  "\r"
      PoB:  "\r\n"
     

   3) don't print each element of an array individually,
      that's what loops are for:

         foreach $element (@triv) {
            print OP "$element\n";
         }


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


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

Date: Mon, 4 Jan 1999 23:14:28 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <1dl4q0n.1ydg2nrkdl2v4N@bay2-79.quincy.ziplink.net>

Ala Qumsieh <aqumsieh@matrox.com> wrote:

> How does one register anyway? 
> I tried posting more than once to c.l.p.mod, but I never saw my
> posting get through (nor have I received a rejection or any other
> email).

You should receive an automatic reply in response to the first post you
make to comp.lang.perl.moderated, with instructions on how to register.
If you don't receive this, I would suggest sending mail to
mjd-clpm-admin@plover.com and asking for help.

> No one mentioned before that posting to clpmod needed registration. Is
> it a secret? (maybe I was just ignorant)

It's not a secret; it's mentioned in the newsgroup's charter.

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 4 Jan 1999 23:14:30 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <1dl4q72.1vomx4n1mbovimN@bay2-79.quincy.ziplink.net>

John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:

> > > That is not true. Signing up for most mailing lists requires just one
> > > piece of email. The first posting to .moderated requires posting a news
> > > article AND sending email. 
> > 
> >That's because you only have to register if you actually want to post an
> >article.  
> 
> That is not true.

It is true; you only have to register if you actually want to post.

You referred to 'the first posting', but I'm talking about
'registering'.  It's a subtle but, I feel, important difference.  See
below...

> The statement quoted above ("Registering for c.l.p.m
> is no more difficult ...") is false whether or not you want to register.
> The comparative difficulties of two acts does not depend on the
> desirability of or necessity for either act.

You're missing the point.  Registering for clp.mod requires a single
mail, in addition to the post that would have been sent anyway.

hypothetical clp.mod without registration:
post

actual clp.mod with registration:
post+mail


Thus, the cost of registering for clp.mod is one mail.  Registering for
clp.mod is no more difficult than registering for a mailing list.


> "We must make YOU register so that every poster will read ..." is
> falacious.

No, it's not.  In order for every member of A to do X, each individual
member of A must do X.

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 5 Jan 1999 07:52:53 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <76sgcl$r2e$1@news.NERO.NET>

In article <1dl4q72.1vomx4n1mbovimN@bay2-79.quincy.ziplink.net>,
Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
>John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:
>
>> > > That is not true. Signing up for most mailing lists requires just one
>> > > piece of email. The first posting to .moderated requires posting a news
>> > > article AND sending email. 
>> > 
>> >That's because you only have to register if you actually want to post an
>> >article.  
>> 
>> That is not true.
>
>It is true; you only have to register if you actually want to post.

While your statement is technically correct, it does not explain the
"why" part of the previous claim. Your "because" isn't a because.

>You're missing the point.  Registering for clp.mod requires a single
>mail, in addition to the post that would have been sent anyway.

Mail plus post. Thank you for admitting that.

>hypothetical clp.mod without registration:
>post
>
>actual clp.mod with registration:
>post+mail

Mail plus post. Thanks again.

>Thus, the cost of registering for clp.mod is one mail.  

Plus the post that gets you the mail you reply to.

>Registering for
>clp.mod is no more difficult than registering for a mailing list.

Except that most people do not send a "post" to a mailing list before
they sign up. One mail to sign up for a mailing list, one mail and one
post for the newsgroup. It's basic number theory. It's one of the
premises for our mathematical system. A+B cannot be less than A for any
positive, nonzero values of A and B.

>> "We must make YOU register so that every poster will read ..." is
>> falacious.
>
>No, it's not.  In order for every member of A to do X, each individual
>member of A must do X.

You are missing the point that the specific A in question already has
done X, and that many A's have already done X. Thus to reach the state
were all A have done X, it is not necessary to make them all do it
again.



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

Date: Mon, 4 Jan 1999 23:55:37 -0500
From: "Shawn Mitchell" <shawn@liveassist.com>
Subject: Simple sockets
Message-Id: <36919be3.0@news1.ibm.net>

Hello,

Let me apologize in advance for the newbie question.  I am not a perl
programmer (C++ and Java).  I have a server that works over HTTP doing chat.
I need a very simple perl script that will allow me to take an incoming
request, and just pass it through to this server via sockets, and then
direct the results (the socket output) back to the client.

    WebBrowser/Applet -> HTTP msg -> perl script -> Java or C++ server
    WebBrowser/Applet <- HTTP output <- perl script  <- Java or C++ server

Again thank you in advance for putting up with a newbie question.  Any help
is most appreciated.

--Shawn




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

Date: Mon, 04 Jan 1999 23:57:12 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Thanks! and happy new year!
Message-Id: <3691C5D8.B78E8AC2@c-zone.net>

My apologies for this prior posting of mine. I was more then a tad
misleading, and I had only meant my reply to this person in "sarcasm",
and _not_ to say this NG is full of flamers, let alone lack of real
help. That would be he complete opposite of my intention to that post
and feeling.
There's a lot of help here, from a lot of people that could easily do
better things then spend it helping others, but they do... This NG is so
popular, because of all the help!
Thanks to everyone that contributes. :-)
Regards,
Tim


TRG Software wrote:
> 
> Gregg Silk wrote:
> >
> > Thanks to everyone so far. I am amazed at what a helpful and polite group this
> > is. I have seen newgroups for other languages where it seems like some people
> > spend their whole so-called lives flaming newbies and telling them to post
> > elsewhere.
> 
> Are you sure you have the right NG!? :-)
> --
> Regards,
> Tim Greer - chatmaster@c-zone.net
> TRG Software and The Link Worm
> http://www.linkworm.com
> The Chat Base
> http://www.chatbase.com
> -----------------------------------------------------------------------
> * Creator of Paradise Chat, Chat Central & Spiral Chat
> * Receiving over 250,000+ hits a day from users Worldwide!!!
> * Sales of custom chat server scripts * CGI/Perl scripting
> * Script trouble shooting/security * Modify & debug scripts
> * Freelance Perl Scripting for any purpose or application
> 
>        Copyright ) 1998 TRG Software and The Link Worm.

-- 
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application


       Copyright ) 1999 TRG Software and The Link Worm.


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

Date: 5 Jan 1999 04:48:19 GMT
From: py@ecst.csuchico.edu (Pythagoras Watson)
Subject: Re: Unusual behavior of the int function.
Message-Id: <76s5ij$cji$1@hubble.csuchico.edu>

According to Timothy P Delong <tdelong1@osf1.gmu.edu>:
:I assigned the value in question to a variable.  I then printed that variable.
:I did an int on the variable and assigned the result back to itself.  I then
:printed the variable again.  For this all printing was done with print.
:
:The results of the output are:
:75
:74
:
:Puzzled I went and printed the value out with printf and formatted it as a
:float.  The output was 75.000000 I then used a regular expression to grab
:everything before the decimal and everything after.  I printed it and got
:75 and nothing.

While your actual code would be a real help, I am going to guess that you
are running into floating-point rounding difficulties.  The number is close
enough to 75 to be rounded automatically by the print function, but
actually less than 75, so the int function gives 74.  The following might
be instructive:

  #!/usr/local/bin/perl -w
  $n = 74.99999999999999;
  print "$n -- ", int($n), "\n";
  printf "%.13f -- %.14f\n", $n, $n;
  if ($n < 75) { print "yes\n"; } else { print "no\n"; }

When run on my computer, the above results in:

  75 -- 74
  75.0000000000000 -- 74.99999999999999
  yes

Naturally, your results may vary.

-- 
Py -- 3.141592653589793238462643383279502884197169399375105...
Pythagoras Watson -- "Live long and may all your kernels pop."
= py@ecst.csuchico.edu === http://www.ecst.csuchico.edu/~py/ =


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

Date: 5 Jan 1999 18:07:57 +1100
From: bod@compusol.com.au (Brendan O'Dea)
Subject: Re: When hashing won't work...
Message-Id: <76sdod$u72$1@duende.compusol.com.au>

In article <76b8rk$rmm$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
>In article <76b1md$sqh$1@nnrp1.dejanews.com>,  <dave@mag-sol.com> wrote:
>>Does $hash{foo@bar.com} work in 5.005?
>
>No, and it is unlikely to ever work in any version of Perl.

 ...or at least not the way he expects it to :-)

    $ perl -c
    sub foo { "heh, heh" }
    print $hash{foo@bar.com};
    ^D
    - syntax OK

Regards,
-- 
Brendan O'Dea                                        bod@compusol.com.au
Compusol Pty. Limited                  (NSW, Australia)  +61 2 9809 0133


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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