[19553] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1748 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 14 18:06:03 2001

Date: Fri, 14 Sep 2001 15:05:13 -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: <1000505113-v10-i1748@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 14 Sep 2001     Volume: 10 Number: 1748

Today's topics:
        a failure to communicate (Tom Folkes)
    Re: a failure to communicate (Tad McClellan)
    Re: a failure to communicate <thomas@baetzler.de>
    Re: a failure to communicate <tony_curtis32@yahoo.com>
    Re: AoH - continued <dtweed@acm.org>
        closing a "| tee logfile.log" on a C-c (Sten Sogaard)
    Re: Do I need file locking (Randal L. Schwartz)
    Re: Do I need file locking (Anno Siegel)
    Re: Do I need file locking (Malcolm Dew-Jones)
        Does Perl Support Multi-Byte Parsing and Comparision? <muchari@cisco.com>
    Re: embedding variables in an array <thomas@baetzler.de>
    Re: embedding variables in an array <whatever@nevermind.invalid>
    Re: embedding variables in an array <whatever@nevermind.invalid>
    Re: embedding variables in an array (Anno Siegel)
    Re: http server validation (Charles DeRykus)
    Re: http server validation <flavell@mail.cern.ch>
    Re: http server validation <comdog@panix.com>
        killing descendants of a process (Newbie)
    Re: Lotus Notes <projectobjects@earthlink.net>
    Re: max length of keys? <kkoch@kxsu.de>
    Re: mod_perl or PHP for database drive site? <fty@mediapulse.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 14 Sep 2001 12:57:18 -0700
From: tomfolkes@hotmail.com (Tom Folkes)
Subject: a failure to communicate
Message-Id: <7ee7b25f.0109141157.4c75c18a@posting.google.com>

I am new to Perl/CGI.  I have tried to look at posted examples and I
am unable to get this simple form reception to work.

form senting the information is <html>
<head><title></title></head>

<body>
<form action="http://xxxxxx/cgi-bin/test.pl" method="post">
Start Time <input type="text" size="8" name="startdate"
value="xx/xx/xxxx">
<input type="submit">
</form>

</body>
</html>
 

The code receiving the information is 

#!/usr/local/bin/perl


##########Header information################

print "Content-type: text/html\n\n";
#print "<html><head><title></title></head>";
print<<EOT;
<html>
<head>
<title></title>

</head>
<body>
EOT


print "commandlinelen $commandlinelen<P></P>";

print "startdate $FORM{'startdate'} <P></P>";



The new page does fire and the first line prints 
the second line only prints the text "startdate" 

I can't figure out why I am not printing the $FORM('startdate')
information.

Any help would be appreciated. -Tom


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

Date: Fri, 14 Sep 2001 20:10:25 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: a failure to communicate
Message-Id: <slrn9q4mb2.kk3.tadmc@tadmc26.august.net>

Tom Folkes <tomfolkes@hotmail.com> wrote:

>I am new to Perl/CGI.  


Have you read the Perl FAQs that mention CGI?

   perldoc -q CGI

Should find 7 FAQs about CGI stuff, including:

   "How do I decode a CGI form?"


>I have tried to look at posted examples 


There is a lot of crap on the internet. You cannot judge the
quality of what you are looking at if you are new the the subject.

Look on your very own hard disk first, as suggested above.

>and I
>am unable to get this simple form reception to work.

>#!/usr/local/bin/perl


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

Take all the help and already-written code you can get.


>print "startdate $FORM{'startdate'} <P></P>";

>the second line only prints the text "startdate" 
                 ^^^^^^^^^^^

I doubt that, isn't it really printing "startdate  <P></P>"?

Precise descriptions are *required* when debugging code...


>I can't figure out why I am not printing the $FORM('startdate')
                                                   ^           ^

Syntax error.


>information.


Because you never put any information _in_. Can't get it out
until after you put it in.

Where do you think that the %FORM hash got loaded up with values?

I do not see any such place. This is the cause of your problem.


>Any help would be appreciated. -Tom


Use param() function/method in the CGI.pm module.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Fri, 14 Sep 2001 22:17:49 +0200
From: Thomas Bätzler <thomas@baetzler.de>
Subject: Re: a failure to communicate
Message-Id: <kqo4qt823o9dqfhodm29tv1biqk5qqjn95@4ax.com>

On 14 Sep 2001, tomfolkes@hotmail.com (Tom Folkes) wrote:

>I am new to Perl/CGI.  I have tried to look at posted examples and I
>am unable to get this simple form reception to work.

Try "perldoc CGI" for documentation and working samples. Switch on
warnings and taint tests for safety.

#!/usr/bin/perl -wT

use strict;
use CGI qw(:standard);

my $q = new CGI; 

print $q->header(),
        $q->start_html('A Simple Example'),
        $q->h1('A Simple Example'),
        $q->p('Some text bla bla bla'),
        $q->p('Startdate is ' . $q->param("startdate") ),
        $q->end_html();

__END__

HTH,
-- 
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl


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

Date: Fri, 14 Sep 2001 15:19:27 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: a failure to communicate
Message-Id: <87k7z1pltc.fsf@limey.hpcc.uh.edu>

>> On 14 Sep 2001 12:57:18 -0700,
>> tomfolkes@hotmail.com (Tom Folkes) said:

> I am new to Perl/CGI.  I have tried to look at posted
> examples and I am unable to get this simple form
> reception to work.

> ...
> print "commandlinelen $commandlinelen<P></P>";
> print "startdate $FORM{'startdate'} <P></P>";

> I can't figure out why I am not printing the
> $FORM('startdate') information.

There is no variable called $commandlinelen.
There is no variable called %FORM.

Don't forget to "use strict;" and "#!.../perl -w" to give
you warnings about where errors might be in your code.

To get on the right path, "perldoc CGI"; there's no reason
to burden your code with nasty old cgi-lib calls (%FORM).

hth
t
-- 
Yes way!  Mmmmkay?


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

Date: Fri, 14 Sep 2001 18:35:56 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: AoH - continued
Message-Id: <3BA24CD4.BC233B4B@acm.org>

jason "TUnne|ing" wrote:
> As a precaution, I have the absolute path to the directory where my DB
> files are located hard coded. so the only valid value for the db_file
> key is a filename within that directory. Does this fill that hole or
> do you see other ways this can be exploited?
> for example:
> ...
> my $db_dir = '/usr/local/DB/';
> $filename = $q->param("db_file") || $filename; #query or default
> open(FILE,"<${db_dir}$db_file") || die($!);
> ...

You would need to check $filename to make sure it doesn't include
directory separators. You don't want to allow things like
   ../../../etc/passwd
to get through, which will attempt to open
   /usr/local/DB/../../../etc/passwd

> Also, I am having a little trouble understanding how this works, and
> which one is correct, if not both.
> 
> Benjamin Says:
>     @goods = map $_->{@sortkeys}, @data;

This one isn't quite right. The elements of @data are references to hashes,
and the loop is attempting to concatenate a series of slices. However,
there's no clue that the result is supposed to be a slice, so the index
@sortkeys is evaluated in scalar context, resulting in a pair of "undef"s
in @goods, since there are no fields named "3".

> Anno says:
>     @goods = map @{$_}{@sortkeys}, @data;

This one works.

So, the final version of my script would be:

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

my @data; #nonsorted AoH name space
while (<DATA>) {
        chomp;
        push(@data, {split(/\|/,$_)});
}

# pull off the first line of @data to get the sort order
my %sorthash = %{shift @data};
# sort the keys of the hash and pull out the values in that order
my @sortkeys = @sorthash{sort {$a <=> $b } keys %sorthash};

my @goods = map @{$_}{@sortkeys}, @data;

print join (', ', @goods), "\n";
exit;
__DATA__
1|category|3|type|2|info
category|music|type|mp3|info|very good
category|video|info|too long|type|mpeg

-- Dave Tweed


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

Date: 14 Sep 2001 11:35:52 -0700
From: sten_sogaard@juno.com (Sten Sogaard)
Subject: closing a "| tee logfile.log" on a C-c
Message-Id: <5ad86837.0109141035.256e75d1@posting.google.com>

My problem is closing a "|tee logfile" when I break my script
(CTRL-C).

I am redirecting STDOUT to a tee in my script. I have 4 function
calls:

1) openlogfile    - this start a tee into a logfile (fh = LOGFILE)
2) uselogfile     - redirects STDOUT to LOGFILE
3) usestdout      - restores STDOUT
4) closelogfile   - close LOGFILE

when I run my script everything works fine - no problem.

However, the real 'testprog.exe' can take hours and I need to be able
to handle a 'break' (Ctrl-C) nicely.

If I C-c in the middle of the system call the testprog.exe stops as
expected, but closelogfile is not able to close LOGFILE. I believe it
is because 'tee' never stops.

Has anyone had this problem and solved it - please give me some hints.

Thanks, Sten

PS: Perl 5.6.1, WinNT, Cygwin

#=============================================

openlogfile("logfile.log");  # INIT Logfile

print "Hello 1\n"; # STDOUT
uselogfile();      # tee to STDOUT and FILE
print "Starting testprog.exe\n";
system("testprog.exe 10"); # prints out 10 lines with 1 sec delay
usestdout();       # Stop tee'ing
closelogfile();    
print "Hello 3\n";

#=============================================
sub openlogfile {
  $logfilename=shift;
  if (!(open LOGFILE, "| tee $logfilename")) {
    $ErrorMsg = "Could not open $logfilename";
    Stop(1);
  }
  LOGFILE->autoflush(1);
  STDOUT->autoflush(1);
}

my $stdout_flag=0;
sub uselogfile {
  print "Using Logfile\n", if ($debug);
  $stdout_flag=1;
  open(SAVEOUT, ">&STDOUT") or die "can't save stdout: $!\n";
  open(STDOUT, ">&LOGFILE") or die "can't redirect stdout: $!\n";
}

sub usestdout {
  $stdout_flag=0;
  close(STDOUT);
  open(STDOUT, ">&SAVEOUT") or die "can't restore stdout: $!\n";
  print "Using Stdout\n", if ($debug);
}

sub closelogfile {
  if ($stdout_flag) {
    usestdout();
  }

  while (!close LOGFILE) {
    $ErrorMsg = "Could not close logfile";
    print ">>>>Problems Closeing Logfile<<<<\n";
    sleep(1);
  #  Stop(1);
  }
  print "Closed\n";
}


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

Date: 14 Sep 2001 11:05:19 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Do I need file locking
Message-Id: <m17kv1wsv4.fsf@halfdome.holdit.com>

>>>>> "Malcolm" == Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> writes:

Malcolm> For example, two processes, each "owns" a different 100 byte portion of
Malcolm> the file, can both update the same file without locking

Malcolm> 	# in process 1
Malcolm> 	seek FILE , 100 , 0 ;
Malcolm> 	print FILE "This portion of the file belongs to this process";

Malcolm> 	# in process 2
Malcolm> 	seek FILE , 200 , 0 ;
Malcolm> 	print FILE "whereas this portion does not";

Not necessarily.  Most versions of stdio that I've seen perform block
I/O (not byte I/O), and the 8k around the updated byte area would be
"last write wins", because the seek would suck the 8k in, then the
write would update the user-side buffer, then the flush or close would
flush the entire 8k as dirty.

Maybe with sysopen and syswrite, yes.

print "Just another Perl hacker,"

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


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

Date: 14 Sep 2001 18:33:09 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Do I need file locking
Message-Id: <9ntih5$5bl$2@mamenchi.zrz.TU-Berlin.DE>

According to Randal L. Schwartz <merlyn@stonehenge.com>:
> >>>>> "Malcolm" == Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> writes:

[independent updating of records in a file]

> Maybe with sysopen and syswrite, yes.

I think you mean "sysseek", not "sysopen".  There is (as of course you
know) no requirement to sysopen a file you want to syswrite to.

Anno


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

Date: 14 Sep 2001 13:43:53 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Do I need file locking
Message-Id: <3ba26c09@news.victoria.tc.ca>

Randal L. Schwartz (merlyn@stonehenge.com) wrote:
: >>>>> "Malcolm" == Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> writes:

: Malcolm> For example, two processes, each "owns" a different 100 byte portion of
: Malcolm> the file, can both update the same file without locking

: Malcolm> 	# in process 1
: Malcolm> 	seek FILE , 100 , 0 ;
: Malcolm> 	print FILE "This portion of the file belongs to this process";

: Malcolm> 	# in process 2
: Malcolm> 	seek FILE , 200 , 0 ;
: Malcolm> 	print FILE "whereas this portion does not";

: Not necessarily.  Most versions of stdio that I've seen perform block
: I/O (not byte I/O), and the 8k around the updated byte area would be
: "last write wins", because the seek would suck the 8k in, then the
: write would update the user-side buffer, then the flush or close would
: flush the entire 8k as dirty.

: Maybe with sysopen and syswrite, yes.

Hum, and now I think about it, I'm don't remember why I believe that the
low level o.s. routines do atomic updates to byte ranges within a block. 

Updating (e.g. one byte) requires the low level routine does a read-block,
update-byte-range, write-block; but now I start to wonder whether that is
actually an atomic operation within the file/device software.

Until proven otherwise, I take back the no-lock advice completely.



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

Date: Fri, 14 Sep 2001 14:59:39 -0700
From: Murali Chari <muchari@cisco.com>
Subject: Does Perl Support Multi-Byte Parsing and Comparision?
Message-Id: <3BA27DCB.374B06BA@cisco.com>

Hi,

We are using 5.005_02 built for sun4-solaris and would like to know if
this version can
support Multi-Byte Parsing and Comparsion or if there are any
downloadable modules/code
which would accomplish this. ( We have to stick to this Perl version we
have, for a while.)

Please email me to share your thoughts. (and code if you have any. ;-)

-Murali



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

Date: Fri, 14 Sep 2001 20:39:55 +0200
From: Thomas Bätzler <thomas@baetzler.de>
Subject: Re: embedding variables in an array
Message-Id: <4ej4qt4ll3n676ii74tjrv8k67qo96ic13@4ax.com>

On Fri, 14 Sep 2001, Thomas Bätzler <thomas@baetzler.de> wrote:
>On Fri, 14 Sep 2001, asif <whatever@nevermind.invalid> wrote:
>>I'm building an array, some elements of which can't be calculated until 
>>the entire array has been built. I would like to avoid a 2-pass solution 
>>if possible. I should add that these elements occur throughout the 
>>array, not at the end: they're percentages of the whole, thus need the 
>>total values before they can be calculated.
[...]
>The clean way would be to write your own class, probably based on the
>code in Tie::Array. Check out "perldoc perltie" for more details.

Actually, I had something like this in mind :-)

#!/usr/bin/perl -w

use strict;
use Tie::Array;

# create a subclass
package Tie::ComputingArray;
use vars qw(@ISA);

# our class is derived from Tie::StdArray
@ISA = qw( Tie::StdArray );

# overload all methods that access data
# code refs will be executed; all other data
# will be passed back verbatim

sub FETCH {
  my( $self, $index ) = @_;

  if( ref( my $frob = $self->[$index] ) eq "CODE" ){
    # also store computed data for later access
    return $self->[$index] = $frob->();
  } else {
    return $frob;
  }
}

sub POP {
  my( $self, $index ) = @_;

  if( ref( my $frob = pop(@$self) ) eq "CODE" ){
    return $frob->();
  } else {
    return $frob;
  }
}

sub SHIFT {
  my( $self, $index ) = @_;

  if( ref( my $frob = shift(@$self) ) eq "CODE" ){
    return $frob->();
  } else {
    return $frob;
  }
}

sub SPLICE {
 my $self = shift;

 return map {
          ref( $_ ) eq "CODE" ? $_->() : $_
             } $self->SUPER::splice(@_);
}


package main;

my @array;

# bind an array to our class
tie @array, 'Tie::ComputingArray';

# load data into array - code refs will be
# evaluated on access
push @array, ('foo', sub { return 'baz' }, 'bar' );

# show data
print join( ', ', @array ), "\n";

__END__

HTH,
-- 
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl


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

Date: Fri, 14 Sep 2001 19:13:55 GMT
From: asif <whatever@nevermind.invalid>
Subject: Re: embedding variables in an array
Message-Id: <3BA25706.9050509@nevermind.invalid>

Anno Siegel wrote:

> According to asif  <whatever@nevermind.invalid>:
> 
>>Can someone provide a solution or point me to the perldoc which might 
>>get me started in the right direction:
>>
>>I'm building an array, some elements of which can't be calculated until 
>>the entire array has been built.
>>
> 
> Even at this point, this looks like an awkward data structure.  If some
> elements have a distinctly different status than others, they should
> probably not go into the same array.


I'm tagging formatted data for a composition system. The end result is 
financial statements. Multiple records, multiple record types per 
account; not necessarily in the correct sequence. I'm not building a 
database, just parsing the records, extracting and tagging the fields 
that are to be printed. I'm using the arrays as stacks to push the 
tagged data on. Multiple arrays per statement, one for each security 
type (bonds, equities, cash equivalents...).  Shift the tagged data off 
at the account breaks.


> 
> 
>>                                  I would like to avoid a 2-pass solution 
>>if possible.
>>
> 
> Why?  Presumably, you are keeping all the data in memory because you
> want random access.  Use it.


But I really don't want random access to it. I don't want the overhead. 
Just buckets to hold the various information until it's written to 
output. Input is sent to the various buckets as appropriate, the buckets 
are dumped in sequence. I don't need to pay attention to what any given 
array element is once it's been pushed on the array.


> 
> 
>>              I should add that these elements occur throughout the 
>>array, not at the end: they're percentages of the whole, thus need the 
>>total values before they can be calculated.
>>
> 
> Again, why would you want to store percentages among the data they
> are percentages of?  Even if you want to display (or otherwise use)
> them in that sequence, it will be easier to build the corresponding
> lists on the fly, but store them in different places.


The statment required calculation of the dollar values of the security 
types and percentages of the total portfolio (e.g. "some_security_class 
: 33%", followed by a detailed listing of each security in that class). 
  Hense, the percentages had to be available prior to the calculation of 
subtotals and totals. I ended up with a second array (stack) that I 
pushed the subtotals on and shifted off prior to dumping (err, shifting) 
the related "detail" arrays.


> 
> 
>>I would like to push a "place holder" onto the array at the appropriate 
>>points as I read data in and then assign the corresponding calculated 
>>value to it as I shift items off. The various escape/quote sequences 
>>I've tried have been unsuccessful.
>>
> 
> If the data structure *must* remain as it is, undef would be a good
> placeholder.  Fill it in as needed, even if what's needed is a second
> pass.
> 
> 
>>I guess what I'm trying to do is shield the variable from evaluation 
>>going into the array but allow it to be interpreted on the way out. Is 
>>this possible?
>>
> 
> Yes, things like delayed execution are possible in Perl.  You'd use
> a closure (perldoc perlsub for that), or (shudder) string eval.  But
> I don't think you need that relatively sophisticated approach.
> 
> Use sum variable(s) to calculate the total(s) as you go along.  When
> all the data are in, fill in the percentages, where-ever you decide
> to store them.
> 
> Anno


I was really hoping for a quick & dirty (err, easy) way to get the 
percentages into the various buckets. It looks like it would be more 
trouble that it's worth (cpu cycles-wise). Thanks for the suggestions.

/whatever

 




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

Date: Fri, 14 Sep 2001 19:42:48 GMT
From: asif <whatever@nevermind.invalid>
Subject: Re: embedding variables in an array
Message-Id: <3BA25DCB.3080904@nevermind.invalid>

Thomas Bätzler wrote:

> On Fri, 14 Sep 2001, Thomas Bätzler <thomas@baetzler.de> wrote:
> 
>>On Fri, 14 Sep 2001, asif <whatever@nevermind.invalid> wrote:
>>
>>>I'm building an array, some elements of which can't be calculated until 
>>>the entire array has been built. I would like to avoid a 2-pass solution 
>>>if possible. I should add that these elements occur throughout the 
>>>array, not at the end: they're percentages of the whole, thus need the 
>>>total values before they can be calculated.
>>>
> [...]
> 
>>The clean way would be to write your own class, probably based on the
>>code in Tie::Array. Check out "perldoc perltie" for more details.
>>
> 
> Actually, I had something like this in mind :-)



<snip/>

Ouch... Thanks for the code, but overkill for this application. I'm 
sorry to have put you through that effort. In the future I'll be more 
careful in describing what I'm trying to achieve. My response to Anno 
contains some additional details. Basically, I'm using the arrays as 
stacks for temporary storage of print items.

Thanks, and sorry again.

/whatever




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

Date: 14 Sep 2001 19:54:46 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: embedding variables in an array
Message-Id: <9ntna6$9kr$1@mamenchi.zrz.TU-Berlin.DE>

According to asif  <whatever@nevermind.invalid>:
> Anno Siegel wrote:

[big snip]

> > Yes, things like delayed execution are possible in Perl.  You'd use
> > a closure (perldoc perlsub for that), or (shudder) string eval.  But
> > I don't think you need that relatively sophisticated approach.
> > 
> > Use sum variable(s) to calculate the total(s) as you go along.  When
> > all the data are in, fill in the percentages, where-ever you decide
> > to store them.
> > 
> > Anno
> 
> 
> I was really hoping for a quick & dirty (err, easy) way to get the 
> percentages into the various buckets. It looks like it would be more 
> trouble that it's worth (cpu cycles-wise). Thanks for the suggestions.

I don't think you would save cpu cycles that way.  As far as I can see,
you want a spreadsheet-like action on an array, where some fields are
defined in terms of the content of others.  In another subthread
Thomas Bätzler suggested a tied array that may go in that direction.
You could also use an object that duplicates as an arrayref for a similar
purpose.

None of these are quick-and-dirty (only dirty :).  There may be a module
out there that has the functionality you want, but then the dirty part
is finding it.

Anno


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

Date: Fri, 14 Sep 2001 18:22:42 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: http server validation
Message-Id: <GJo0Du.J8x@news.boeing.com>

In article <comdog-8B400A.09232914092001@news.panix.com>,
brian d foy  <comdog@panix.com> wrote:
>In article <m3sndqeh1r.fsf@mumonkan.sunstarsys.com>, Joe Schaefer 
><joe+usenet@sunstarsys.com> wrote:
>
>> brian d foy <comdog@panix.com> writes:
>
>> > you have to work harder to check if the server is not alive since some
>> > servers do not handle HEAD correctly. ;)
>
>> I'm not sure I understand your point here- I would think that simply
>> having a listener on port 80 would constitute most people's definition 
>> of a "live" server.
>
>if you don't get back something that can be understood as an HTTP
>response, HEAD might give you a false negative.  this is something
>i have had to deal with in practice, rather than theory. ;)

Probably rare but some servers disallow HEAD and return 405... 
is that the reason for the smiley. 

The LWP::Simple solution would have grow less simple :)   

--
Charles DeRykus


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

Date: Fri, 14 Sep 2001 21:01:19 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: http server validation
Message-Id: <Pine.LNX.4.30.0109142058420.13362-100000@lxplus023.cern.ch>

On Sep 14, Charles DeRykus inscribed on the eternal scroll:

> Probably rare but some servers disallow HEAD and return 405...

RFC2616 section 5.1.1

  The methods GET and HEAD MUST be supported by all general-purpose
  servers.

ergo: any server which fails to support HEAD must be a special-purpose
server.   :-}


-- 

    "No, nothing is wrong.  It's just not doing what you want."
                                              - Dave Pawson on comp.text.xml




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

Date: Fri, 14 Sep 2001 15:44:49 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: http server validation
Message-Id: <comdog-4ED367.15444914092001@news.panix.com>

In article 
<Pine.LNX.4.30.0109142058420.13362-100000@lxplus023.cern.ch>, "Alan J. 
Flavell" <flavell@mail.cern.ch> wrote:

> On Sep 14, Charles DeRykus inscribed on the eternal scroll:

> RFC2616 section 5.1.1

>   The methods GET and HEAD MUST be supported by all general-purpose
>   servers.

> ergo: any server which fails to support HEAD must be a special-purpose
> server.   :-}

of course, Alan knows the difference between compliant and non-
compliant. :)

-- 
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



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

Date: 14 Sep 2001 13:54:44 -0700
From: youradmirer@onebox.com (Newbie)
Subject: killing descendants of a process
Message-Id: <582bc82b.0109141254.73e4008f@posting.google.com>

i'd like to kill all descendants of a process and those of its
subprocesses (grandchildren etc). I digged through many messages on
this board which seemed to help out but it didn't work for me. the
simple example on perlipc man page didn't help either. here's what
i've tried and failed.

fork process A 
   setpgrp(0, 0)
   fork a number of processes in A 
       process X execs command xx
       process Y execs command yy
       process Z execs command zz
       .
       .
       .

some time later, i issued a kill -9 => -$pidA which was supposed to
kill process A and all of its group members (descendants) as perlipc
and many messages on this board indicates(i also tried kill 9 =>
-$pidA, kill -9 => $pidA, all attempts failed though). However, as
soon as i killed process A, the pid of the subprocesses X, Y, Z etc.
was automatically changed to 1 while they had pidA as their parent pid
before the kill. Therefore, these subprocess became children of the
init process and they didn't die.  my perl stuff is running on
alpha-dec machines with V4.0 OS.  Help is greatly appreciated. Thanks.


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

Date: Fri, 14 Sep 2001 18:59:26 GMT
From: "Dale Henderson" <projectobjects@earthlink.net>
Subject: Re: Lotus Notes
Message-Id: <isso7.7895$s97.831564@newsread1.prod.itd.earthlink.net>

I believe Notes supports ODBC, therefore the DSN will be available for
connecting via DBD::ODBC.

"Hansgeorg Zauner" <hg_zauner@gmx.de> wrote in message
news:9nsuq5$9b2u7$1@ID-45951.news.dfncis.de...
> Is there a way to access a Lotus Notes Database from perl?
> I could not find any module for this purpose.
>
> Thanx
>
>
>




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

Date: Fri, 14 Sep 2001 20:09:11 +0200
From: Klaus Koch <kkoch@kxsu.de>
Subject: Re: max length of keys?
Message-Id: <9nth2e$9jcgg$1@ID-101758.news.dfncis.de>

thanks to all who helped. my keys won't get that big, but good to know how
far you can go...


Simon Oliver wrote:

> Perhaps you could store a digest of the key as the hash key and store the
> data as a nested hash?




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

Date: Fri, 14 Sep 2001 19:29:33 GMT
From: "Jay Flaherty" <fty@mediapulse.com>
Subject: Re: mod_perl or PHP for database drive site?
Message-Id: <xUso7.323083$NK1.30252152@bin3.nnrp.aus1.giganews.com>

"kramer" <zoaraster@mailcity.com> wrote in message
news:9e811fcc.0109131345.2f40a281@posting.google.com...
> I am creating a high traffic MySQL based database site (kind of like
> one of those dating sites but different).  Anyway which is better PHP
> or mod_perl in terms of speed, stability, and development time.

What is your name?  Jay.
What is your quest? I seek the holy grail.
Which is better, PHP or mod_perl in terms of speed, stability, and
development time? Perl! No, PHP!, Ahhhhhhhhhhhhhhh!!!

Jay






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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.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 V10 Issue 1748
***************************************


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