Obvious Noob Q

2005-10-29 Thread Mike Lesser
Hi all. I'm sure this is mentioned somewhere, but I can't seem to  
find the exact answer.


I came back (today) after a long absence (and not much experience),  
which included an update to Tiger. I know that there is a default  
Perl 5.8.6 installation, and separate folders for Apple's use, and  
for our own. However, I can't tell what's what and think I may have  
some excess junk. (I've even reinstalled some pm's, and that just  
made me more confused). I think I have a weird install.


There's the /System/Library/Perl/, which is the Apple (??)  
installation, right. If I update key modules, they will be installed  
here at various levels. For example, CGI goes into /System/Library/ 
Perl/5.8.6/, while Cwd gets installed into /System/Library/Perl/5.8.6/ 
darwin-thread-multi-2level/.


Then there's the /Library/Perl/ folder for nonstandard (is there a  
better term?) modules. I've got folders /Library/Perl/5.8.1 and / 
Library/Perl/5.8.6.


So far so good? Now what seems odd is that my scripts run on stuff  
that's in 5.8.1. If I move that folder, my stuff won't run. So...I  
have to assume that the 5.8.1 stuff is in the path. That being said,  
what happens when I use CPAN to install or update? Is it smart enough  
to know what to do? Or am I totally hosed now?


TIA
Mike



VCSs CGIs on localhost

2005-04-29 Thread Mike Lesser
So... I'm having some fun, working on my CGIs and web pages, and
naturally making a big mess. I need to have version control like any
old programming project. I've been manually copying stuff up to
/Library/, but was thinking of using a VCS in my own development
folders, and using Interarchy or similar to mirror up to localhost.
(This seems to be beyond my skill level, btw)
Then it hit me  - what do people normally do when they are working on
this kind of stuff? Many of them must be developing/testing locally, 
and then
copying their stuff up to their server when appropriate.

I don't know that I'll ever be putting anything up on a server for some
time, but I'd rather benefit from the experiences of...the, er, 
experienced.

I'm using Subversion; not that that makes a difference.
Mike


Re: First CGI Setup

2005-03-10 Thread Mike Lesser
On Mar 9, 2005, at 5:19 PM, Sherm Pendley wrote:
On Mar 9, 2005, at 5:03 PM, Mike Lesser wrote:
# To use CGI scripts:
#
#AddHandler cgi-script .cgi
That doesn't do much when it's commented out. ;-)
That's why I included it - the web article told me to uncomment it, but 
when
I did, all I got were permission errors. So normally this would be 
uncommented?



Re: First CGI Setup

2005-03-10 Thread Mike Lesser

I thought by default OS X has the cgi setup automatically.
I didn't have to do anything, just turned on the web server.
And put the perl script in the CGI-EXECUTABLES folder and it works.

I've seen comments online to this effect; that's why I think there's 
some
fundamental issue with what I did to httpd. I don't necessarily trust a
single article to be correct - or timely.

I think that whatever is the contemporary solution is what I want. Is 
that
to make the default solution work, and what do I need to repair? Or is 
there
a reference to how I can make that work?

M


Re: First CGI Setup

2005-03-10 Thread Mike Lesser

I thought by default OS X has the cgi setup automatically.
I didn't have to do anything, just turned on the web server.
And put the perl script in the CGI-EXECUTABLES folder and it works.
That works, yes - but it's not what Mike wants to do. On many servers,
files with a .cgi extension are run as CGI scripts, regardless of what
directory they're in. Mike asked how to enable that behavior.
Ted, I don't know exactly -what- I'm trying to do! ;-) I believe that I
should have whatever is the most common setup for home development,
but I don't know if that is the same as the default Mac setup, or if
they conflict in some way. I can't make any assumptions really.
If I should be using scripts with a cgi extension in my Sites folder,
because that's the easy way to get started, then that's great. It
looks like I may have broken that behavior by following the articles,
and need to do some repair on httpd.conf. I figured I should post all
the stuff I messed with, so see if any of it was stupid.
Also Is there any reason why I would want to go in a particular 
direction with
regard to cgi extensions or html /shtml?

While I'm sure that this is the kind of stuff I'll eventually be 
familiar
with, I don't want to create extra headaches or compat problems early 
on.

M





First CGI Setup

2005-03-09 Thread Mike Lesser
Hi all. I'm busy setting up to run (okay, play with) CGIs. So for, not 
so great.

According to the Apache error logs, I'm connecting okay, but something 
seems to
be off.i've been reading up on the config issues, and I've worked thru 
some of
them, but frankly I'm out of my element, and concerned about munging up 
httpd.conf
so badly I'll be sent away.

The script..
#!/usr/bin/perl -w
print Content-type: text/html\n\n;
print h2Hello, World!/h2\n;
...shows up in safari with the script text, but with Hello World in 
the header
font style!

!/usr/bin/perl -w  print Content-type: text/html\n\n;  print 
Hello, World!
\n;
These are (AFAIK) the relevant httpd parts. Note that I was following a 
tutorial
on the O'reilly site, and one here 
http://www.cgi101.com/learn/connect/mac.html
and made the most progress with using my own home directory (as opposed 
to
/Lib/./CGI-Exe). (I'm not sure what makes the most sense, just for
at-home development. I'd imagine the more real-world setup is better)

Directory /Users/mike/Sites
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch Includes ExecCGI
DirectoryIndex index.html index.cgi
Limit GET POST OPTIONS PROPFIND
Order allow,deny
Allow from all
/Limit
LimitExcept GET POST OPTIONS PROPFIND
Order deny,allow
Deny from all
/LimitExcept
/Directory
and...
# To use CGI scripts:
#
#AddHandler cgi-script .cgi
#
# To use server-parsed HTML files
#
#AddType text/html .shtml
#AddHandler server-parsed .html
The log says this (which to my eyes looks better than what I've seen 
before

[Wed Mar  9 16:51:37 2005] [notice] Apache/1.3.33 (Darwin) PHP/4.3.2 
configured -- resuming normal operations
[Wed Mar  9 16:51:37 2005] [notice] Accept mutex: flock (Default: flock)

Yikes! This is long!
Mike


Re: could not build a module

2005-02-28 Thread Mike Lesser
I will install the Xcode and see how it goes.
You know where to find it?
FWIW, you can probably get the XCode CD from an AppleStore. I stopped 
by the Cambridge store one day and they literally said take it. Saves 
a long download..

Mike


More Newbie Help

2005-02-04 Thread Mike Lesser
Wow thanks for all the input! I'm slogging along with the Llama book, 
and I have some MySQL (new to that too) stuff working. I'm concerned, 
thought, that I'm creating a mess by installing modules and downloading 
stuff. Likewise I've been using CPAN with no clue as to what I'm doing. 
Is there a book or site that covers working with CPAN and using modules 
that is appropriate for Panther? Googling  the O'Reily Mac site have 
turned up lots of fixes for gotchas, but not much for the newbie.

That being said, is it normal that a lot of the CPAN stuff (of interest 
to me) is really old? It seems odd to be using 5 year old stuff!
Mike



Re: Newbie, PDF

2005-02-02 Thread Mike Lesser
Thanks Bill and thanks to everyone who responded. An excellent gang! I 
think the consensus is ...

(1) I probably don't want to go directly to PDF; I need to create 
something else (something easier) and then, if I still want, convert 
or print to PDF.
(2) Interim formats include HTML, XML, and LaTex, and maybe 
PostScript, in order of increasing complexity/learning curve
(3) All of the above can be done with free stuff (super)
(4) Perl _is_ probably a good solution for this, as opposed to PHP or 
another scripting language

My output is charts like a collection of lists or tables, not graphs 
(yet), and it sort of resembles an invoice in some respects. It's 
essentially data extracted from MySQL, printed out nicely. A bitmap 
may be thrown in here or there, like a logo. I'm thinking that HTML  
tables may be the easiest way; LaTex  I have to research more.

I just had an epiphany: Pages from iWork. Pages apparently will import 
XML, and AFAIK, XML is the native format. I can do the aesthetic stuff 
right in pages and either edit or create the documents in XML with 
Perl. How's that?

Thx
Mike