[31224] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2469 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 10 14:09:50 2009

Date: Wed, 10 Jun 2009 11:09:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 10 Jun 2009     Volume: 11 Number: 2469

Today's topics:
        compare two booleans for equality? <bugbear@trim_papermule.co.uk_trim>
    Re: compare two booleans for equality? <cwilbur@chromatico.net>
    Re: compare two booleans for equality? <jurgenex@hotmail.com>
    Re: compare two booleans for equality? sln@netherlands.com
    Re: compare two booleans for equality? <ben@morrow.me.uk>
    Re: compare two booleans for equality? sln@netherlands.com
    Re: compare two booleans for equality? sln@netherlands.com
    Re: compare two booleans for equality? <cwilbur@chromatico.net>
    Re: compare two booleans for equality? sln@netherlands.com
    Re: compare two booleans for equality? <1usa@llenroc.ude.invalid>
    Re: compare two booleans for equality? <ben@morrow.me.uk>
    Re: Counting the total number of keys in a hash of hash sln@netherlands.com
    Re: FAQ 4.59 How can I know how many entries are in a h <derykus@gmail.com>
    Re: FAQ 4.59 How can I know how many entries are in a h <tadmc@seesig.invalid>
    Re: FAQ 4.59 How can I know how many entries are in a h <derykus@gmail.com>
    Re: perl and CGI <glennj@ncf.ca>
    Re: perl and CGI <1usa@llenroc.ude.invalid>
    Re: perl and CGI <jurgenex@hotmail.com>
    Re: perl and CGI <1usa@llenroc.ude.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 10 Jun 2009 16:48:58 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: compare two booleans for equality?
Message-Id: <RJKdnZYTrZJ3SLLXnZ2dnUVZ8mSdnZ2d@brightview.co.uk>

I have two scalars, representing the results of tests.

I exploit the flexibility of perl so
that as long as the scalars functions correctly
in a condition

if($scalar) { ...

I deem them "good".

Now, I would like to compare the two scalars,
to see if they match:

essentially:

$condition1 = getCondition1();
$condition2 = getCondition2();

if($condition1 == $condition2) { ...

But this doesn't do what I want. There's a wide
range of legal (and useful) values for the scalars,
and they might well be different, but all represent "truth"
or "falsehood".

So - what's a nice way of comparing the "truth" of two
scalars, as opposed to (just) comparing the scalars?

clearly:

sub bool {
     my ($b) = @_;
     return $b ? true : false;
}

if(bool($condition1) == bool($condition2)) { ...

works, but it's a bit of a sledgehammer to crack a nut.

Can anyone do better?

    BugBear


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

Date: Wed, 10 Jun 2009 12:09:46 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: compare two booleans for equality?
Message-Id: <868wk0xe7p.fsf@mithril.chromatico.net>

>>>>> "bugbear" == bugbear  <bugbear@trim_papermule.co.uk_trim> writes:

    bugbear> So - what's a nice way of comparing the "truth" of two
    bugbear> scalars, as opposed to (just) comparing the scalars?

if ($foo && $bar or !$foo && !$bar) probably makes your intent clearest.

if (!!$foo == !!$bar) is a trick I learned back in my C days.

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Wed, 10 Jun 2009 09:10:08 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: compare two booleans for equality?
Message-Id: <mjmv25dfe5k1viarsofcf6fsals86pt20m@4ax.com>

bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
>I have two scalars, representing the results of tests.
>
>I exploit the flexibility of perl so
>that as long as the scalars functions correctly
>in a condition
>
>if($scalar) { ...
>
>I deem them "good".
>
>Now, I would like to compare the two scalars,
>to see if they match:

Try 
	NOT XOR(A, B)

jue


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

Date: Wed, 10 Jun 2009 09:17:56 -0700
From: sln@netherlands.com
Subject: Re: compare two booleans for equality?
Message-Id: <vkmv251dqdee60ukomo62d23r9qrbc301n@4ax.com>

On Wed, 10 Jun 2009 16:48:58 +0100, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:

>I have two scalars, representing the results of tests.
>
>I exploit the flexibility of perl so
>that as long as the scalars functions correctly
>in a condition
>
>if($scalar) { ...
>
>I deem them "good".
>
>Now, I would like to compare the two scalars,
>to see if they match:
>
>essentially:
>
>$condition1 = getCondition1();
>$condition2 = getCondition2();
>
>if($condition1 == $condition2) { ...
>
>But this doesn't do what I want. There's a wide
>range of legal (and useful) values for the scalars,
>and they might well be different, but all represent "truth"
>or "falsehood".
>
>So - what's a nice way of comparing the "truth" of two
>scalars, as opposed to (just) comparing the scalars?
>
>clearly:
>
>sub bool {
>     my ($b) = @_;
>     return $b ? true : false;
>}
>
>if(bool($condition1) == bool($condition2)) { ...
>
>works, but it's a bit of a sledgehammer to crack a nut.
>
>Can anyone do better?
>
>    BugBear

If you want to test the truth of 2 things:
  condition1 && condition2

If you want to test the equality of 2 things
(that may have a false condition):
  condition1 == condition2

-sln



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

Date: Wed, 10 Jun 2009 17:20:09 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: compare two booleans for equality?
Message-Id: <p235g6-ol1.ln1@osiris.mauzo.dyndns.org>


Quoth bugbear <bugbear@trim_papermule.co.uk_trim>:
> I have two scalars, representing the results of tests.
> 
> I exploit the flexibility of perl so
> that as long as the scalars functions correctly
> in a condition
> 
> if($scalar) { ...
> 
> I deem them "good".
> 
> Now, I would like to compare the two scalars,
> to see if they match:
> 
> essentially:
> 
> $condition1 = getCondition1();
> $condition2 = getCondition2();
> 
> if($condition1 == $condition2) { ...
> 
> But this doesn't do what I want. There's a wide
> range of legal (and useful) values for the scalars,
> and they might well be different, but all represent "truth"
> or "falsehood".
> 
> So - what's a nice way of comparing the "truth" of two
> scalars, as opposed to (just) comparing the scalars?

One way would be

    unless ($condition1 xor $condition2) {

(it's always somewhat puzzled me that there's no ^^ operator...).

> clearly:
> 
> sub bool {
>      my ($b) = @_;
>      return $b ? true : false;
> }
> 
> if(bool($condition1) == bool($condition2)) { ...
> 
> works, but it's a bit of a sledgehammer to crack a nut.

The standard idiom for boolifying is '!!'. So you could also use

    if (!!$condition1 == !!$condition2) {

if you're unhappy with the idea of xors.

Ben



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

Date: Wed, 10 Jun 2009 09:33:59 -0700
From: sln@netherlands.com
Subject: Re: compare two booleans for equality?
Message-Id: <o1ov251dkdi5qpf28po471of46s6jsp0oh@4ax.com>

On Wed, 10 Jun 2009 12:09:46 -0400, Charlton Wilbur <cwilbur@chromatico.net> wrote:

>>>>>> "bugbear" == bugbear  <bugbear@trim_papermule.co.uk_trim> writes:
>
>    bugbear> So - what's a nice way of comparing the "truth" of two
>    bugbear> scalars, as opposed to (just) comparing the scalars?
>
>if ($foo && $bar or !$foo && !$bar) probably makes your intent clearest.
>
>if (!!$foo == !!$bar) is a trick I learned back in my C days.
     ^^^^^^^^^^^^^^^^
       $foo == $bar

They changed it in C++

-sln


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

Date: Wed, 10 Jun 2009 09:49:34 -0700
From: sln@netherlands.com
Subject: Re: compare two booleans for equality?
Message-Id: <ajov25t9sq60mcte36nq11u08lppjqemon@4ax.com>

On Wed, 10 Jun 2009 16:48:58 +0100, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:

>But this doesn't do what I want. There's a wide
>range of legal (and useful) values for the scalars,
>and they might well be different, but all represent "truth"
>or "falsehood".
>
The most modern, readable way of doing it is

Truth:
if ( condition1 && condition1 == condition2)

False:
if ( !condition1 && condition1 == condition2)

Either one, but not both.

-sln



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

Date: Wed, 10 Jun 2009 12:48:56 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: compare two booleans for equality?
Message-Id: <864ouoxcef.fsf@mithril.chromatico.net>

>>>>> "sln" == sln  <sln@netherlands.com> writes:

    sln> If you want to test the equality of 2 things (that may have a
    sln> false condition): condition1 == condition2

This is Perl, not C++.

Charlton



-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Wed, 10 Jun 2009 09:55:59 -0700
From: sln@netherlands.com
Subject: Re: compare two booleans for equality?
Message-Id: <n9pv255uqmtve078clua5hrclo1g0g3cap@4ax.com>

On Wed, 10 Jun 2009 09:33:59 -0700, sln@netherlands.com wrote:

>On Wed, 10 Jun 2009 12:09:46 -0400, Charlton Wilbur <cwilbur@chromatico.net> wrote:
>
>>>>>>> "bugbear" == bugbear  <bugbear@trim_papermule.co.uk_trim> writes:
>>
>>    bugbear> So - what's a nice way of comparing the "truth" of two
>>    bugbear> scalars, as opposed to (just) comparing the scalars?
>>
>>if ($foo && $bar or !$foo && !$bar) probably makes your intent clearest.
>>
>>if (!!$foo == !!$bar) is a trick I learned back in my C days.
>     ^^^^^^^^^^^^^^^^
>       $foo == $bar
>
>They changed it in C++
>
>-sln

My bad, your right, $foo as a range of values,
!!$foo boolifies. Sorry. Nice trick.

-sln


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

Date: Wed, 10 Jun 2009 17:06:12 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: compare two booleans for equality?
Message-Id: <Xns9C26854E3DFEFasu1cornelledu@127.0.0.1>

Ben Morrow <ben@morrow.me.uk> wrote in news:p235g6-ol1.ln1
@osiris.mauzo.dyndns.org:

> 
> Quoth bugbear <bugbear@trim_papermule.co.uk_trim>:
>> I have two scalars, representing the results of tests.
>> 
>> I exploit the flexibility of perl so
>> that as long as the scalars functions correctly
>> in a condition
>> 
>> if($scalar) { ...
>> 
>> I deem them "good".
>> 
>> Now, I would like to compare the two scalars,
>> to see if they match:
>> 
>> essentially:
>> 
>> $condition1 = getCondition1();
>> $condition2 = getCondition2();
>> 
>> if($condition1 == $condition2) { ...
>> 
>> But this doesn't do what I want. There's a wide
>> range of legal (and useful) values for the scalars,
>> and they might well be different, but all represent "truth"
>> or "falsehood".
>> 
>> So - what's a nice way of comparing the "truth" of two
>> scalars, as opposed to (just) comparing the scalars?
> 
> One way would be
> 
>     unless ($condition1 xor $condition2) {
> 
> (it's always somewhat puzzled me that there's no ^^ operator...).

There is xor though:

#!/usr/bin/perl

use strict;
use warnings;

print map { ($_->[0] xor $_->[1]) ? 'T' : 'F' } (
    [1, 1],
    ['sinan', time],
    [42, 'T'],
    [F => 0],
);

__END__

C:\Temp> z
FFFT

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 10 Jun 2009 18:56:47 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: compare two booleans for equality?
Message-Id: <vn85g6-ta51.ln1@osiris.mauzo.dyndns.org>


Quoth "A. Sinan Unur" <1usa@llenroc.ude.invalid>:
> Ben Morrow <ben@morrow.me.uk> wrote in news:p235g6-ol1.ln1
> @osiris.mauzo.dyndns.org:
> > 
> >     unless ($condition1 xor $condition2) {
                           ^^^^^
> > 
> > (it's always somewhat puzzled me that there's no ^^ operator...).
> 
> There is xor though:

One of us is very confused... :)

What has puzzled me is that while there are both bitwise '^' and low-prec
'xor' forms, there's no high-prec logical '^^' form. It just seems a
curious ommission. I guess at some point somebody thought that the
concept of 'logical XOR' was sufficiently obscure that it ought to be
written out in words.

Ben



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

Date: Wed, 10 Jun 2009 07:10:10 -0700
From: sln@netherlands.com
Subject: Re: Counting the total number of keys in a hash of hashes
Message-Id: <itev25p7jecpb1agvc703hb43im143b2ui@4ax.com>

On Tue, 09 Jun 2009 14:10:14 -0700, sln@netherlands.com wrote:

>On Sun, 7 Jun 2009 22:04:56 -0700 (PDT), Mahurshi Akilla <mahurshi@gmail.com> wrote:
>
>>Is there an easy way to count the # of keys in a hash of hashes?
>>
>>e.g.
>>Say I have a hash like the following:
>>$myhash{key1}{key2}
>>
>>I want to count the total number of keys in $myhash without looping
>>through the whole thing.  The answer is typically #key1 x #key2
>>
[snip]
>
>use strict;
>use warnings;
>use Data::Dumper;
>
>my @ar1 = ('autoTestSoftware001',{50  => 'autoTestSoftware050'});
>my @ar2 = ('autoTestSoftware051',{100 => 'autoTestSoftware100'});
>
>push @ar1, [ar1 => \@ar2];
>
>#my $softwareListRef = [\(@ar1, @ar2)];
>my $softwareListRef = {root => [\(@ar1, @ar2)]};
>
>push @ar1, {SWLF => $softwareListRef};
>
>print Dumper( $softwareListRef );
>
>my $result = getVariableMetrics ($softwareListRef, 'purge' => 1);
>
>print <<MSG;
>Metrics:
>  Hashs  = $result->{hashs}
>  Keys   = $result->{keys}
>  Arrays = $result->{arrays}
>  Others = $result->{others}
>  Depth  = $result->{depth}
>MSG
>
>for (keys %{$result->{hseen}}) {
>	print "  Seen   = $result->{hseen}{$_} x $_\n";
>}
>
>print Dumper( \@ar1 );
>print Dumper( \@ar2 );
>print Dumper( $softwareListRef );
>
>exit (0);
>
>## -------------
>
>sub getVariableMetrics # '$var' can be anything
>{
>	my ($var, @args) = @_;
>	$result =
        ^^^^^^^
will run afoul here if not a function scoped my variable
>	{		# Scalar Results and misc vars:

Obviously a cut n' paste error when refactored.

I would visually distinquish variable names:

-------------------
[chop]
my $metric = getVariableMetrics ($softwareListRef, 'purge' => 1);

print <<MSG;
Metrics:
  Hashs  = $metric->{hashs}
  Keys   = $metric->{keys}
  Arrays = $metric->{arrays}
  Others = $metric->{others}
  Depth  = $metric->{depth}
MSG

for (keys %{$metric->{hseen}}) {
	print "  Seen   = $metric->{hseen}{$_} x $_\n";
}
[chop]
## -------------

sub getVariableMetrics # '$var' can be a ref to anything
{
	my ($var, @args) = @_;
	my $result =
	{		# Scalar Results and misc vars:
[chop]
------------------

-sln



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

Date: Wed, 10 Jun 2009 04:01:11 -0700 (PDT)
From: Anonymous <derykus@gmail.com>
Subject: Re: FAQ 4.59 How can I know how many entries are in a hash?
Message-Id: <90ab18d0-ea57-4409-bbd8-431ad50fadf6@n21g2000vba.googlegroups.com>

On Jun 10, 1:30=A0am, brian d  foy <brian.d....@gmail.com> wrote:
> In article <slrnh2o5lh.28vp.wil...@snail.stack.nl>, Willem
>
> <wil...@snail.stack.nl> wrote:
> > jida...@jidanni.org wrote:
> > ) PerlFAQ Server <br...@stonehenge.com> writes:
> > )> 4.59: How can I know how many entries are in a hash?
>
> f you mean ALL the entries, even recursively, then try e.g.,
>
> > )
> > ) use Data::Walk; #from CPAN
> > ) my $count =3D 0;
> > ) walkdepth( sub {$count++;}, %HoH );
> > ) print "count=3D$count\n";
>
> > There's nothing F about the A-ing of that Q.
>
> As I noted to jidanni in private email, the code doesn't even work.
> The Data::Walk module doesn't have any way to tell you how many
> keys it saw. It would take a lot of surgery to give it that capability.
> I gave up on it after about half an hour.
>
> Too bad too, because that would have been a nice feature.

Since the FAQ question is "How can I know how many entries
are in a hash?", why not just replace "entries" with "keys"
in the question itself and avoid any ambiguity; or, replace
"hash" with the more general "data structure" and keep the reference
to Data::Walk since someone might then reasonably
infer entries to be a total count of nodes.

--
Charles DeRykus



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

Date: Wed, 10 Jun 2009 07:01:53 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: FAQ 4.59 How can I know how many entries are in a hash?
Message-Id: <slrnh2v85h.qng.tadmc@tadmc30.sbcglobal.net>

Anonymous <derykus@gmail.com> wrote:
^^^^^^^^^

I'd suggest using something else there to avoid potential scoring-down
of your posts...


> Since the FAQ question is "How can I know how many entries
> are in a hash?", why not just replace "entries" with "keys"
         ^^^^^^
         ^^^^^^
> in the question itself and avoid any ambiguity;


The ambiguity doesn't come from entries vs keys.

It comes from "a hash" meaning meaning "a hash and all of its sub-hashes".

As I recall, the OP had 3 hashes, 2 sub-hashes inside of a parent 
hash and he didn't want the count for "a hash" but rather for all 
of them together.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Wed, 10 Jun 2009 10:08:05 -0700 (PDT)
From: Anonymous <derykus@gmail.com>
Subject: Re: FAQ 4.59 How can I know how many entries are in a hash?
Message-Id: <75fa09da-8142-4dc5-8d26-12d77b8384f5@s16g2000vbp.googlegroups.com>

On Jun 10, 5:01=A0am, Tad J McClellan <ta...@seesig.invalid> wrote:
> Anonymous <dery...@gmail.com> wrote:
>
> ^^^^^^^^^
>'d suggest using something else there to avoid
> potential scoring-down of your posts...

Yup, thanks.

>
> > Since the FAQ question is "How can I know how many entries
> > are in a hash?", why not just replace "entries" with "keys"
>
> =A0 =A0 =A0 =A0 =A0^^^^^^
> =A0 =A0 =A0 =A0 =A0^^^^^^
>
> > in the question itself and avoid any ambiguity;
>
> The ambiguity doesn't come from entries vs keys.
>
> It comes from "a hash" meaning meaning "a hash and all of its sub-hashes"=
 .
>
> As I recall, the OP had 3 hashes, 2 sub-hashes inside of a parent
> hash and he didn't want the count for "a hash" but rather for all
> of them together.
>

No, I don't agree.  He wasn't interested in just the count of keys in
the top-level or even all the sub-
levels  --  but rather a  count of all nodes for the entire data
structure. That's why  Data::Walk was suggested to get the count. It
was an unusual request
of course but the ambiguity related at least in part to what
constitutes a count of the "entries" in a data structure.

--
Charles DeRykus



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

Date: 10 Jun 2009 13:51:48 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: perl and CGI
Message-Id: <slrnh2vejk.bl0.glennj@smeagol.ncf.ca>

At 2009-06-10 02:50AM, "Vit" wrote:
>          open(MAIL, "|/usr/sbin/sendmail");

try /usr/lib/sendmail

You seem to have ignored the best advice so far:  find your web server
error log and read it.

-- 
Glenn Jackman
    Write a wise saying and your name will live forever. -- Anonymous


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

Date: Wed, 10 Jun 2009 15:41:25 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: perl and CGI
Message-Id: <Xns9C2676EE6C54Dasu1cornelledu@127.0.0.1>

Jürgen Exner <jurgenex@hotmail.com> wrote in 
news:53dt25dhaiqr8nfundiv6l3tjg4kmte8p9@4ax.com:

> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>>Vit <FiNaR76@gmail.com> wrote in news:c735cb19-fe19-4379-8598-
> [...]
>>> in the cgi-bin directori the "my_email.cgi" file:
>>> #!/usr/bin/perl
>>> print "Content-type: text/html\n\n";
>>> print "Hello, world!\n";
>>
>>The content you send and the content type you specify conflict:
> 
> Sorry for asking stupid and even off-topic, but: while true that
> shouldn't cause a server error, should it?

Of course, it shouldn't. But I believe I had just pointed out what 
thought was the real problem (which you snipped), so I am reproducing 
that section below:

> Vit <FiNaR76@gmail.com> wrote in news:c735cb19-fe19-4379-8598-
> 64c31cb5a6fa@j20g2000vbp.googlegroups.com:
> 
>> in the webpage:
>> <form action="\cgi-bin\my_email.cgi" method="post"> 
> 
> <form action="/cgi-bin/my_email.cgi" method="post">

After pointing that out, I pointed out another error (not one that 
should cause a 500, but an error all the same) and provided a complete 
CGI script that should not cause any errors.

HTH,

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 10 Jun 2009 08:48:39 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: perl and CGI
Message-Id: <99lv2556c54vecp22cr0cknslpp6ssj3de@4ax.com>

"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>Jürgen Exner <jurgenex@hotmail.com> wrote in 
>news:53dt25dhaiqr8nfundiv6l3tjg4kmte8p9@4ax.com:
>
>> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>>>Vit <FiNaR76@gmail.com> wrote in news:c735cb19-fe19-4379-8598-
>> [...]
>>>> in the cgi-bin directori the "my_email.cgi" file:
>>>> #!/usr/bin/perl
>>>> print "Content-type: text/html\n\n";
>>>> print "Hello, world!\n";
>>>
>>>The content you send and the content type you specify conflict:
>> 
>> Sorry for asking stupid and even off-topic, but: while true that
>> shouldn't cause a server error, should it?
>
>Of course, it shouldn't. But I believe I had just pointed out what 
>thought was the real problem (which you snipped), so I am reproducing 
>that section below:
[...]
>After pointing that out, I pointed out another error (not one that 
>should cause a 500, but an error all the same) and provided a complete 
>CGI script that should not cause any errors.

My appologies, at no time did I mean to imply that you didn't address
the original problem. I was merely wondering about that side issue and
therefore shortened my follow-up to that part which was relevant to that
side issue.

jue


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

Date: Wed, 10 Jun 2009 16:44:41 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: perl and CGI
Message-Id: <Xns9C2681A80FA58asu1cornelledu@127.0.0.1>

Jürgen Exner <jurgenex@hotmail.com> wrote in
news:99lv2556c54vecp22cr0cknslpp6ssj3de@4ax.com: 

> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>>Jürgen Exner <jurgenex@hotmail.com> wrote in 
>>news:53dt25dhaiqr8nfundiv6l3tjg4kmte8p9@4ax.com:
>>
>>> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>>>>Vit <FiNaR76@gmail.com> wrote in news:c735cb19-fe19-4379-8598-
>>> [...]
>>>>> in the cgi-bin directori the "my_email.cgi" file:
>>>>> #!/usr/bin/perl
>>>>> print "Content-type: text/html\n\n";
>>>>> print "Hello, world!\n";
>>>>
>>>>The content you send and the content type you specify conflict:
>>> 
>>> Sorry for asking stupid and even off-topic, but: while true that
>>> shouldn't cause a server error, should it?
>>
>>Of course, it shouldn't. But I believe I had just pointed out what 
>>thought was the real problem (which you snipped), so I am reproducing 
>>that section below:
> [...]
>>After pointing that out, I pointed out another error (not one that 
>>should cause a 500, but an error all the same) and provided a complete
>>CGI script that should not cause any errors.
> 
> My appologies, at no time did I mean to imply that you didn't address
> the original problem. I was merely wondering about that side issue and
> therefore shortened my follow-up to that part which was relevant to
> that side issue.

No need to apologize. I was just trying to keep my response short and to 
the point. Looking at it again, it may appear as if I was annoyed but I 
wasn't.

Besides, it turns out the OP's issue was permissions on the script, so I 
was wrong on that account as well. ;-)

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 2469
***************************************


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