[12050] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5650 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 13 05:07:21 1999

Date: Thu, 13 May 99 02:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 13 May 1999     Volume: 8 Number: 5650

Today's topics:
        Bay Area - Install on WinNT - fast $$ <carl@slothware.net>
    Re: cgi submitting a form to another server (Ronald J Kimball)
    Re: cgi submitting a form to another server (Ronald J Kimball)
    Re: CGI timeout in web-based listserv jim_bennett@my-dejanews.com
    Re: CPAN-POD & pulling my hair OUT! HELP! do the doc's  <ebohlman@netcom.com>
    Re: FAQ 9.10: How do I redirect to another page? <ebohlman@netcom.com>
    Re: FAQ 9.10: How do I redirect to another page? (Charles R. Thompson)
    Re: HASH AND ARRAY (Bart Lateur)
        Help! JavaScript newbie finds he needs Perl! (me)
        How can i write perl script and ouput the base director (Austin Ming)
    Re: How do I make a sytem() exit on control-C (Ilya Zakharevich)
    Re: How to get current working directory? <mecks@ust.hk>
    Re: HTML POST to Perl script problem <supton@soonet.ca>
    Re: japh tags (Andrew Johnson)
    Re: Lists and Arrays (Tad McClellan)
    Re: Lists and Arrays (Ronald J Kimball)
    Re: Matching & substituting escaped characters in a reg (jon ewing)
    Re: Newbie needs help <ebohlman@netcom.com>
    Re: Newbie question on CGI developing (Charles R. Thompson)
    Re: password checking (Ronald J Kimball)
        Perl cgi on a standalone PC? <dvoon@my-dejanews.com>
        perl debugger acting bizarre (debugger bug?) <ejohnso9@earthlink.net>
        Perl Programmer tigerstr@postoffice2.bellatlantic.net
        Setting Environment Variables <hrdbdy@sprynet.com>
    Re: Setting Environment Variables <swarren@www.wwwdotorg.org>
    Re: translating FAT to VFAT <swarren@www.wwwdotorg.org>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 13 May 1999 03:50:23 GMT
From: "carl lippitt" <carl@slothware.net>
Subject: Bay Area - Install on WinNT - fast $$
Message-Id: <3_r_2.733$Hy.1615@news.flash.net>

Help,

Looking for someone to install perl and various modules on our NT server.

Running > Microsoft Windows/NT 4.0 with SP4, IIS 4.0 on Intel Platform.

Need perl 5 with CGI, and NET modules.

Need installation by 5/14, close of business.

Located in San Mateo.

Call Chirag Patel
Corsoft Inc
800-326-7763 x107
cpatel@corsoft.net






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

Date: Thu, 13 May 1999 00:49:45 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: cgi submitting a form to another server
Message-Id: <1drprxt.irmyb11lae5a8N@p0.tc19a.metro.ma.tiac.com>

Charles R. Thompson <design@raincloud-studios.com> wrote:

> If your password is that simple, then heck ya, somebody may 
> guess it. Change it often. Here's a few recommendations...
> 
> X8gh54REwQ
> 8UIwe32ccV
> JH9LLoeXCz

Dangit, now I have to change *my* password!  :P

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 13 May 1999 00:49:46 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: cgi submitting a form to another server
Message-Id: <1drpryj.ckt6918qs2iyN@p0.tc19a.metro.ma.tiac.com>

<michael_555@my-dejanews.com> wrote:

> Is there a way I can put a button on my .html page
> that executes a .cgi script that in turn submits
> the form data to the other server? Can I make it
> so the .cgi script is not directly accessible to
> surfers (or this was all pointless...)?

Yes.  You can use the LWP modules to have your script connect to the
remote server and submit the form data directly, rather than passing the
form data out to the browser and having the surfer submit it.

http://www.perl.com/CPAN/

(I think Mr. Thompson misunderstood your question.)

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        perl -le 'print "Just another \u$^X hacker"'


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

Date: Thu, 13 May 1999 03:36:47 GMT
From: jim_bennett@my-dejanews.com
Subject: Re: CGI timeout in web-based listserv
Message-Id: <7hdhcf$enk$1@nnrp1.deja.com>

In article <3739D171.7B4A@atanytimeonthe.net>,
  same-as-above wrote:
> I can't beleive how many people don't understand this problem. I am
> having the same problem.
>
> Make a script something like this:
>
> #!/usr/local/bin/perl
>
> print "Content-Type: text/plain\n\n";
>
> ## how many times to loop, in this case 5 minutes
>
> $howmanytodo = 10;
>
> while (1) {
> 	print "haha this is a print\n";
> 	sleep 30; ## 30 seconds
> 	open(LOG,">>test-log-sleep.txt");
> 	print LOG "Loop Count= $howmanytodo\n";
> 	close(LOG);
> 	if ($howmanytodo-- < 1) {exit;}
> 	}
>
> You can start it by accessing it from your browser, then you can even
> press "stop" on the browser, and check with your FTP access if the log
> file is still being updated. On my server sometimes it keeps going for
3
> or 4 more times then quits, I assume there's some kind of time out
> somewhere on the server side or some socket timeout.
>
> I want to simply put a script "out there somewhere" (sort of like a
> "fork" call) on the server, and have it run till it's done, write to a
> log file or something. I come back in two days and see how it's doing.
> (all done from a browser, remote web server, standard ftp - to web
> server set up) ANY CLUES?
>
To prevent the web server from killing your process, try something like
this:

# print out your final message to the browser
close STDOUT;
if ($pid = fork)
{
   exit(0);
}

# continue with asynchronous processing


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Thu, 13 May 1999 03:28:59 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: CPAN-POD & pulling my hair OUT! HELP! do the doc's really suck this bad?
Message-Id: <ebohlmanFBnJ0C.Fvn@netcom.com>

N <nospam@atanytimeonthe.net> wrote:
: Eric Bohlman wrote:
: > Are you sure you're reading all the documentation for those modules?

: I really don't want to go to each module's ".tar.gz" file and extract
: the docs, that's a real big waste of time and doesn't allow for
: searching within docs very well.

Ah, your problem is with the lack of "pre-installation" documentation for 
modules.  I sort of see your point: I'm *not* sitting on a fat pipe to 
any CPAN site, and I *would* like the ability to quickly browse the 
documentation for various modules I haven't installed.  Some months back 
there was discussion here about ways to enable this, but IIRC it quickly 
degenerated into acrimony.  One thing that did come out of the discussion 
was that it would definitely involve a non-trivial amount of work.



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

Date: Thu, 13 May 1999 08:21:20 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: FAQ 9.10: How do I redirect to another page?
Message-Id: <ebohlmanFBnwJK.FI7@netcom.com>

David Cassell <cassell@mail.cor.epa.gov> wrote:
: Well, I'll go out on a limb [since I'm back from vacation and feeling
: refreshed] and say that many CGI programming questions are on-topic
: for this ng.  When someone has Perl code with which they need help,
: it shouldn't matter whether the code is for a website or RPC or
: matrix singular-value decompositions.  My only personal exception

Questions dealing with that last one belong in
soc.subculture.bondage-bdsm, not here (yeah, I know about a year ago
someone actually posted a question about doing SVD in pure Perl code). 



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

Date: Thu, 13 May 1999 08:57:10 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: FAQ 9.10: How do I redirect to another page?
Message-Id: <MPG.11a45d03f9577ea39896bb@news>

[ Congratulations, David Cassell you could be a winner! Return to 
comp.lang.perl.misc to claim your prize. ]

In article <373A11BD.5C34F354@mail.cor.epa.gov>, David Cassell says...

> But the gray area between Perl code for webwork and web programming
> which has nothing to do with Perl is sometimes remarkably hard for 
> the newbie to see.  Granted, the posters here have been just as hard
> on people asking off-topic questions about other issues - which is
> only fair.  Still, I like that we now have kindly people like
> Charles Thompson [to name but one of several now with us], who are 
> willing to give out the help web wannabe's so desperately need.

Err... don't blame me! I plonk a few too. I just kinda make judgement 
calls and sometimes they aren't very smart ones as the FP's will plonk me 
to illustrate. :)

I've started to see a line here and there in the NG and have started 
saving all my snippetts of code, etc. as I go along. In the next month 
or so I'm planning a little 101 site on Perl for the Web illustrating 
basic concepts and whatnot that might help things a bit.

Hashes, using basic packages for virtual servers, etc. Sorta standard but 
better than "Hello Crummy World" stuff. As I learn and gather, I'll post 
more pages. It's the least I can do for all the help (and tolerance) I've 
received. 

Like I said, I'm still learning so it'll probably be more like a 99 
site.. maybe 98. (32 if you ask some!) 

Hey!??! You wanna point to someone! Point to Eric! He removed the version 
limitations for Text::Query::Advanced last night (at 4:30 am my time) ! 
Woo Hoo! Finally! A 'correct' interface for Boolean Website search 
scripts. Eric is my Hero today. 

-- 
Charles R. Thompson
RainCloud Studios


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

Date: Thu, 13 May 1999 08:35:54 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: HASH AND ARRAY
Message-Id: <373b8e37.2464869@news.skynet.be>

Stephen Warren wrote:

>I can't just do:
>
>@$elem{ @keys } = @$instructionTypeInfo{ @keys } ;
>
>since that'd over-ride the data that's already there...

I hads another thought first, but I couldn't put it into understandable
Perl code. Now I think I can.

Make a temporary copy of the source hash, so you don't overwrite the
original. Overwrite the values with your original destination hash, so
you keep ALL it's old values. Now you have a merged version of the
destination hash, so copy it back.

    my %hash = %$instructionTypeInfo;
    @hash{keys %$elem} = values %$elem; # Larry R. would be so proud...
    %$elem = %hash;


Maybe you can do a faster final hash "copying" by keeping a reference to
the temporary %hash instead of copying all the contents. I'm not really
sure if

    $elem = \%hash;

would be enough Does this change that value in it's original location?

	Bart.


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

Date: 12 May 1999 22:58:17 -0500
From: me@me.com (me)
Subject: Help! JavaScript newbie finds he needs Perl!
Message-Id: <me-1205992058370001@user117.usr3.accesscom.com>
Keywords: JavaScript, Perl, newbie, help

Folks,

Just a few asides to begin:

I know no Perl.

I just started learning JavaScript.

I have a site on which I review movies. Hoping to make it more interactive
and to build my web skills, I decided to learn JavaScript. My hope was to
take the text files that contain my hundreds of movie reviews and rather
than build an HTML page for each, simply have JavaScript automatically
generate fully-formatted subwindows containing the review. Since I also
send out the text of the reviews in simple text-only format, this seemed
to be a great way to cut down on edits and updates - I would only need to
edit things once.

My HTML guts consist of a pop-up menu form with the movie title linked to
a number. That number is passed to JavaScript which munges it in a
function that links to three arrayed variables: the movie title, my grade
for the movie, and the actual review text file. The function also creates
a subwindow that contains the self-generated HTML comprising the full
review.

Well, you probably can already tell the problem already - JavaScript has
no way to assign the contents of an external text file to a variable. I
didn't know that when I started. Someone told me that Perl could read the
contents of the text files and assign that to a variable very easily. But
not knowing Perl and barely knowing JavaScript is proving to be maddening.

My questions:

   1) Is it possible to call a perl script from within a JavaScript? If
so, what is the syntax for doing this?

   2) How can I pass a JavaScript variable (in this case the review text
variable containing the path to the review text file based upon the number
retrieved from the form option) to a perl script? How would I retrieve the
perl script's results and assign it back to a JavaScript variable?

   3) How would I go about putting the perl script on my ISP's UNIX server
so that it could be called by the JavaScript?

   4) Is there any place I could go to find a perl script that would do
this and would require almost no modification (since I wouldn't be
confident in what I was editing)?


I can't give much, but I can include the name of anyone who replies with
useful help in the comments of the finished script.

Thanks! Trying to learn one scripting language only to find you need to
learn another at the same time is hard on the old noggin.

Dan Edelen
edelen@REMOVE-THIS.accesscom.com
(Kill the "REMOVE-THIS." to reply via e-mail)


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

Date: 13 May 1999 08:09:52 GMT
From: austin95002887@yahoo.com (Austin Ming)
Subject: How can i write perl script and ouput the base directory name to my browser?
Message-Id: <7he1cg$chn$2@justice.csc.cuhk.edu.hk>


How can i write perl script and ouput the base directory name to my browser?
Because, my cgi web hosting account do not allow me to use Telnet, but only 
FTP.
So, i can not run the "pwd" command to find out my base directory.



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

Date: 13 May 1999 04:07:08 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How do I make a sytem() exit on control-C
Message-Id: <7hdj5c$ni2$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Alastair
<alastair@calliope.demon.co.uk>],
who wrote in article <slrn7jk903.5f.alastair@calliope.demon.co.uk>:
> Merrill Lynch <anybody@ml.com> wrote:
> >Hi 
> >
> >Does anyone have a solution on how to make a system() exit on control-C?
> >
> >I am on using perl5.00503 activestate perl for NT4 service pack 3.
> 
> You need to take a look at methods of catching signals basically - CTRL-C is
> just a SIGINT. See ;
> 
> perldoc perlipc

I would be very surprised if Perl would process SIGINT while running
system().  But since I cannot make it what the original poster wants,
thus apparently (s)he does not care for an answer, this does not
matter much.

A basic question is: what should happen on Control-C.  There is Perl,
and there is a tree of processes started by system().  How many
processes should die on each Control-C?

The current behaviour on UNIX is that if all the processes are in fact
Perls, then each Control-C will kill all the leaves of the tree
(supposing no process group changes are performed, and my
understanding is not that rusty).  The current behaviour on OS/2 is
that each Control-C will kill the latest started leaf (no matter
whether the processes are Perls or not).  I have no idea what happens
on Win32, and what the poster wants.

Ilya


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

Date: Thu, 13 May 1999 11:48:53 +0800
From: Chim Kin Sang <mecks@ust.hk>
Subject: Re: How to get current working directory?
Message-Id: <373A4BA5.8DEA8B50@ust.hk>

Kevin A. Collins wrote:

> Hi there,
>
> I was just wondering if there is a standard way to get the path of the
> current working directory. I've looked through a lot of the Perl
> documentation, but haven't found an easy solution. I'm using Perl for
> Win32 right now and there is a Win32::GetCwd() function, but I just
> thought there might be a more portable solution.
>
> Thanks in advance!
>
> Kevin

  Actually, I also engage into the same situation. I am using IRIX 6.5.
The way that I fix it is to use the argument input in the command line.
For example.
 csh:   some.perl_script  current_directory

and in the some.perl_script,

#!/bin/perl
 $DIR=@ARGV[0];
  print "$DIR \n";

#############################
Can anyone suggest a more convienient way to define the current
directory?

Thanks

Jim






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

Date: Wed, 12 May 1999 23:24:49 -0400
From: "Hiccup" <supton@soonet.ca>
Subject: Re: HTML POST to Perl script problem
Message-Id: <926566138.339.6@news.remarQ.com>

try putting post as "post" instead...I've encountered this same problem and
putting the action and method both in double quotes seemed to solve it...

The Beer Chugger.

Kent Johnson <johnson-kl@sed.redstone.army.mil> wrote in message
news:37346863.5DA147B7@sed.redstone.army.mil...
>I've inherited a website with several Perl scripts and I'm not a Perl
>programmer.  One html page calls a perl script using:
>
><form action="http://www.mysite.com/cgi_stuff/script.pl" method=post>
>
>and I get the following error:
>
>METHOD NOT ALLOWED
>
>It is accessing the script in question.  It's on a UNIX-based server.
>I've played with permissions but it hasn't helped.  Any ideas from you
>Perl gurus?
>
>Thanks,
>
>Kent Johnson
>Huntsville, AL
>




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

Date: Thu, 13 May 1999 08:31:28 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: japh tags
Message-Id: <A5w_2.3000$L4.180728@news2.rdc1.on.home.com>

In article <7hdbr3$b2u$1@nnrp1.deja.com>,
 todd_b_smith@my-dejanews.com <todd_b_smith@my-dejanews.com> wrote:
! Let's get a thread going with people's tag lines that print "Just
! Another Perl Hacker." I've seen lots, but now I want to see them all!

But sometimes I'm just another perl FAQ'r ... 

#!/usr/bin/perl -wl
$_="faufakfacfadfas"; # some arbitrary string.
$not=q=q+q-q-+=;      # q + q - q-+= equals one q right?
s$d|u|c|k|s\$$\$not$geese; # seems fowl.
s+.ay?.\++print uc $&+e;   #<ducking>...(sic)

later
andrew


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

Date: Wed, 12 May 1999 20:02:40 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Lists and Arrays
Message-Id: <0r4dh7.lrh.ln@magna.metronet.com>

Erik Arneson (erik@mind.net) wrote:

: A friend and I, both avid Perl coders, are in a bit of a disagreement.
: One of us is continually referring to arrays as lists, 


  One of you is not being technically precise then, which is 
  a Bad Thing when discussing technical subjects...


: and it is
: confusing the other.  

   ... See?   :-)



   ARRAYs are not LISTs.

   perl DWIMs them into lists though, which causes the confusion.


: My question is, what is the difference between
: arrays and lists?  


   Arrays have "addressable" (via @variable or references) memory. 

   Lists don't (they live only on the stack or somewhere not 
   directly accessable. Hope I'm not blowing smoke here...).


: Is there a difference?  


   Yes.

   As illustrated be some excerpts from your friendly neighborhood
   perlfunc.pod:

=item Functions for real @ARRAYs
=item Functions for list data

   And this one, which uses both, implying that there must
   be some difference: 

=item push ARRAY,LIST


: Why call an array an array,
: and not a list?


   Because it is a different (though similar) thing.


: We're looking for information which will end our disagreement, and
: hopefully help us learn more about these sorts of things.


   Hmmm. Maybe I'm going to learn something here too.

   In grepping around to find info on the distinction, I found this
   in perlfaq4.pod:

-------------------------
=head2 How can I tell whether a list or array contains a certain element?

Hearing the word "in" is an I<in>dication that you probably should have
used a hash, not a list or array, to store your data.  Hashes are
-------------------------

   How do you "store data" in a list?

   Is the FAQ incorrect here, or am I incorrect above?

   (or does "store" not imply that it can then be "retrieved" ? )

   Is there someway to retrieve (address) data stored in a list?

   (other than subscripting it:    $year = 1900 + (localtime)[5];)

   So, ahhh, I guess list data _is_ "addressable" then...



   Uhhh, and here is yet another one. 

   Now _I'm_ getting confused too.

   perlfunc.pod this time:

-------------------------
=item split

Splits a string into an array of strings, and returns it.  By default,
empty leading fields are preserved, and empty trailing ones are deleted.
-------------------------


   Doesn't it split into a LIST rather than an ARRAY?

   (the description for stat(), for instance, _does_ say that
    it returns a list. localtime() says array...
   )

   Are these bugs in the docs?



   It appears to me that the distinction is not rigourously 
   maintained in the standard Perl docs, which seems a
   Bad Thing...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 13 May 1999 00:49:47 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Lists and Arrays
Message-Id: <1drptda.1h1k7a01f2kvwqN@p0.tc19a.metro.ma.tiac.com>

Erik Arneson <erik@mind.net> wrote:

> A friend and I, both avid Perl coders, are in a bit of a disagreement.
> One of us is continually referring to arrays as lists, and it is
> confusing the other.  My question is, what is the difference between
> arrays and lists?  Is there a difference?  Why call an array an array,
> and not a list?

Whichever of you is referring to arrays as lists is incorrect.

Array:  @foo

List:   (1, 2, 3, 4)



Some differences:


You can use splice() on an array.  You can't use splice() on a list.


You can assign to an array slice: @array[1,2] = ('a', 'b');

You can't assign to a list slice: ($x, $y, $z)[1,2] = ('a', 'b');
That gives you a compilation error.


scalar(@array) returns the number of elements in @array.

scalar(1, 2, 3, 4) returns the last element in the "list".
[But there's never an actual list in this case - the expressions are
evaluated one at a time, and only the result of the last one is kept.]

-- 
chipmunk (Ronald J Kimball) <rjk@linguist.dartmouth.edu>
perl -e 'print map chop, sort split shift, reverse shift
' 'j_' 'e._jP;_jr/_je=_jk{_jn*_j &_j :_j @_jr}_ja)_js$_j
~_jh]_jt,_jo+_jJ"_jr>_ju#_jt%_jl?_ja^_jc`_jh-_je|' -rjk-


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

Date: 13 May 1999 03:47:07 -0500
From: jon@webdev.co.uk (jon ewing)
Subject: Re: Matching & substituting escaped characters in a regexp.
Message-Id: <373b9082.61996739@news1.newscene.com>

On Thu, 13 May 1999 00:49:48 -0400, rjk@linguist.dartmouth.edu (Ronald
J Kimball) wrote:

>Larry Rosler <lr@hpl.hp.com> wrote:
>
>> And extraordinarily ugly.  :-)
>> 
>>     s/\\(\d+)/&#${\(oct $1)};/g;
>> 
>> or, for the faint at heart,
>> 
>>     s/\\(\d+)/'&#' . oct $1 . ';'/eg;
>
>Neither of those work for the original poster's case, in which
>"the escaped character doesn't register as 4 distinct characters".
>His input contains the actual characters, not their escaped octal
>representations.
>
>So, to match the literal characters:
>
>s/([\x80-\xFF])/'&#' . ord $1 . ';'/eg;

Perfect - thanks!

 ...or nearly perfect; for some reason I had to double quote the ";" at
the end of the regexp for it to appear.

thanks again, jon.





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

Date: Thu, 13 May 1999 04:03:32 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Newbie needs help
Message-Id: <ebohlmanFBnKLw.Iv2@netcom.com>

Larry Rosler <lr@hpl.hp.com> wrote:
: You forgot to include $! in the error message.  And if you don't have 
: access to the server logs (many of us don't, believe it or not!), send 
: the message to the browser via STDOUT, not to God-knows-where via 
: STDERR.

:    open FILE, $file or do { print "Content-type: text/plain\n\n",
:          "Can't open '$file'. $!\n"; exit }

Hardly necessary if you

use CGI::Carp qw(fatalsToBrowser);



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

Date: Thu, 13 May 1999 08:57:10 GMT
From: design@raincloud-studios.com (Charles R. Thompson)
Subject: Re: Newbie question on CGI developing
Message-Id: <MPG.11a45f2ed5818dd59896bc@news>

[ Congratulations, Arjun Ray you could be a winner! Return to 
comp.lang.perl.misc to claim your prize. ]

In article <37be688d.2263317578@news1.newscene.com>, Arjun Ray says...
> While scripting substitutions in Perl like this certainly seems to get
> the job done, I've always wondered why people would go for "solutions"
> like this. One of the problems that concerns me is precisely the 'tag
> system' needed to make this work: everyone manages to come up with
> their own ad hoc 'tag system', the overall consequence of which is
> that source files are neither fish nor fowl: not HTML documents, not
> Perl scripts, just, well, some kinda sorta 'tag system' files.

Hubris brother, hubris. If it ain't hurtin' it's helpin. (I've been in 
the south too long!)
 
> IMHO, any serious templating work starts with things that go beyond
> lookup-based substitutions, as when actually having to generate the
> HTML for some or all of the final result (example: running a query and
> then displaying a client-selectable number of results at a time.) This
> is where the homegrown 'tag systems' begin to buckle, because the
> *syntactic* requirements of defining semantics - some sort of 'tag'
> which the Perl script as a post-processor will have to recognize and
> act upon - become non-trivial. All the more reason, therefore, to
> leverage a pre-existing standard syntax.

I agree 100%... I'm not working on sites with 20,000+ visitors a day or 
presenting very comples structures though... so this 'hacky' stuff works 
for the small business websites I maintain. I'm sure if I were in a 
situation where in a grander scale (and I were paid more to do it) I'd 
being looking a few steps up the technology ladder too. I'm sure there 
aren't any geekoids up at Amazon.com thinking.."Hmm.. what if we used a 
hash and some prebuilt templates? Man... they are gonna think we rule!" 
I'd say it all falls under right tool, right job, right situation. :)

> If you can stand the learning curve (not too onerous, IMHO), I'd
> suggest seriously considering the use of the SP distribution and the
> SGMLS.pm package from CPAN. 

For God's sake Jim, he's just a newbie! :)

Nice Counterpoint FollowUp.

-- 
Bones


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

Date: Thu, 13 May 1999 00:49:49 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: password checking
Message-Id: <1drpvm4.22xbauenun8qN@p0.tc19a.metro.ma.tiac.com>

<pontz@channel1.com> wrote:

> Anyone see what is wron with this sub. What it is suppose to do is
> check the password the user enters with the password in .htpassword
> file. 
> sub check_login {
>   # clean up name first
>   $in{'name'} =~ y/a-zA-Z0-9/ /c;
>  $in{'name'} =~ s/\s//g;
>   my $lname=$in{'name'};  $lname =~ y/A-Z/a-z/;
>   if (! defined($in{'pass'})) { &print_password }
>  $pwdFile = new Apache::Htpasswd('.htpasswd');
>  -e ".htpasswd" || &print_error(".htpasswd file doesnt exist");
>   if ($pwdFile->htCheckPassord($lname, $in{'pass'})) {
>    next;
>   }
> }

I see at least three things wrong with this sub:

The indenting is atrocious.

You misspelled 'Password' in 'htCheckPassword'.

You do a 'next' even though you don't appear to be in a loop.

HTH!


-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 13 May 1999 08:22:31 GMT
From: dVoon <dvoon@my-dejanews.com>
Subject: Perl cgi on a standalone PC?
Message-Id: <7he246$qs4$1@nnrp1.deja.com>

I've written some perl programs as cgi script running on an Apache
server. The database is just a set of ASCII text flat files. Now my
company want to sell the data on a CD. The idea is to put the data in a
CD and the client can use a web-browser to browse the data on a
standalone PC (typically win32 machine).

The question is: how do I get the perl cgi script to run on a
standalone machine? I do understand that the client machine must have
ActivePerl installed so that the perl script can be translated to HTML
page. But how to get the machine to 'serve' that page for the browser?

Please help.

Dan


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Wed, 12 May 1999 23:09:39 -0700
From: Erik Johnson <ejohnso9@earthlink.net>
Subject: perl debugger acting bizarre (debugger bug?)
Message-Id: <373A6CA3.971573D8@earthlink.net>

Below is the output from my script that seems to have the debugger very
confused for
some reason. This script was orginally 300+ lines, but I was trying to
cut it down to
the minimal thing that exhibited the bahviour, so nevermind what the
(now) pointless
script really does - the question is in what the debugger is doing with
it.
When I was working with the full script, I first notced that compile
errors did not have
the right line numbers for the complaints it was making. After fixing
compile errors, the
debugger was not stopping at breakpoints I set, etc.

    Right now, in the cut-down version below, if I invoke the command:

    $ perl -d foo6

I can set a breakpoint on line 23, but when I try to set a breakpoint on
line 25,
it will tell me that line 25 is not breakable (an identical line to 23).

After changing line 24 to read:
    # line foo
*then* I can set a breakpoint  on line 25. This is totally bizarre. What
difference
does it make what my comment says?!?
I am guessing this is a debugger bug and probably implementation
dependent,
but to date I have not expereienced any problems or strange behaviours
with
the HP-UX build.

    Can anyone out there explain what's going on here? Things like this
drive me batty. Even if you can't explain it, I'd be interested to know
if
if you can replicate the bahviour.

Thanks in advance,
-ej


$ uname -a
HP-UX pluto B.10.20 E 9000/800 455526301 8-user license
$ perl -v

This is perl, version 5.004_04 built for PA-RISC1.1

Copyright 1987-1997, Larry Wall

Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.

$ cat -n foo6

     1  #! /usr/local/bin/perl
     2
     3  $DEBUG = 1;
     4  $infile_name = $ARGV[0];
     5  open INFILE, $infile_name;
     6  @text = <INFILE>;
     7  close INFILE;
     8
     9  $line_no = 0;
    10  while ($line_no <= $#text) {
    11    $line_no++;
    12    $line = $text[$line_no - 1];
    13
    14    # find first line of flight plan proper
    15    if ($line !~ m|foo| )
    16    {
    17      next;
    18    }
    19    else {
    20      last;
    21    }
    22  }
    23  $foo = 1;
    24  # line 18
    25  $foo = 1;





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

Date: Thu, 13 May 1999 01:34:07 -0400
From: tigerstr@postoffice2.bellatlantic.net
Subject: Perl Programmer
Message-Id: <373A644F.C36C80D4@postoffice2.bellatlantic.net>

In search of a perl programmer to either do some work at home or in the
NYC area. No need for a Perl Genuis, someone with a few years of
experience will do fine. There will be several small scripts and
applications that will need to be written over the next few months.
Please send resume or any other information or questions to
tigerstr@bellatlantic.net.

Thanks,

Joseph



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

Date: Wed, 12 May 1999 23:02:03 -0400
From: Michelle Warner <hrdbdy@sprynet.com>
Subject: Setting Environment Variables
Message-Id: <373A40A9.9BDC99D9@sprynet.com>

I have a perl script which is executed from the web.  The script
interfaces to a Sybase database via Sybperl thus I need to have the
LD_LIBRARY_PATH set to where the Sybase libraries are located.  The
script appears to run under the www user so I had my SA set the
LD_LIBRARY_PATH but I am still having problems.  I am not not sure if my
SA restarted the Web server or if it needs to be restarted for this
change to effect.  I have information being Posted from a form so I am
trying to avoid writing a shell script which would set this environment
variable and then exec the other perl script.  IF I did take this
approach, how do I capture and pass the form information in the shell
script.  Thanks in advance.

--
Peace,
      Michelle
http://home.sprynet.com/sprynet/hrdbdy
ICQ# 17965901

"Still I Rise" - Maya Angelou




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

Date: Thu, 13 May 1999 03:37:50 GMT
From: "Stephen Warren" <swarren@www.wwwdotorg.org>
Subject: Re: Setting Environment Variables
Message-Id: <iOr_2.639$6x6.757@news.rdc1.sfba.home.com>

Michelle Warner <hrdbdy@sprynet.com> wrote in message
news:373A40A9.9BDC99D9@sprynet.com...
> I have a perl script which is executed from the web.  The script
> interfaces to a Sybase database via Sybperl thus I need to have the
> LD_LIBRARY_PATH set to where the Sybase libraries are located.

Not really a Perl-specific question...

If you are expecting your script to inherit LD_LIBRARY_PATH from the
Web-server, it will certainly have to be restarted.

However, you could always try something like:

#!/usr/local/bin/perl -w

use strict;
$ENV{ 'LD_LIBRARY_PATH' } = '/usr/sybase/lib' ;
use some_sybase_module ;

But then again, this might be too late in sybperl - it all depends when it
loads in the Sybase libraries...

Or, even put in into a BEGIN{}

P.S. Just testing something in my broken news-reader below...

--&#032;
Stephen Warren, Snr Systems Engineer, Technology House, San Francisco
mailto:swarren@techhouse.com                http://www.techhouse.com/
mailto:swarren@wwwdotorg.org                http://www.wwwdotorg.org/
              MIME, S/MIME and HTML mail are acceptable





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

Date: Thu, 13 May 1999 03:24:02 GMT
From: "Stephen Warren" <swarren@www.wwwdotorg.org>
Subject: Re: translating FAT to VFAT
Message-Id: <mBr_2.636$6x6.884@news.rdc1.sfba.home.com>

Jan-Friedrich Mutter <jfm@bigfoot.de> wrote in message
news:7h4qvt$ghv$1@union.informatik.uni-muenchen.de...
> Hi,
>
> is there a module or method or code available which is able to
translate,
> say 'C:\Progra~1' to 'C:\Program Files' ?

If there is, it'd probably be at http://www.perl.com/CPAN

However, I'm not sure there would be... How come you're getting 16-bit
pathnames anyway? You _might_ find things work better if you get the
latest Perl (build 515 AFAIK) from http://www.activestate.com/

--
Stephen Warren, Snr Systems Engineer, Technology House, San Francisco
mailto:swarren@techhouse.com                http://www.techhouse.com/
mailto:swarren@wwwdotorg.org                http://www.wwwdotorg.org/
              MIME, S/MIME and HTML mail are acceptable





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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5650
**************************************

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