[13851] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1261 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 2 21:15:34 1999

Date: Tue, 2 Nov 1999 18:15:23 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <941595323-v9-i1261@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 2 Nov 1999     Volume: 9 Number: 1261

Today's topics:
    Re: Range operators: two dots v.s. three dots (Abigail)
    Re: Recursive Directory Search (Kragen Sitaker)
    Re: Scripts that invoke one another via Location: and/o <wyzelli@yahoo.com>
    Re: Socket communication using IO::Socket (sending/rece (Kragen Sitaker)
    Re: Something like FLY except for JPGs (Abigail)
    Re: Something like FLY except for JPGs (Martien Verbruggen)
    Re: string number conversion (Abigail)
        Sybperl problems jds7717@my-deja.com
        tie hash NDBM_File CGI.pm invinfo@my-deja.com
        tie hash, NDBM_File, CGI.pm invinfo@my-deja.com
    Re: USA Opportunities for Internet Savvy applicants (Kragen Sitaker)
        Weird error <pornpira@beta.tricity.wsu.edu>
    Re: Weird error <makkulka@cisco.com>
        Why doesn't this work? <010101@technologist.com>
    Re: Why doesn't this work? (Michael Budash)
    Re: Writing to a dead socket does not cause SIGPIPE (Kragen Sitaker)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 2 Nov 1999 17:33:35 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Range operators: two dots v.s. three dots
Message-Id: <slrn81ut59.tjn.abigail@alexandra.delanet.com>

Randal L. Schwartz (merlyn@stonehenge.com) wrote on MMCCLIV September
MCMXCIII in <URL:news:m1n1swaek1.fsf@halfdome.holdit.com>:
{} 
{} I'm not sure how Abigail got those results.
{} 
{}      $ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
{}        perl -wne 'print if /foo/ ..  /bar/'
{}      foobar
{}      barbar
{}      $ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
{}        perl -wne 'print if /foo/ ... /bar/'
{}      foobar
{}      $
{} 
{} Because I get exactly the opposite when I run my 5.5.3 Perl against
{} that code!  Abigail, what Perl are you running?


5.005_03. I used cut-and-paste, then yank-and-copy, and removed the
'.' on the wrong line. My post should have read:

        $ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
          perl -wne 'print if /foo/ ... /bar/'
        foobar
        barbar
        $ perl -wle 'for (qw /foobar barbar bazbar/) {print}' |\
          perl -wne 'print if /foo/ ..  /bar/'
        foobar
        $



Abigail
-- 
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))


  -----------== 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, 02 Nov 1999 23:26:36 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Recursive Directory Search
Message-Id: <MqKT3.22561$23.1162266@typ11.nn.bcandid.com>

In article <Pine.GSO.4.10.9911020855370.4217-100000@crusoe.crusoe.net>,
Jeff Pinyan  <japhy@pobox.com> wrote:
>[posted & mailed]
>You want the File::Find module.  You might already have it.
>
>  perldoc File::Find

If he doesn't have it, his perl installation is messed up.

Running find2perl -name '*foo?xyz' -print would probably be probably
enlightening (for the querent, of course, not you).
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Wed, 3 Nov 1999 09:40:40 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Scripts that invoke one another via Location: and/or URI: - environment persistence?
Message-Id: <R4LT3.2$Of3.2036@vic.nntp.telstra.net>

Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:7vl2fp$4gv$1@gellyfish.btinternet.com...
> Anyhow I still dont understand the other logging business - using Apache
it
> takes one line to add a separate log for a virtual host ...
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> <http://www.gellyfish.com>
> Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>

All the IIS virtual hosts that I run have logging enable for the individual
virtual hosts which I write to a directory (called 'logs') within the site
so the user with FTP access can read their own log directly.

Maybe I'm just strange.

Wyzelli




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

Date: Tue, 02 Nov 1999 23:38:19 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Socket communication using IO::Socket (sending/receiving)
Message-Id: <LBKT3.22590$23.1162551@typ11.nn.bcandid.com>

In article <381F6441.5E63075D@titan.ndhm.gtegsc.com>,
J.Z. Brody <NOSPAMbubba@titan.ndhm.gtegsc.com> wrote:
>I'm having a hard time grasping comm between server and clients.
>
>Server:  Listens on a port for a connection from client - got that.
>Client:  Connects to server - got that too.
>
>Problem:
>How - on connect - the client is challenged for password/code and
>responds.

Depends on the protocol.  If you're making up your own protocol, this
can work however you like.

>After which the server determines if the correct pasword/code
>has been given.  If yes, then get list of instructions for processing on
>the serverside.
>
>i've been tooling around with $socket->send() and $socket->recv() with
>little success.  There just too little documentation that I can find
>describing these functions.  Plus there's who's talking now and to
>control the flow.

The simplest way to control the flow is to allow one party to talk at
any given time.  Read some RFCs on how this has been handled in the
past -- the FTP RFCs, RFC 821 (SMTP), and the RFCs defining HTTP
(without pipelining) are some examples.

You can look at http://pobox.com/~kragen/sw/dyndns.html for an example
of how I did this.  I haven't tested it on Microsoft OSes, though, and
I don't know if it'll work.

A slightly more difficult way is to allow either party to send data at
any time, which generally requires either (a) one thread at each end to
handle data being received and one thread at each end to handle data
being sent, or (b) an event loop.  I wrote a simple IRC client
(available at http://pobox.com/~kragen/sw/el4-irc-client.tar.gz) which
uses an event loop.  (Obviously, in IRC, you have to do things this way.)
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 2 Nov 1999 17:35:22 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Something like FLY except for JPGs
Message-Id: <slrn81ut8k.tjn.abigail@alexandra.delanet.com>

Rossz (rwentwor@advent.com) wrote on MMCCLIV September MCMXCIII in
<URL:news:7vnat3$aeg$1@nnrp1.deja.com>:
\\ In article <slrn81t8sb.66b.abigail@alexandra.delanet.com>,
\\   abigail@delanet.com wrote:
\\ 
\\ > And your Perl question is?
\\ 
\\ Since the question was asked in a perl newsgroup, it is implied that a
\\ perl solution is being sought.  The first person who responded to the
\\ question did, in fact, provide a perl solution, therefore validating
\\ the question:
\\ 
\\   "PerlMagick will do what you want, but it may be a bit overkill."


PerlMagick runs from the command line?



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\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: Wed, 03 Nov 1999 01:20:59 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Something like FLY except for JPGs
Message-Id: <%5MT3.201$ky4.5489@nsw.nnrp.telstra.net>

On 2 Nov 1999 17:35:22 -0600,
	Abigail <abigail@delanet.com> wrote:
> Rossz (rwentwor@advent.com) wrote on MMCCLIV September MCMXCIII in
> <URL:news:7vnat3$aeg$1@nnrp1.deja.com>:
> \\ In article <slrn81t8sb.66b.abigail@alexandra.delanet.com>,
> \\   abigail@delanet.com wrote:
> \\ 
> \\ > And your Perl question is?
> \\ 
> \\ Since the question was asked in a perl newsgroup, it is implied that a
> \\ perl solution is being sought.  The first person who responded to the
> \\ question did, in fact, provide a perl solution, therefore validating
> \\ the question:
> \\ 
> \\   "PerlMagick will do what you want, but it may be a bit overkill."
> 
> 
> PerlMagick runs from the command line?

No, but any of the ImageMagick commands will, and they have to be
installed before PerlMagick anyway :)

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Never hire a poor lawyer. Never buy
Commercial Dynamics Pty. Ltd.   | from a rich salesperson.
NSW, Australia                  | 


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

Date: 2 Nov 1999 17:36:25 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: string number conversion
Message-Id: <slrn81utaj.tjn.abigail@alexandra.delanet.com>

Larry Rosler (lr@hpl.hp.com) wrote on MMCCLIV September MCMXCIII in
<URL:news:MPG.1288a04f8f01427f98a189@nntp.hpl.hp.com>:
~~ In article <slrn81tjgk.ren.abigail@alexandra.delanet.com> on 2 Nov 1999 
~~ 05:42:50 -0600, Abigail <abigail@delanet.com> says...
~~ 
~~ ...
~~ 
~~ > This one allows for leading and trailing spaces, spaces around the /,
~~ > dies with appropriate messages, defaults to use $_, has a cute final
~~ > expression, allows for an optional sign, and uses the same number
~~ > of lines:
~~ > 
~~ >    sub frac2dec (;$) {
~~ >        local $_ = @_ ? shift : $_;
~~ >        /\d/ && m{^\s*([-+]?)\s*(\d*)\s*(?:(\d+)\s*/\s*(\d+))?\s*$} or
~~ >                die "Not a fraction\n";
~~ >        die "Illegal division by zero" if defined $3 && $3 == 0;
~~                                                    ^^    ^^
~~ 
~~ >        ($1 eq '-' ? -1 : 1) * (($2 || 0) + ($3 || 0) / ($4 || 1));
~~ >    }
~~ 
~~ The denominator is $4, not $3.  "Copy and paste working, tested code."  
~~ Heh, heh, heh.


Oh, I did, I did. I just didn't copy all of it. Read the followup I
did on myself only a few minutes later.


Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 03 Nov 1999 01:05:32 GMT
From: jds7717@my-deja.com
Subject: Sybperl problems
Message-Id: <7vo1oq$s4v$1@nnrp1.deja.com>

I am having trouble getting the Sybperl module to work on my
configuration.  I have the following Sybase components installed via
RPMS on RH 6.1:

sybase-doc-11.9.2-1
sybase-ase-11.9.2-1
sybase-common-11.9.2-1
sybase-openclient-11.1.1-1
sybase-sqlremote-6.0.2-1
sybase-monserver-11.9.2-1

I have rebuilt perl as described in the README.linux without any
problems and I have also built sybperl-2.11 without any errors.  I have
a simple script that I am trying to run and I keep getting the same
error.  Here is the script:

#!/usr/bin/perl

use Sybase::DBlib;

$dbh = new Sybase::DBlib 'sa', PASSWORD, SERVERNAME;

$dbh->dbuse('master');
$sql = "select * from sysprocesses";
$dbh->dbcmd($sql);

$dbh->dbsqlexec;
$dbh->dbresults;

Where PASSWORD and SERVERNAME are set to their appropriate values.  Upon
running this script I get the following error:

DB-Library error:
        Name too long for loginrec field.
Can't call method "dbuse" on an undefined value at ./test.pl line 7.
Exit 115

I can use isql without any problems but I have yet to be able to connect
using the Sybperl module.  Any help would be greatly appreciated.

Jeromy


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 03 Nov 1999 01:01:45 GMT
From: invinfo@my-deja.com
Subject: tie hash NDBM_File CGI.pm
Message-Id: <7vo1ho$s2d$1@nnrp1.deja.com>

OK - I really need some help here - from an expert preferrably,
regarding tied hashes, NDBM_File, in a web application,
that uses CGI.pm.

I have a Frame html page that holds 2 frames ( top and bot ).
My intention is to have
bot - hold a form with entries, and a submit button.
top - should hold a table of all the entries entered, so far.

?1 - Where the Hey is the File Descriptor ?

I'm not writing my own class, but I do
use Fcntl;
use NDBM_File;  # which in turn does  require Tie::Hash;
I know this works outside of my Web app - but I'm not sure how.
Using the Web - I'm getting funky results.

?2 - What should the proper syntax be ??
I've seen both
tie( %FH, 'NDBM_File', 'data', O_RDWR|O_CREAT|O_EXCL, 0666);
tie( %FH, 'NDBM_File', 'data', 1, 0);

?3 - The O_CREAT flag is probably truncating my file the 2nd time
around.  I've started putting in a conditional test on a file glob.
suggestions ?

?4 - bot Frame -  =>action  also shows the last entry -
then displays the form again - so the user can input again.
After the 1st time - it is calling itself recursively.
Obviously one of the inputs suffices as my key.
The problem is that all of the inputs ( txt_fields here )
retain their value when the form was submitted.
Possible solutions ( so far all of them failing ) are
> CGI.pm  textfield( -name .. -size ..., -default='', ... );
> Using javascript to clear out the text boxes (should be possible)
> param('txt_name') = ''  - no go - pal
Any Suggestions ?

?5 - Once the hash is updated and the form refreshes on the bottom,
I will probably need to use something like
onLoad()="javascript:parent.top.refresh" - guessing here - any advice?
top should be fairly generic - Read the hash from disk - spit out table
I would really like to understand the tied hash idea.
And am on the verge of writing my own class if there is nothing
usable set up.
I can't be the only one who has had these problems -
Help Please - Thx very much in advance.

Robert Kattke   invinfo@enteract.com
(708) 524-1922


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 03 Nov 1999 00:59:40 GMT
From: invinfo@my-deja.com
Subject: tie hash, NDBM_File, CGI.pm
Message-Id: <7vo1dr$s08$1@nnrp1.deja.com>

OK - I really need some help here - from an expert preferrably,
regarding tied hashes, NDBM_File, in a web application,
that uses CGI.pm.

I have a Frame html page that holds 2 frames ( top and bot ).
My intention is to have
bot - hold a form with entries, and a submit button.
top - should hold a table of all the entries entered, so far.

?1 - Where the Hey is the File Descriptor ?

I'm not writing my own class, but I do
use Fcntl;
use NDBM_File;  # which in turn does  require Tie::Hash;
I know this works outside of my Web app - but I'm not sure how.
Using the Web - I'm getting funky results.

?2 - What should the proper syntax be ??
I've seen both
tie( %FH, 'NDBM_File', 'data', O_RDWR|O_CREAT|O_EXCL, 0666);
tie( %FH, 'NDBM_File', 'data', 1, 0);

?3 - The O_CREAT flag is probably truncating my file the 2nd time
around.  I've started putting in a conditional test on a file glob.
suggestions ?

?4 - bot Frame -  =>action  also shows the last entry -
then displays the form again - so the user can input again.
After the 1st time - it is calling itself recursively.
Obviously one of the inputs suffices as my key.
The problem is that all of the inputs ( txt_fields here )
retain their value when the form was submitted.
Possible solutions ( so far all of them failing ) are
> CGI.pm  textfield( -name .. -size ..., -default='', ... );
> Using javascript to clear out the text boxes (should be possible)
> param('txt_name') = ''  - no go - pal
Any Suggestions ?

?5 - Once the hash is updated and the form refreshes on the bottom,
I will probably need to use something like
onLoad()="javascript:parent.top.refresh" - guessing here - any advice?
top should be fairly generic - Read the hash from disk - spit out table
I would really like to understand the tied hash idea.
And am on the verge of writing my own class if there is nothing
usable set up.
I can't be the only one who has had these problems -
Help Please - Thx very much in advance.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 02 Nov 1999 23:53:27 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: USA Opportunities for Internet Savvy applicants
Message-Id: <XPKT3.22626$23.1166716@typ11.nn.bcandid.com>

In article <941532812.899160@news.iconz.co.nz>,
Roger Herbert <bozo@example.com> wrote:
>Skills sought, combinations considered in the below list;
>C/C++,Visual C, Visual Basic, SQL,OLE, COM, DCOM, HTML, CGI Scripts, Java
>TM, Unix QA,
>Database QA, API, Perl, ORA Perl,

Is that O'Reilly and Associates Perl?  :)

Or is it the version of Perl4 modified to be able to access Oracle,
from circa 1993?  If so, do you also require COBOL and Autocoder
skills?  :)

>Silicon valley based Company, 3 weeks process time to offer/contract,
>further 6 weeks to H1 Visa.
>
>emails/cv to
>
>bozo@example.com

And your Perl question is?
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 2 Nov 1999 16:48:26 -0800
From: Pornpira Vachareeyanukul <pornpira@beta.tricity.wsu.edu>
Subject: Weird error
Message-Id: <Pine.OSF.4.10.9911021643280.17501-100000@beta.tricity.wsu.edu>

Hi there,
I click on the link and I get server error.  After checking the error log
file and I find this error:

"name without value: got line "caught a sigbus at
/../perl5/lib/site_pert/dbd/oracle.pm line 141"

I'm not sure what this error mean and how to get rid of this problem.

Thanks in advance,
Mimi



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

Date: Tue, 02 Nov 1999 17:42:27 -0800
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Weird error
Message-Id: <381F9303.BD2373F9@cisco.com>

Pornpira Vachareeyanukul wrote:

> I click on the link and I get server error.  After checking the error log
> file and I find this error:
> "name without value: got line "caught a sigbus at
> /../perl5/lib/site_pert/dbd/oracle.pm line 141"
> I'm not sure what this error mean and how to get rid of this problem.
>

Clicking the link is not sending either the username/password or database
connect
string to the server side Oraperl/DBI script. Maybe this is not the right way

to access the server side script.
--



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

Date: Tue, 02 Nov 1999 19:14:25 +0000
From: Tony <010101@technologist.com>
Subject: Why doesn't this work?
Message-Id: <381F380A.19372B56@technologist.com>

I have a form that goes:

<html> <head> <title>Contact Me for More Information</title> <meta
http-equiv="Content-Type"
content="text/html; charset=iso-8859-1"> <link rel="stylesheet"
href="webPro.css"><link
rel="stylesheet" href="orgPg.htm"><style type="text/css"> <!-- .blHd {
font-family: Arial, Helvetica,
sans-serif; font-size: large; font-style: normal; font-weight: bold;
text-decoration: none; color:
#0066CC} .grHd {  font-family: Arial, Helvetica, sans-serif; font-size:
large; font-style: normal;
font-weight: bold; color: #999999; text-decoration: none} --> </style>
  <script language="JavaScript">
<!--
function MM_preloadImages() { //v1.2
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    var preloadArray = new Array();
    for (var i=0; i<imgFiles.length; i++) {
      preloadArray[i] = new Image;
      preloadArray[i].src = imgFiles[i];
    }
  }
}

function MM_swapImage() { //v1.2
  var i,j=0,objStr,obj,swapArray=new
Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName ==
'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null)
||
        (objStr.indexOf('document.all[')   ==0 && document.all
==null))
      objStr =
'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null ||
oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}
//-->
</script>
  <script language="JavaScript">
<!--
function MM_swapImgRestore() { //v1.2
  if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF">
<!-- #BeginBehavior MM_swapImage1 -->
<script language='JavaScript'>
  MM_preloadImages('images/tableof.jpg');
</script>
<!-- #EndBehavior MM_swapImage1 -->
<div align="left">
  <table border="0" width="480" cellspacing="0" name="cntTbl"
align="left" cellpadding="12">
    <tr>
      <td
width="17%"><a href="http://home.att.net/%7Ea.spec" target="_blank"><img
src="images/spw.jpg" width="93" height="134" name="wsp" vspace="0"
hspace="0" alt="me" border="0"></a></td>
      <td width="83%"
class="sbhds"><font size="+5">Ah, so good to see you!</font><br>
        <font size="5">Making selections below will allow us to get more
familiar
        with each other.</font></td>
    </tr>
    <tr>
      <td width="17%" height="43">&nbsp;</td>
      <td width="83%" class="sbhds" height="43">
        <p><span class="sbsbHd"><font
color="#0066CC">Would you like to see my resume? <a href="resume.htm"
class="sbsbHd" target="_blank">Click
          here.</a></font></span></p>
        <p><span class="sbsbHd"><font
color="#0066CC">Would you like to see some of my work? <a
href="http://home.att.net/%7Ea.spec" class="sbsbHd"
target="_blank">Click
          here.</a></font></span></p>
      </td>
    </tr>
    <tr>
      <td width="17%">&nbsp;</td>
      <td
width="83%" class="sbhds">
        <p><span class="blHd"><font color="#0066CC" class="blHd">Would
you like
          to schedule a meeting?</font> <span class="grHd">If
so,</span></span><br>
        <form action="cgi-bin/cntc.cgi">
          <p><span class="blHd">Is there a specific position<br>
            that you'd like me to fulfill for you?</span>
            <select name="tiPos" class="sbsbHd">
              <option selected value="">Pick a title. </option>
              <option value="Art Director">Art Director </option>
              <option value="Artist">Artist </option>
              <option value="Consultant">Consultant </option>
              <option value="Creative Director">Creative Director
</option>
              <option value="Graphic Designer">Graphic Designer
</option>
              <option value="Information Specialist">Information
Specialist </option>
              <option value="Webmaster">Webmaster </option>
            </select>
          </p>
          <p>&nbsp; </p>
          <p><span class="grHd">What day would be good for
you?</span></p>
          <input type="radio" name="pDay" value="Monday">
          <span class="sbsbHd">Monday</span>
          <input type="radio" name="pDay" value="Tuesday">
          <span class="sbsbHd">Tuesday</span>
          <input type="radio" name="pDay" value="Wednesday">
          <span class="sbsbHd">Wednesday</span>
          <input type="radio" name="pDay" value="Thursday">
          <span class="sbsbHd">Thursday</span>
          <input type="radio" name="pDay" value="Friday">
          <span class="sbsbHd">Friday</span>
          <p> <span class="blHd">What is that date?</span>
            <input type="text" name="date" size="21">
          </p>
          <p><span class="blHd">What time would be good for
you?</span></p>
          <p>
            <select name="pTm" class="sbsbHd">
              <option selected value="">Pick a time.
              <option value="10:00 AM">10:00 AM
              <option value="10:30 AM">10:30 AM
              <option value="11:00 AM">11:00 AM
              <option
value="11:30 AM">11:30 AM
              <option value="12 Noon">12 Noon
              <option value="12:30 PM">12:30 PM
              <option value="1:00 PM">1:00 PM
              <option value="1:30 PM">1:30 PM
              <option
value="2:00 PM">2:00 PM
              <option value="2:30 PM">2:30 PM
              <option value="3:00 PM">3:00 PM
              <option value="3:30 PM">3:30 PM
              <option value="4:00 PM">4:00 PM
              <option
value="4:30 PM">4:30 PM
            </select>
          </p>
          <p><span class="grHd"><span
class="blHd">Where are you located?</span><br>
            <font size="-1" color="#999999">(Please include directions
and special
            instructions.)</font></span> <br>
            <textarea name="dir" cols="66" rows="12"></textarea>
          </p>
          <p><span class="blHd">Please enter your name</span>
            <input type="text"
name="name" size="36">
          </p>
          <p><span class="blHd">Company name</span>
            <input
type="text" name="co" size="46">
          </p>
          <p><span class="blHd">Phone number </span>
            <input type="text" name="phno" size="21">
            <span class="blHd"> Extension</span>
            <input type="text" name="ext" size="10">
          </p>
          <p><span class="blHd">E-mail </span>
            <input type="text" name="eml" size="56">
          </p>
          <p align="left">
            <input type="submit" name="submit" value="Submit">
            <input type="reset" name="Reset"
value="Reset">
          </p>
        </form>
      </td>
    </tr>
    <tr>
      <th width="17%" nowrap>&nbsp;</th>
      <th
width="83%" class="sbhds" nowrap> <a href="tocPg.htm" target="_self"
onMouseOver="MM_swapImage('document.tocimg','document.tocimg','images/tableof.jpg','MM_swapImage1')"
onMouseOut="MM_swapImgRestore()"><img src="images/toc.jpg" width="240"
height="40" name="tocimg" border="0" alt="Click here for the Table of
Contents." align="middle"></a></th>
    </tr>
    <tr>
      <td width="17%" nowrap><font face="Arial, Helvetica, sans-serif"
size="1" color="#E6E6E6">APS
        1999</font></td>
      <td
width="83%" class="sbhds" nowrap>&nbsp;</td>
    </tr>
  </table>
  <p>&nbsp;</p>
</div>
</body></html>

and a cgi script that goes:

#!/usr/local/bin/perl
# The name of this file is "cntc.cgi".

#Content-type: text/plain

$MAILFILE="/usr/lib/sendmail.$$";
$MAILADDR="010101\@technologist.com";

$request_method = $ENV{'REQUEST_METHOD'};

# Get the form data

if ($request_method eq "GET") {
    $form_info = $ENV{'QUERY_STRING'};
    }
else {
    $size_of_form_information = $ENV{'CONTENT_LENGTH'};
    read (STDIN, $form_info, $size_of_form_information);
    }

foreach $key_value (@key_value_pairs) {
    ($key, $value) = split (/=/, $key_value);
    $value =~ tr/+/ /;
    $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
        print $key, " = ", $value, "\n";
    }

print "Content-type: text/html", "\n";
print <<THIS1;

<html>
<head>
  <title>Processing the Form</title>
  <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
  <style type="text/css"> <!-- .blHd {  font-family: Arial, Helvetica,
sans-serif; font-size: large; font-style: normal; font-weight: bold;
text-decoration: none; color:
#0066CC} .grHd {  font-family: Arial, Helvetica, sans-serif; font-size:
large; font-style: normal;
font-weight: bold; color: #999999; text-decoration: none} --> </style>
<link rel="stylesheet" href="../webPro.css"></head>

<body bgcolor="#FFFFFF">
<table border="0" width="480" cellspacing="0" name="cntTbl" align="left"
cellpadding="12">
  <tr>
    <td valign="top"
width="120" height="52">
      <h1><span class="blHd">Thank
        you for your interest.</span></h1>
    </td>
    <td width="360"
class="sbhds" align="left" height="52">
      <span class="bdyCpy">This confirms that your form was processed,
with
        the following parameters:</span>
    <hr></td>
  </tr>
  <tr>
    <td valign="top"
width="120">&nbsp;</td>
    <td width="360"
class="bdyCpy">You would
      like to speak to me about doing work as a $FORM{tiPos}<span
class="bdyCpy"> on </span>$FORM{pDay},
      $FORM{date}<span class="bdyCpy"> at </span>$FORM{pTM}.</td>
  </tr>
  <tr>
    <td valign="top"
width="120">&nbsp;</td>
    <td width="360"
class="bdyCpy">Your instructions are: $FORM{txtInsDir}</td>
  </tr>
  <tr>
    <td valign="top"
width="120">&nbsp;</td>
    <td width="360"
class="bdyCpy">Your name: $FORM{name}</td>
  </tr>
  <tr>
    <td valign="top"
width="120">&nbsp;</td>
    <td width="360"
class="bdyCpy">Your company: $FORM{co}</td>
  </tr>
  <tr>
    <td valign="top"
width="120">&nbsp;</td>
    <td width="360"
class="bdyCpy">Your phone number: $FORM{phno}
      ... and its extension: $FORM{ext}</td>
  </tr>
  <tr>
    <td valign="top"
width="120">&nbsp;</td>
    <td width="360"
class="bdyCpy">
      Your e-mail address is: $FORM{eml}</td>
  </tr>
  <tr>
    <td valign="top"
width="120">&nbsp;</td>
    <td width="360"
class="bdyCpy">If any of this is incorrect, simply go Back to the
        previous page and re-Submit your information.
      <hr>
      <span class="bdyCpy"> When I receive your request, I will make an
effort
      to contact you personally so as to confirm your request.
      Thank you for your interest. </span>
      <hr>
      <span class="bdyCpy"><a href="http://home.att.net/~a.spec">Anthony
Stephenson</a></span></td>
  </tr>
</table>
</body>
</html>
THIS1

open(SENDMAIL, "| /usr/lib/sendmail -f010101\@technologist.com -t -n
-oi");

foreach $key_value (@key_value_pairs) {
    ($key, $value) = split (/=/, $key_value);
    $value =~ tr/+/ /;
    $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
        print SENDMAIL $key, " = ", $value, "\n";
    }

print SENDMAIL <<End_Of_Mail;
"From: "$eml <$name of $co> "\n";
"To: 010101\@technologist.com" "\n";
"Subject: Request for Meeting" "\n"; "\n";

"This confirms that an appointment was asked for by:" "\n";
$name" of "$co" for "$pDay, $value" at "$pTm, $value $date, $value "\n";

"Here are the instructions: "$dir"\n";
"Phone number: "$phno" Extension: "ext" "\n";
"They are interested in me doing "$tiPos" work." "\n";


End_Of_Mail


Can anyone explain to me why this is isn't working?

--

Anthony Stephenson
artist & designer
http://home.att.net/~a.spec
010101@technologist.com




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

Date: Tue, 02 Nov 1999 18:03:28 -0800
From: mbudash@wcws.com (Michael Budash)
Subject: Re: Why doesn't this work?
Message-Id: <mbudash-0211991803280001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <381F380A.19372B56@technologist.com>, 010101@technologist.com wrote:

[snip ridiculouly long code post]
 
> Can anyone explain to me why this is isn't working?

define "isn't working"
-- 
Michael Budash ~~~~~~~~~~ mbudash@wcws.com


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

Date: Tue, 02 Nov 1999 23:58:11 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Writing to a dead socket does not cause SIGPIPE
Message-Id: <nUKT3.22637$23.1166768@typ11.nn.bcandid.com>

In article <7vm92f$i1f$1@nnrp1.deja.com>,  <krotfrog@my-deja.com> wrote:
>I am writing a simple client-server perl application.
>The client connects to a TCP socket, and server sends
>a messages to it. When client dies, one more message
>from server can be sent not causing SIGPIPE.

In general, an arbitrary number of messages from the server can be sent
before the server knows the client is dead, because IP doesn't
guarantee bounded-latency delivery of that notification.  Normally the
first write after a socket error returns the error, though; are you
checking the return values on your sends?

If you want to be notified if a client has closed their socket and your
machine has been notified, you can try reading from the socket.  If you
get EOF (read of zero bytes), it has been closed.  Sockets with an EOF
condition pending are treated as having data pending by select().

Consider running truss/strace/ptrace/whateveryouroperatingsystemcallsit
to see the system calls and return values involved.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Nov 02 1999
6 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

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


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