[15991] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3403 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 17 14:15:42 2000

Date: Sat, 17 Jun 2000 11:15:17 -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: <961265717-v9-i3403@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 17 Jun 2000     Volume: 9 Number: 3403

Today's topics:
    Re: Very Strange Behaviour <abe@ztreet.demon.nl>
    Re: Very Strange Behaviour <bgregory3@cs.com>
    Re: Very Strange Behaviour <rootbeer@redcat.com>
    Re: Where are the error logs? (David Wall)
    Re: where libHTML documentation? <rootbeer@redcat.com>
    Re: Yet Another Abigail Admirer (WAS Re: Crazy enough t (Clinton A. Pierce)
    Re: Yet Another Abigail Admirer (WAS Re: Crazy enough t (Abigail)
    Re: Yet Another Abigail Admirer (WAS Re: Crazy enough t (Abigail)
    Re: Yet Another Abigail Admirer (WAS Re: Crazy enough t <mike@crusaders.no>
    Re: Yet Another Abigail Admirer (WAS Re: Crazy enough t (Clinton A. Pierce)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 17 Jun 2000 18:05:37 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Very Strange Behaviour
Message-Id: <6n7nks0p9b47uje3s97l81v32ur0spigbo@4ax.com>

[please do not put your answer _before_ the question]

On Sat, 17 Jun 2000 06:30:00 -0400, "Ryan & Treena Carrier"
<ryanc@nci1.net> wrote:

[snip of Apache configuration instructions, which are in its docs
anyway]

> 
> I know some out there will say this is not PERL related. It is.

I don't know about PERL, but this webserver-config stuff has got nothing
to do Perl nor perl :-) It's a webserver thing.

The only perl-related bit that is associated with Apache for Win32 is
that you make sure the shebang-line (#!) contains the correct path to
perl.exe, but you forgot to mention it.

Oh well...

-- 
Good luck,
Abe


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

Date: Sat, 17 Jun 2000 19:09:40 +0200
From: "Bob Gregory" <bgregory3@cs.com>
Subject: Re: Very Strange Behaviour
Message-Id: <394bb046$1@news.piro.net>

first off, I agree, this is perl related, because if you can't get it
installed properly
you can use it and learn it.

Is this the same problem I am having?  I checked that I had the settings in
httpd.conf
but still can only get output to a dos window and not to the browser.

Here is what I have done so far:
I downloaded ActivePerl v522 from ActiveState.com and Apache
Web Server v 1.3.9 for windows (98) and started learning Perl.  I am having
problems with the installation, because I can write a script, execute it in
a dos window (eg something simple like print a message 10 times), but I want
to have a form written in html which executes a perl program which takes the
fields in the form as input (e.g. ordering a product xyz,and returns the
data formatted (e.g. thank you for ordering xyz).  the perl program sends
the reply to the dos window instead of to the Win IE browser.  I am assuming
that when the Apache Web server software is running that it picks up the
output from the Perl programm.

What can I do to locate the error or at least home in on it?

Ryan & Treena Carrier <ryanc@nci1.net> wrote in message
news:394b51e8_2@news.cybertours.com...
> I had the same problem - I needed to test my PERL scripts before
publishing
> them. I tried Microsoft Personal Web Server, but my Norton Anti-Virus
would
> hang up. I ended up using Apache. The biggest problem I had was setting up
> httpd.conf correctly. You must ensure that:
> 1. ServerName 127.0.0.1
> 2. ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/"
> 3. <Directory "C:/Apache/cgi-bin">
>     AllowOverride None
>     Options ExecCGI
> </Directory>
> 4. AddHandler cgi-script .pl
>
> Just look through httpd.conf in the conf folder under Apache. Read through
> it, and if you get stuck, send me an e-mail
>
> I know some out there will say this is not PERL related. It is.
>
> Jacobyte <jacobyte@goattee.co.uk> wrote in message
> news:8iegpf$mq2$1@plutonium.btinternet.com...
> > I am running a few web sites out there each with their own cgi-bins on
> unix
> > servers - all scripts work fine and well.
> > I am also running 3 personal web servers one on Win98 , one Linux
Mandrake
> > and one on Corel Linux for the sole purpose of customizing my existing
> > scripts on the remote servers. On win98 only %40 work, everything is set
> up
> > ok though while on the linux servers with Apache installed I cannot get
> any
> > to work through the browser - just get the 500 error - most of the
scripts
> > will execute through bash ok though.
> >
> > I know this is a long shot but I desperatley need an offline cgi
> development
> > environment. and am absolutley stuck as to why things are not working
esp
> in
> > Linux even though they run on the remote servers. I have check all the
> usual
> > basepaths, permissions etc and everything is ok
> >
> > If you have any ideas on this then feel free to throw them at me I will
be
> > eternaly grateful !
> >
> > cheers
> >
> >
>
>




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

Date: Sat, 17 Jun 2000 11:00:00 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Very Strange Behaviour
Message-Id: <Pine.GSO.4.10.10006171056240.21108-100000@user2.teleport.com>

On Sat, 17 Jun 2000, Bob Gregory wrote:

> first off, I agree, this is perl related, because if you can't get it
> installed properly you can use it and learn it.

That's like saying that questions about the Grand Canyon belong in a
newsgroup about automobiles, because if you can't get to the Grand Canyon
you can't see it and enjoy it. 

We're all better off if discussions stay in appropriate newsgroups.

Since the experts on web servers are more likely to be found in a
newsgroup about web servers, this discussion will be more successful in
such a newsgroup.

I've set follow-ups to c.l.p.moderated, in case there's any Perl-related
followups. Cheers!

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



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

Date: 17 Jun 2000 11:49:07 -0400
From: darkon@one.net (David Wall)
Subject: Re: Where are the error logs?
Message-Id: <8F567FE09darkononenet@206.112.192.118>

funny@aol.com (Johnny) wrote in
<wDf25.68336$nl3.245040@typhoon.ne.mediaone.net>: 

>Hi,
>
>I'm using Perl on an NT IIS server and can't seem to find the error logs
>that I was hoping would help me debug my perl scripts. 
>
>Any ideas where they are?

IIRC, they're in \Perl\bin\PerlIS-Err.log.  My setup may be atypical, but I 
don't recall altering the defaults, and I do recall looking for it myself.

-- 
David Wall
darkon@one.net


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

Date: Sat, 17 Jun 2000 09:24:42 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: where libHTML documentation?
Message-Id: <Pine.GSO.4.10.10006170922390.21108-100000@user2.teleport.com>

On Sat, 17 Jun 2000 drdubosc@my-deja.com wrote:

> Where do I find documentation or help for HTML:: functions? AsSubs, for
> example? 

Does this answer your question?

    http://search.cpan.org/search?mode=doc&query=AsSubs

> Although I've installed libHTML,

What's libHTML? 

Cheers!

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



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

Date: Sat, 17 Jun 2000 15:42:10 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Yet Another Abigail Admirer (WAS Re: Crazy enough that it might just work...) :)
Message-Id: <m%M25.2918$fR2.37677@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <slrn8kmngd.44i.tjla@thislove.dyndns.org>,
	tjla@guvfybir.qlaqaf.bet (Gwyn Judd) writes:
> I was shocked! How could Abigail <abigail@delanet.com>
> say such a terrible thing:
>>Abigail
>>-- 
>>perl -Mstrict -we '$_ = "goto E.print chop;\n=rekcaH lreP rehtona tsuJ";E1:eval'
> 
> I have looked at this and looked at this and I just cannot see how it
> works. Could someone please provide an explanation?

Sure, watch closely...

strict is here for show (showoff, Abigail!), as are warnings.  
-e says "evaluate this:".  Now the rest of it, ignore the newlines for the moment,
they're for clarity.

$_="
goto E.print chop;
\n=rekcaH lreP rehtona tsuJ";
E1:eval

So $_ is a set to "goto E.print chop;\n=rekcaH lreP rehtona tsuJ"
E1 is just a label, and is ignored for now.
eval (without an argument) will evaluate $_.

Now here's the tricky part:

	Ignore the "goto E" part until we can get the return value
		from print...which needs to run chop first..

	chop takes that string $_ and removes the last character and you
		get "J".
	print prints the "J"
	the return value from print is 1 (normally)
	So we goto E1 (out of the eval block, back in the main code...)

	E1 now runs the eval again, with $_ set to 
		goto E.print chop;\n=rekcaH lreP rehtona tsu
		(the J is mising)

This continues until...	until what?

As it turns out "\n=junk" will evaluate just fine.  Don't ask me why, but 
you can prove it to yourself with:

	#!/usr/bin/perl 
	$foo="\n=junk";
	eval $foo;
	print $@;

("Perl is an empirical art.  Don't ask us if something works"--purl on #perl)
And $@ (the error return from eval) will be empty, i.e. it worked.

However, "\n=" will NOT parse correctly.  So eventually our "eval" 
string eventually gets down to:

	goto E.print chop;\n=

And the eval at the end fails.  And since no "goto" was executed this
time, we don't try it again.


And that's how it works!  Who says Perl is a write-only language?  :)	I
should use Abigail's JAPH's for interviewing recruits that claim to know
Perl on an expert level... 

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: 17 Jun 2000 12:08:21 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Yet Another Abigail Admirer (WAS Re: Crazy enough that it might just work...) :)
Message-Id: <slrn8kn9ls.mlf.abigail@alexandra.delanet.com>

Gwyn Judd (tjla@guvfybir.qlaqaf.bet) wrote on MMCDLXXXII September
MCMXCIII in <URL:news:slrn8kmngd.44i.tjla@thislove.dyndns.org>:
`` I was shocked! How could Abigail <abigail@delanet.com>
`` say such a terrible thing:
`` >Abigail
`` >-- 
`` >perl -Mstrict -we '$_ = "goto E.print chop;\n=rekcaH lreP rehtona tsuJ";E1:eval'
`` 
`` I have looked at this and looked at this and I just cannot see how it
`` works. Could someone please provide an explanation?


Come to YAPC and join my talk about JAPHs.


Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: 17 Jun 2000 12:21:54 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Yet Another Abigail Admirer (WAS Re: Crazy enough that it might just work...) :)
Message-Id: <slrn8knaf9.mlf.abigail@alexandra.delanet.com>

Clinton A. Pierce (clintp@geeksalad.org) wrote on MMCDLXXXII September
MCMXCIII in <URL:news:m%M25.2918$fR2.37677@news1.rdc1.mi.home.com>:
--
-- As it turns out "\n=junk" will evaluate just fine.  Don't ask me why,


Hint: it's a one-liner JAPH that uses POD.



Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: Sat, 17 Jun 2000 18:20:41 +0200
From: "Trond Michelsen" <mike@crusaders.no>
Subject: Re: Yet Another Abigail Admirer (WAS Re: Crazy enough that it might just work...) :)
Message-Id: <yAN25.2869$eI.56062@news1.online.no>


Gwyn Judd <tjla@guvfybir.qlaqaf.bet> skrev i
meldingsnyheter:slrn8kmngd.44i.tjla@thislove.dyndns.org...
> >perl -Mstrict -we '$_ = "goto E.print chop;\n=rekcaH lreP rehtona
tsuJ";E1:eval'
> I have looked at this and looked at this and I just cannot see how it
> works. Could someone please provide an explanation?

Well, I could always try :-)

I think this looks like a very nice and fancy variation of

perl -e '$_ = "rekcaH lreP rehtona tsuJ";print chop while $_;'

anyway.
first of all. Since $_ contains the real program that will be repeatedly
eval'ed Let's write $_ a little bit less tightly.


goto 'E' . print(chop $_);
=rekcaH lreP rehtona tsuJ

strict and -w doesn't complain about the second line because the = tells it
that the line is for POD

So - chop cuts the last letter from $_ and returns it to print that prints
it. print returns 1 which is appended to E, so we're left with.
   goto E1;

and of course, at E1 there is only eval which evals $_ and so we just start
over again.

It took me a little bit of head-scratching to find out why it stops after
printing "Just another Perl Hacker", but then it occured to me. After
chopping and printing for a while, $_ is reduced to

goto 'E' . print(chop $_);
=

which won't compile, so the program just continues. Since eval was the last
part of the program we're finished.

--
Trond Michelsen
(hope I didn't miss anything :)




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

Date: Sat, 17 Jun 2000 17:24:23 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Yet Another Abigail Admirer (WAS Re: Crazy enough that it might just work...) :)
Message-Id: <bvO25.2940$fR2.38489@news1.rdc1.mi.home.com>

In article <slrn8knaf9.mlf.abigail@alexandra.delanet.com>,
	abigail@delanet.com (Abigail) writes:
> Clinton A. Pierce (clintp@geeksalad.org) wrote on MMCDLXXXII September
> MCMXCIII in <URL:news:m%M25.2918$fR2.37677@news1.rdc1.mi.home.com>:
> --
> -- As it turns out "\n=junk" will evaluate just fine.  Don't ask me why,
> 
> Hint: it's a one-liner JAPH that uses POD.
> 

POD.  I need to stay out of the sunshine so early in the day.


-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

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


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