[13459] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 869 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 21 18:07:23 1999

Date: Tue, 21 Sep 1999 15:05:14 -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: <937951513-v9-i869@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 21 Sep 1999     Volume: 9 Number: 869

Today's topics:
    Re: a simple redirect with bells and whistles <rgoldber@eb.com>
    Re: a simple redirect with bells and whistles <makkulka@cisco.com>
    Re: Ad hominem (was Re: perl related question now!) (Kragen Sitaker)
    Re: Calling anonymous subroutines from a hash.  How to  (Kragen Sitaker)
    Re: Configuring @INC for a movable Perl dist. <rootbeer@redcat.com>
        image upload using form (me)
    Re: image upload using form (Kragen Sitaker)
    Re: mkdir bug under Sinix 5.43 (RM600)? <sariq@texas.net>
    Re: mkdir(). What am I doing wrong? (Abigail)
    Re: mkdir(). What am I doing wrong? (Abigail)
    Re: mkdir(). What am I doing wrong? <cassell@mail.cor.epa.gov>
    Re: Perl and Win32 API <gellyfish@gellyfish.com>
    Re: Perl and Win32 API <cassell@mail.cor.epa.gov>
    Re: Perl FAQ problems <cassell@mail.cor.epa.gov>
    Re: Perl FAQ problems <cassell@mail.cor.epa.gov>
    Re: Perl FAQ problems (Kragen Sitaker)
    Re: Perl FAQ problems (Michael Stevens)
    Re: perl related question now! (Larry Rosler)
    Re: perl related question now! (Larry Rosler)
    Re: perl related question now! <elaine@chaos.wustl.edu>
        perl tutoring <danz@fvreb.bc.ca>
    Re: PerlBuilder v1.0e <cassell@mail.cor.epa.gov>
        Preserving file name of uploaded file <bhwang@prodigy.net>
        Problem with method - unblessed <rockie@apk.net>
    Re: Recommendation for introductory classroom textbook? <tchrist@mox.perl.com>
    Re: Regulat Expressions and Tabulator Problems <cassell@mail.cor.epa.gov>
    Re: Saving a list of filenames from directory into an a <cassell@mail.cor.epa.gov>
    Re: sending HTML files in e-mail <cassell@mail.cor.epa.gov>
    Re: sending HTML files in e-mail (Kragen Sitaker)
    Re: Stock quote URL strings <cassell@mail.cor.epa.gov>
    Re: THANKS <daniel@vesma.co.uk>
    Re: Using Perl Modules outside lib directory? <cassell@mail.cor.epa.gov>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 21 Sep 1999 16:45:48 -0500
From: RayG <rgoldber@eb.com>
Subject: Re: a simple redirect with bells and whistles
Message-Id: <Pine.GSO.3.96.990921164256.6821F-100000@cliff.eb.com>

On Tue, 21 Sep 1999, Kragen Sitaker wrote:

> In article <37E7E0AB.B3CEC9BB@hotmail.com>, MJA  <aslamj@hotmail.com> wrote:
> >How can I redirect the browser and send data (in the POST method) to
> >another script?
> 
> You can't.  And you're asking in the wrong newsfroup.

i thought you could subclass LWP::UserAgent and then modify redirect_ok to
allow for this action.



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

Date: Tue, 21 Sep 1999 14:49:07 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: a simple redirect with bells and whistles
Message-Id: <37E7FD53.7AB10A0F@cisco.com>

[ MJA wrote:

> (More detailed)...my script once completed should send data to another
> script as though it was posting the information from the client to a
> FORM on that html page. Note: the browser should display the new page.

As your Question is not very clear my answer might be at best approximate.

Read your cgi params as usual and run your script as usual. Assume
this is cgi1.  After you run thru cgi1 you will have your name & value
params for your next script cgi2. Access the dynamic page created
by cgi2 using LWP::UserAgent and HTTP::Request::Common ( the
perldocs will give you good sample code ). Return this page
to the browser.

As a result of these steps the o/p from cgi2 gets sent to the browser
and cgi1 remains silent.

--



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

Date: Tue, 21 Sep 1999 21:15:14 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Ad hominem (was Re: perl related question now!)
Message-Id: <CzSF3.1474$QJ.57841@typ11.nn.bcandid.com>

In article <37E7E872.41238731@chaos.wustl.edu>,
Elaine -HFB- Ashton  <elaine@chaos.wustl.edu> wrote:
>Kragen Sitaker wrote:
>> Argumentum ad hominem is what is known as a "fallacy": using it will
>> cause reasonable people to dismiss your arguments.
>
>Fallacy? Hmmm...I'm not sure that is totally correct, though it might be
>a nuance. I would call it annoying, argumentative, incendiary. :)

"In everyday English the word "fallacy" is used to refer to mistaken
 beliefs, as well as to the faulty reasoning that leads to those
 beliefs. In logic, the term is generally used for a form of technically
 incorrect argument -- especially if the argument appears valid or
 convincing." -- http://www.geocities.com/Athens/5948/logic.htm

It's normally classed as one of the fallacies of relevance.  See e.g.
http://www.ling.rochester.edu/~duniho/fallacies.html
http://www1.primenet.com/~byoder/fallazoo.htm
http://rampages.onramp.net/~alaska/reporter/fallacy/page39.htm
http://www.infidels.org/library/magazines/tsr/1993/3/3front93.html
http://www-rohan.sdsu.edu/faculty/rfreeman/CHAPTER3.html
http://sorrel.humboldt.edu/~mfg1/glossary.html
http://www.geocities.com/Athens/5948/logic.htm

>parva leves capiunt animas.

Ubi parva leves, ibi anima de Kragen.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 21:19:46 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Calling anonymous subroutines from a hash.  How to make it work?
Message-Id: <SDSF3.1494$QJ.58583@typ11.nn.bcandid.com>

In article <b8SF3.1305$QJ.53167@typ11.nn.bcandid.com>, CS <@mdo.net> wrote:
>>Most of the time people will not bother with attachments.  Try to
>>simplify the example of the problem next time and include it in
>>your message.
>
>Yeah, good suggestion.  I did not know exactly where the problem was, so I
>wasn't sure what part of the code I should send.

Often the process of simplifying the example to the bare minimum
results in not having to post at all.  It probably wouldn't have in
this case, though.

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 14:25:33 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Configuring @INC for a movable Perl dist.
Message-Id: <Pine.GSO.4.10.9909211407210.25903-100000@user2.teleport.com>

[ follow-ups set to c.l.p.moderated ]

On Mon, 20 Sep 1999, Carl Montgomery wrote:

> How can I change @INC to include the right set of dirs when I don't
> know the right dirs until installing Perl dist?

AFAIK, there's no great solution to this (yet). One proposed solution
would be to make an "editable binary". Inside the binary, a block of (say)
1000 bytes would be translated into the initial @INC value. When you're
ready to install onto a new machine, you would simply edit the binary to
add the @INC paths to that block (probably by means of a perl program...).

Adding the code to perl.c would probably take an hour or less, but making
it work on non-Unix machines and making the editor/installer program would
take more tuits than I've got on hand today. But maybe one of the
wonderful folks on c.l.p.moderated will take up the challenge and make
this happen.

Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: Tue, 21 Sep 1999 10:15:27 GMT
From: jmontany@clarityconnect.com (me)
Subject: image upload using form
Message-Id: <37de1d72.7267557@news1.clarityconnect.com>

#!/usr/local/bin/perl

I am using a perl program to save files on the server with the form
tag <input type="file"....

It saves the files where it is supposed to and text files are easily
retrieved

The problem is, when image files are saved, they are useless. All the
data is there but they are no longer usable. Does anybody know why?
and how it can be fixed?

Here is the program:

#!/usr/local/bin/perl
$TMP = "/path/";
$UPLOADDIR = "/path/";
$CONTENT_TYPE = $ENV{'CONTENT_TYPE'};
$CONTENT_LENGTH = $ENV{'CONTENT_LENGTH'};
$BUF_SIZ = 16834;
# make tempfile name
do {
    $tempfile = $TMP."formupload-".time
} until (!(-e $tempfile));
if ($CONTENT_TYPE =~ /^multipart\/form-data/) {
    # save form data to a temporary file
    ($boundary = $CONTENT_TYPE) =~ s/^multipart\/form-data\;
boundary=//;
    open(TMPFILE,">$tempfile");
    $bytesread = 0;
    while ($bytesread < $CONTENT_LENGTH) {
     $len = sysread(STDIN,$buffer,16834);
     syswrite(TMPFILE,$buffer,$len);
     $bytesread += $len;
    }
    close(TMPFILE);
    # parse temporary file
    undef %input;
    open(TMPFILE,$tempfile);
    $line = <TMPFILE>; # should be boundary; ignore
    while ($line = <TMPFILE>) {
     undef $filename;
     $line =~ s/[Cc]ontent-[Dd]isposition: form-data; //;
     ($name = $line) =~ s/^name=\"([^\"]*)\".*$/$1/;
     if ($line =~ /\; filename=\"[^\"]*\"/) {
         $line =~ s/^.*\; filename=\"([^\"]*)\".*$/$1/;
         $filename = "$UPLOADDIR$line";
     }
     $line = <TMPFILE>; # blank line
     if (defined $filename) {
         open(NEWFILE,">$filename");
     }
     elsif (defined $input{$name}) {
         $input{$name} .= "\0";
     }
     while (!(($line = <TMPFILE>) =~ /^--$boundary/)) {
         if (defined $filename) {
          print NEWFILE $line;
         }
         else {
          $input{$name} .= $line;
         }
     }
     if (defined $filename) {
         close(NEWFILE);
     }
     else {
         $input{$name} =~ s/[\r\n]*$//;
     }
    }
    close(TMPFILE);
    unlink($tempfile);
    # print success message
print"Content-type: text/html\n\n";
print"<html>\n";
print"<head>\n";
print"<title>test</title>\n";
print"</head>\n";
print"<center>test</center>\n";
print"<body>\n";
print"Success\n";
print"</body>\n";
print"</html>\n";}
else {

print"Content-type: text/html\n\n";
print"<html>\n";
print"<head>\n";
print"<title>test</title>\n";
print"</head>\n";
print"<center>test</center>\n";
print"<body>\n";
print"Wrong Content-type\n";
print"</body>\n";
print"</html>\n";
}

exit(0);

###################### subroutines ################################


# PrintVariables
# Nicely formats variables in an associative array passed as a
parameter
# And returns the HTML string.

sub PrintVariables {
  local (%in) = @_;
  local ($old, $out, $output);
  $old = $*;  $* =1;
  $output .=  "<DL COMPACT>";
  foreach $key (sort keys(%in)) {
    foreach (split("\0", $in{$key})) {
      ($out = $_) =~ s/\n/<BR>/g;
      $output .=  "<DT><B>$key</B><DD><I>$out</I><BR>";
    }
  }
  $output .=  "</DL>";
  $* = $old;

  return $output;
}


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

Date: Tue, 21 Sep 1999 21:27:46 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: image upload using form
Message-Id: <mLSF3.1537$QJ.59694@typ11.nn.bcandid.com>

In article <37de1d72.7267557@news1.clarityconnect.com>,
me <jmontany@clarityconnect.com> wrote:
>The problem is, when image files are saved, they are useless. All the
>data is there but they are no longer usable. Does anybody know why?
>and how it can be fixed?

Are you running this on an archaic brain-dead platform, or are you
running it on Unix?  If the former, binmode might be your problem.

>$TMP = "/path/";
>$UPLOADDIR = "/path/";
>$CONTENT_TYPE = $ENV{'CONTENT_TYPE'};
>$CONTENT_LENGTH = $ENV{'CONTENT_LENGTH'};
>$BUF_SIZ = 16834;
># make tempfile name
>do {
>    $tempfile = $TMP."formupload-".time
>} until (!(-e $tempfile));

This is a race condition, btw; two users uploading data at the same
time are likely to end up using the same $tempfile every once in a while.

>if ($CONTENT_TYPE =~ /^multipart\/form-data/) {
>    # save form data to a temporary file
>    ($boundary = $CONTENT_TYPE) =~ s/^multipart\/form-data\;
>boundary=//;
>    open(TMPFILE,">$tempfile");

                                or die "Damn, couldn't create $tempfile: $!\n";
     binmode(TMPFILE);
     binmode(STDIN);

>    $bytesread = 0;
>    while ($bytesread < $CONTENT_LENGTH) {
>     $len = sysread(STDIN,$buffer,16834);
>     syswrite(TMPFILE,$buffer,$len);
>     $bytesread += $len;
>    }
>    close(TMPFILE);
>    # parse temporary file
>    undef %input;
>    open(TMPFILE,$tempfile);

     binmode(TMPFILE);

>     if (defined $filename) {
>         open(NEWFILE,">$filename");

          binmode(NEWFILE);

HTH.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 16:10:56 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: mkdir bug under Sinix 5.43 (RM600)?
Message-Id: <37E7F460.DA91FB74@texas.net>

Tobias Rudolph wrote:
> 
> Hi all!
> 
> I´m a beginner with perl and i´m writing some perl scripts under Sinix
> 5.43 C4001 on a Siemens RM600 (2 R4000 processors, 512 mb).
> 
> I wonder why the mkdir command from perl doesn´t do what it should.

It does what *most* people think it should.

Read the docs for mkdir.

- Tom


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

Date: 21 Sep 1999 16:07:45 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <slrn7uft1r.cht.abigail@alexandra.delanet.com>

Daniel Vesma (daniel@vesma.co.uk) wrote on MMCCXII September MCMXCIII in
<URL:news:7s855a$3gr$1@gxsn.com>:
// 
// I am using this...
// 
// use CGI qw(param);
// print "Content-type: text/html\n\n";
// $foo = param("foo");
// $makeDIR = "/my/path/is/here/" . $foo;
// mkdir($makeDIR, 777);
                   ^^^   That's a decimal number. You want octal.


Of course, you should be checking the return value of mkdir as well.
And you should consider your umask.


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


  -----------== 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: 21 Sep 1999 16:23:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <slrn7uftvs.cht.abigail@alexandra.delanet.com>

Daniel Vesma (daniel@vesma.co.uk) wrote on MMCCXII September MCMXCIII in
<URL:news:7s882s$si7$1@gxsn.com>:
^^ > I thought you said you were creating the directory with wide-open
^^ settings!
^^ > This is only owner=write, group=execute, and other=execute permissions.
^^ > And what's that extra 512 for?  Permission bits don't go that high.
^^ 
^^ Whistle Whistle. I think I'm showing my CHMOD ignorance.
^^ 
^^ The chart at http://www.go-nexus-go.com/chmodchart.html says that 777 is
^^ wide-open
^^ 
^^ So what should I be using?

That chart is for the chmod _command_, not the Perl chmod or mkdir function.
Use the real documentation:

    perldoc -f mkdir
    perldoc -f umask


Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== 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: Tue, 21 Sep 1999 14:42:00 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: mkdir(). What am I doing wrong?
Message-Id: <37E7FBA8.748E02AF@mail.cor.epa.gov>

sephiroth@id-base.com wrote:
> 
> Daniel Vesma wrote:
[snip down to relevant line]
> > mkdir($makeDIR, 777);
                    ^^^

> Have you tried putting something in the directory? The forbidden access
> error message usually pops up when you have nothing in the directory.

Oh, really?  Did you try that on his OS?

He has his permissions wrong. 

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


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

Date: 21 Sep 1999 20:19:37 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl and Win32 API
Message-Id: <7s8p8p$46q$1@gellyfish.btinternet.com>

On Tue, 21 Sep 1999 06:26:20 -0400 Jon Banquer wrote:
> What is Activestate distribution ?
> 

<http://www.activestate.com>

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Tue, 21 Sep 1999 14:28:52 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl and Win32 API
Message-Id: <37E7F894.78672838@mail.cor.epa.gov>

Jon Banquer wrote:
> 
> What is Activestate distribution ?

The poster meant the version of Perl you get if you go to
www.activestate.com and download the already-built version
of Perl available there, rather than building it yourself.

Get ActiveState Perl build 519.  Then let it install itself.
And be sure to let it place the docs on your Start Menu,
because then you can read whatever Perl docs you like while 
using your favorite web browser.

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


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

Date: Tue, 21 Sep 1999 14:23:14 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl FAQ problems
Message-Id: <37E7F742.CE071726@mail.cor.epa.gov>

Kragen Sitaker wrote:
> 
> I found a bug in perlfaq9, so I went to the URL mentioned in the FAQ to
> see if the bug had been fixed.

Any problems with the FAQ should probably be sent to the
address given in the FAQ:

perlfaq-suggestions@perl.com

Then Tom Christiansen can abuse you personally.  :-)

Actually, Tom has been very polite when I have sent suggestions
to that address.  Even when he disagreed with me.

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


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

Date: Tue, 21 Sep 1999 14:25:44 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Perl FAQ problems
Message-Id: <37E7F7D8.26CDC1DD@mail.cor.epa.gov>

Michael Stevens wrote:
[snip]
> I get the same behaviour and your explanation seems to make sense.
> I'd recommend using perlbug.

If the problem is with the FAQ and not Perl, then this is
not a case for perlbug.  Just send a suggested correction to

perlfaq-suggestions@perl.com

so TomC can consider it, and integrate it if he deems it
reasonable.

The FAQ isn't perfect.  OTOH, it is correct a higher percent 
of the time than randomly selected posts in this ng [including
my own!]
 
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 21 Sep 1999 21:29:59 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Perl FAQ problems
Message-Id: <rNSF3.1558$QJ.59915@typ11.nn.bcandid.com>

In article <37E7F7D8.26CDC1DD@mail.cor.epa.gov>,
David Cassell  <cassell@mail.cor.epa.gov> wrote:
>Michael Stevens wrote:
>[snip]
>> I get the same behaviour and your explanation seems to make sense.
>> I'd recommend using perlbug.
>
>If the problem is with the FAQ and not Perl, then this is
>not a case for perlbug.  Just send a suggested correction to

Whoops, too late.  I already perlbugged.

>perlfaq-suggestions@perl.com
>
>so TomC can consider it, and integrate it if he deems it
>reasonable.

I think having put it in two places where TomC will find it is probably
enough.

>The FAQ isn't perfect.  OTOH, it is correct a higher percent 
>of the time than randomly selected posts in this ng [including
>my own!]

And, obviously, mine.  And often, even when I am correct, the FAQ is
more correct :)

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 21 Sep 1999 21:59:45 GMT
From: mstevens@ashre.demon.co.uk (Michael Stevens)
Subject: Re: Perl FAQ problems
Message-Id: <slrn7ufvuh.1sg.mstevens@swirl.internal.fict>

On Tue, 21 Sep 1999 14:25:44 -0700, David Cassell <cassell@mail.cor.epa.gov> wrote:
>Michael Stevens wrote:
>[snip]
>> I get the same behaviour and your explanation seems to make sense.
>> I'd recommend using perlbug.
>If the problem is with the FAQ and not Perl, then this is
>not a case for perlbug.  Just send a suggested correction to
>perlfaq-suggestions@perl.com
>so TomC can consider it, and integrate it if he deems it
>oreasonable.

But note that it comes with perl. To me, this means a bug in perlfaq is
a bug in the perl documentation is a bug in perl.

>The FAQ isn't perfect.  OTOH, it is correct a higher percent 
>of the time than randomly selected posts in this ng [including
>my own!]

Agreed completely.


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

Date: Tue, 21 Sep 1999 14:03:10 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perl related question now!
Message-Id: <MPG.12519266dd342dbc989fb6@nntp.hpl.hp.com>

In article <37E7E553.30ADC710@chaos.wustl.edu> on Tue, 21 Sep 1999 
16:08:14 -0400, Elaine -HFB- Ashton <elaine@chaos.wustl.edu> says...
 ... 
> Main Entry: 1ad ho·mi·nem
> Pronunciation: (')ad-'hä-m&-"nem, -n&m
> Function: adjective
> Etymology: New Latin, literally, to the person

 ...

> get it? Actually, it has been made politically correct in the
> etymology...to the man is what it means in the sentiment of the origin
> of the word.

My older dead-trees dictionary says this:

hominid ... [deriv. of L *homin-*, *homo* man] : any of a family 
(Hominidae) of bipedal primate mammals comprising recent man, his 
immediate ancestors, and related forms.

So 'ad hominem' means 'to the human' -- unless women have a family and 
genus of their own.  Which they might.  :-)

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


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

Date: Tue, 21 Sep 1999 14:34:20 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: perl related question now!
Message-Id: <MPG.125199b7ef49ee6f989fb7@nntp.hpl.hp.com>

In article <37E7F007.7B804B93@chaos.wustl.edu> on Tue, 21 Sep 1999 
16:53:58 -0400, Elaine -HFB- Ashton <elaine@chaos.wustl.edu> says...
> Larry Rosler wrote:
> > Why one of these is described as an adjective and the other as an adverb
> > is beyond me.  Maybe I need a better dictionary.  :-)
> 
> Either of them can be an adverb or adjective, e.g. "He made his
> presentation in an ad rem fashion." or " His arguments were ad hominem
> rants." or "He is an ad rem kind of guy." or "He is prone to ad hominem lunacy".
> 
> Both of them are descriptors or modifiers. 
> 
> More than likely your dictionary used a single example sentence and that
> is reflected in how they describe it. Just a guess.

Each of your four examples uses the 'ad quem' phrase as a noun-modifier, 
i.e. an adjective.  I'm having trouble coming up with an adverbial use 
(i.e., verb-, adjective-, or adverb-modifier).

"Her argument was ad hominem."  Still a (predicate) adjective.  I'm 
beginning to think the 'adv' is just an error.

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


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

Date: Tue, 21 Sep 1999 17:53:01 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: perl related question now!
Message-Id: <37E7FDDC.DE51998A@chaos.wustl.edu>

Larry Rosler wrote:
> hominid ... [deriv. of L *homin-*, *homo* man] : any of a family
> (Hominidae) of bipedal primate mammals comprising recent man, his
> immediate ancestors, and related forms.

"Man" being the operative word here.  :)

> So 'ad hominem' means 'to the human' -- unless women have a family and
> genus of their own.  Which they might.  :-)

Hmmm...well as far as I recall, women were still property back in the
day. 

And men are from Mars, silly...:)

e.


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

Date: Tue, 21 Sep 1999 14:06:08 -0700
From: "Dan Zylenko" <danz@fvreb.bc.ca>
Subject: perl tutoring
Message-Id: <37e7f26a$0$14253@fountain.mindlink.net>

Is there anyone in BC, Canada, in Surrey to Abbotsford area willing to to
some Perl tutoring. Needed ASAP!

Email me at danz@fvreb.bc.ca




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

Date: Tue, 21 Sep 1999 14:47:19 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: PerlBuilder v1.0e
Message-Id: <37E7FCE7.D2EE8CA3@mail.cor.epa.gov>

srochon@direct-internet.net wrote:
> 
> I am looking for the version v1.0e of Perbluilder.
> 
> I looked at www.solutionsoft.com but they only have the version 1.0d.

I don't understand.  The people who *write* PerlBuilder only
have version 1.0d up, but you want something more advanced?
You may have to wait a while on that.

If not, can you get me Perl 6 and Tk 9 too?

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


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

Date: Tue, 21 Sep 1999 17:12:27 -0400
From: Burt Hwang <bhwang@prodigy.net>
Subject: Preserving file name of uploaded file
Message-Id: <37E7F4BB.4BDD2767@prodigy.net>

OK, thanks everyone for helping me with my last problem.

Recap:  I wanted to upload a file from a webpage to be stored on the web
server.  Let's say that the file is on my local hard drive
"D:/data/info.doc".  

Is there a way to store that path of the uploaded file when it gets to
my CGI?  I don't even know if it is passed along with the actual content
of the uploaded file.  What I want to do is to save the file on my web
server as "info.doc".

Right now, I can save the file with a filename that I specify on my web
server.  But I want to save it with the original file name instead.

Thanks.


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

Date: Tue, 21 Sep 1999 17:54:50 -0300
From: "R. Brockway" <rockie@apk.net>
Subject: Problem with method - unblessed
Message-Id: <37E7F09A.55F444DF@apk.net>

Hello all,

I am attempting to write a pRPC client/server set of scripts. In my
Server script I am getting the following error:

Can't call method "Loop" on unblessed reference at ./server1.pl line 43.

I'm stuck and am still trying to learn methods/classes, etc. The call at
line 43 (code follows) looks to me to be using a known package (RPC),
but apparently I'm fully missing something. If anyone could help me
figure it out i'd greatly appreciate it (or but you a beer if you're
ever in cleveland.

server1.pl:

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

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

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

# Function get_user
sub get_user {
        # take $username and grep from /etc/passwd
        my ($con, $username);
        $cmd = ("grep $username /etc/passwd");
        my ($get_user) = "system ($cmd)";
        return (1, $get_user);
}

# Function quit
sub quit ($$) {
        my($con, $data) = @_;
        $$data = 0; # tell server's Loop() we are done
        (1, "Bye!");
}

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


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

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

# Main

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

                                &server($con);
                        }
                }
        }
}
}


thanks to all who can help.

-rockie



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

Date: 21 Sep 1999 15:54:53 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Recommendation for introductory classroom textbook?
Message-Id: <37e7fead@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Roger Williams <roger@coelacanth.com> writes:
:I have been asked to teach a one-semester introductory Perl class at
:one of the local universities, and I have the freedom to select the
:text(s).
:
:Since this is an evening ("continuing education") class, I expect
:students' interest in Perl to be split between system administration
:tasks and writing CGI scripts.

My experiences, biased or uncommon though they may be, is that the Perl
Cookbook plus the Perl Pocket Reference by JV, combined with lecture
notes, are the best for people who know some programming.  You might
flip through them and decide whether this would work for you.  In fact,
I keep meaning to create a 1-semester course where each cookbook
chapter is a unit.  There are 20 chapters, but usually fewer weeks
in a university term.  So you could either skip or double up some.
Obvious candidates for doubling include chapters 1-3 on strings and
numbers and dates (e.g.  scalars) and cahpters 7-9 on file access and
file contents and directory access.  Have them do  small assignments
for each chapter.  You might or might not want to skip 14 and 15, 
and some parts of 13 and 16 might be too hard.  Don't rush 19 or 20,
but they're important for your named audience.

--tom
-- 
    X-Windows: graphics hacking :: roman numerals : sqrt(pi)
	--Jamie Zawinski


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

Date: Tue, 21 Sep 1999 14:26:39 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Regulat Expressions and Tabulator Problems
Message-Id: <37E7F80F.F6C140A3@mail.cor.epa.gov>

Eric Bohlman wrote:
> 
> David Cassell (cassell@mail.cor.epa.gov) wrote:
> : [2] This isn't optimal either.  If you want to do this,
> : try something like:
> :
> : { undef $/; $filelines = <FILE>; }
> 
> Er, make that 'undef' a 'local'; otherwise $/ won't get its value
> restored outside the block.

D'OH!  Yanked that out of an inappropriate source.  Silly me.

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


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

Date: Tue, 21 Sep 1999 14:50:20 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Saving a list of filenames from directory into an array.
Message-Id: <37E7FD9C.EE0B9D27@mail.cor.epa.gov>

Larry Rosler wrote:
> 
> In article <C1NF3.69$QJ.2561@typ11.nn.bcandid.com> on Tue, 21 Sep 1999
> 14:57:38 GMT, Kragen Sitaker <kragen@dnaco.net> says...
> > In article <MPG.12513793eae75317989fac@nntp.hpl.hp.com>,
[big snip]
> > I like Abigail's solution
> > better, although I think it could be improved to fork and exec less.
> 
> Odd, I haven't seen an Abigail post in this thread.

Maybe it was so densely-coded that your newsfeed couldn't pick
it up.  The code was (of course) in one line.

It was in the thread.  But a lot of newsfeeds seem to be 
dropping those Abigail posts lately.  Wasn't Cameron Dorey
complaining about that just the other week?

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


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

Date: Tue, 21 Sep 1999 14:36:20 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: sending HTML files in e-mail
Message-Id: <37E7FA54.4CC89A6A@mail.cor.epa.gov>

rwswebmaster@my-deja.com wrote:
> 
> I am looking for a script or program that allows for myself to send
> HTML documents via e-mail to people.  I have a program that only sends
> the HTML code in plain text, even though my mail program is set up to
> accept HTML and I have received e-mail with all the graphics,
> backgrounds, fonts, etc.  Any help would be greatly appreciated.

BTW, I hate it when people send me HTML e-mails.  I hope you're
doing this because it is a company ruloe, because many people
will be less than thrilled with you.

If you want to send an attachment of any type, you have to
resort to the MIME specification.  That means either using
the MIME::Lite module or reading the RFC and figuring out how 
to do it yourself.  I suggest option # 1.

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


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

Date: Tue, 21 Sep 1999 21:46:31 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: sending HTML files in e-mail
Message-Id: <X0TF3.1640$QJ.62766@typ11.nn.bcandid.com>

In article <37E7FA54.4CC89A6A@mail.cor.epa.gov>,
David Cassell  <cassell@mail.cor.epa.gov> wrote:
>BTW, I hate it when people send me HTML e-mails.  I hope you're
>doing this because it is a company ruloe, because many people
>will be less than thrilled with you.

Presumably he's not a spammer and is only sending these emails to
people who have requested them.

>If you want to send an attachment of any type, you have to
>resort to the MIME specification.  That means either using
>the MIME::Lite module or reading the RFC and figuring out how 
>to do it yourself.  I suggest option # 1.

You forgot option #3: kludging together a broken, non-RFC-compliant
implementation from offhand incorrect suggestions from ignorant Usenet
posters, and hacking on it until it works with your own mail program.
That's what one of the other posters on this thread suggested.  I don't
recommend it. :)
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 21 1999
48 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 21 Sep 1999 14:34:02 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Stock quote URL strings
Message-Id: <37E7F9CA.4F080F6C@mail.cor.epa.gov>

[Note: Vince wrote this Jeopardy-style, rather than sequentially,
the way normal humans have a conversation.  So I am moving a
snippet of Larry R's post into the right position for context.
This is an immense pain, because Vince can't follow Usenet
standards.]

Vince Wilding wrote:
> Larry Rosler wrote:
> > Why did you bother, when the question is off-topic?
> 
> I disagree!  I have been looking for just such a goober, to write a
> script around

And your point is...?  I've been looking for a good recipe
for chicken tandoori, but I wouldn't dream of insisting
someone post it here.  I asked in alt.food.chicken.furrinner .

It is *still* off-topic.  That means that there are other
newsgroups where you might get a *better* answer.  Or
several good answers.  Perhaps something with 'web' or 'cgi'
in the name would be a good starting place.

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


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

Date: Tue, 21 Sep 1999 22:21:00 +0100
From: "Daniel Vesma" <daniel@vesma.co.uk>
Subject: Re: THANKS
Message-Id: <7s8sjc$ec1$1@gxsn.com>

> ...and "it" would be????  : )

The uploader.

Daniel Vesma
http://www.thewebtree.com
http://www.thewebtree.com/daniel-vesma





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

Date: Tue, 21 Sep 1999 14:44:35 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Using Perl Modules outside lib directory?
Message-Id: <37E7FC43.FF4B636F@mail.cor.epa.gov>

Kragen Sitaker wrote:
> 
> In article <37e7bce6.2665328@news.magix.com.sg>,
> AcCeSsDeNiEd <dillon_rm@magix.com.sg> wrote:
> >Is there anyway I can install the perl modules in a different
> >directory (e.g: cgi-bin) and let my script access the modules from
> >there?
> 
> use lib '/home/dillon/cgi-bin';
> 
> Isn't this in the FAQ?

Yes.  At the end of perlfaq8 .  As you know by now, since you've
been reading the FAQ today.  [I saw your post.]

Or type: 'perldoc -q module' for those playing at home who 
want to learn about perldoc.

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


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

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


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