Re: Calculate the distance between 2 coordinates

2002-01-10 Thread Mel Matsuoka

At 09:56 PM 01/10/2002 -0600, you wrote:
I've been looking for either a perl script or module to help me
calculate the distance between 2 coordinates.  Does anyone have any
ideas or scripts?

No need for a module, all you need to do is remember basic high-school
geometry. Two words: Pythagorean Theorem :)

Aloha,
mel


--
mel matsuoka
Technical Director/Trained Primate
Hawaiian Image Productions

[vox] +1 808.531.5474 
[fax] +1 808.526.4040
[e-mail] [EMAIL PROTECTED]
[www] http://www.hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: why wont images in webpages created with perl show up?

2001-12-05 Thread Mel Matsuoka

At 10:27 AM 12/04/2001 -0500, Jeremy Webster wrote:

I have a page that I create from a perl script.  My problem is that the 
images in the page dont load.  I have the same problem when I try to use a 
..css file as well.  

What's the deal?  Everything else seems to work just fine.

Here is a snippet of my code

print EndTop;
 (code snipped)
link rel=stylesheet href=report.css type=text/css
 
 (more snippage)
  img src=titlePic.gif
   ...



The titlePic.gif doesnt work, nor does the report.css

Your problem is a server issue, not a Perl issue. An HTTP useragent may
*only* access CGI scripts under a directory which has been explictly
configured to execute scripts. This is for security reasons. So basically,
trying to access anything in /cgi-bin that is /not/ executable will get you
a permission denied error. GIF and .css files are not executable, hence
they wont show up in your browser.

Aloha,
mel

--
mel matsuoka  (vox)1.808.531.5474
Head Geek (fax)1.808.526.4040
Hawaiian Image Productions  [EMAIL PROTECTED]
http://hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Fwd: Fw: PLEEEEEEEASE DONT BE SO STUPID!!!

2001-12-01 Thread Mel Matsuoka

At 10:28 PM 11/30/2001 -0800, you wrote:
hey,

this does not concern perl, but maybe you should read
it.
it may be true and if so it's a really good deal.

Note: forwarded message attached.

If it does not concern Perl, then why the hell are you spamming it to this
mailing list, as well as dozens of other people visible in your CC: line?

I would like to think that people who are smart enough to know Perl are: 

A) Considerate enough to not paste 18-million of thier freinds email
addresses into the CC: line for everyone in the world to see.

B) Clueful enough that if they insist on forwarding messages like this en
masse, they actually trim the message they want you to read, and eliminate
all of the excess original message quoting crap left by previous
forwarders.

C) Smart enough to realize *instantly* that really good deals like this
are complete and utter urban-legend B.S. (see
http://www.snopes2.com/inboxer/nothing/nothing.htm for specifics)

D) Smart enough to not to continue the chain of idiocy and ignorance by
forwarding such moronic messages to everyone, ESPECIALLY internet
special-interest mailing lists, which are universally intolerant of spam
of any kind.

Sorry to sound so harsh, but I have been getting this same stupid forwarded
AOL/Intel message on a weekly basis for at least 2 years now, so to see it
being spread on a high-quality mailing list like the beginners-cgi list
just ticks me off to no end. It also makes me wonder why it continues to be
forwarded after all this time...you would think that most people would have
figured out by now that this is bogus, and stopped spreading it.

Lets use some common sense, people. Not to mention common courtesy. Educate
yourself on basic internet nettiquette, as well as urban-legend detection
(http://www.snopes.com), so you don't continue to embarrass yourself in
public with dopey things like this.

Aloha,
mel


--
mel matsuoka  (vox)1.808.531.5474
Head Geek (fax)1.808.526.4040
Hawaiian Image Productions  [EMAIL PROTECTED]
http://hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Any quicker way of writing the following...?

2001-11-26 Thread Mel Matsuoka

At 10:18 AM 11/27/2001 +1030, Daniel Falkenberg wrote:
Hey all,

Once again I feel as if the following code is far too long and can
easily be shortened.  Could some one give me some ideas on doing this?

foreach my $U (sort keys %PASS) {
  $PASS{$U}{'fname'} = ;
  $PASS{$U}{'lname'} = ;
  $PASS{$U}{'user'}  = ;
  $PASS{$U}{'password'}  = ;
}

Of coarse all the above does is reset the hash values (%PASS) to equal
nothing.  I am pretty sure I can do this alot easier.]


If all you want to do is reset the values of the entire hash, you can just
undef the hash, or reset it like this:

%pass = ();


If you need to reset specific keys, then try something like this:

my @reset_keys = ('fname', 'lname', 'user', 'password');

foreach my $reset_key (@reset_keys) {

foreach my $U (keys %PASS) {
$PASS{$U}{$reset_key} = undef;
}

}

HTH..aloha
mel

--
mel matsuoka[EMAIL PROTECTED]
Head Geek(vox)1.808.531.5474
Hawaiian Image Productions   (fax)1.808.526.4040
http://hawaiianimage.com




Also does the following have to be written like so?

$new_user = $PASS{$PASSWD_NAME}{'user'};
$new_pass = $PASS{$PASSWD_NAME}{'password'};
$new_fname= $PASS{$PASSWD_NAME}{'fname'};
$new_lname= $PASS{$PASSWD_NAME}{'lname'};

Do I have to declare each hash value like the above.  Of coarse I want
to be able to still declare a variable to each hash value that I want

Does any one have any ideas on this?

Thx in advance,

Dan

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: off topic - javascript question

2001-10-29 Thread Mel Matsuoka

At 11:53 AM 10/28/2001 -0500, Luinrandir Hernson wrote:
I want to have a window loaded when someone leaves my website.
does anyone know what is wrong with the following code?
Thanks!

script
BODY onUnload=open(exit.htm,   scrollbars=yes,width=250, height=400)
/script

Try comp.lang.javascript instead. This is the wrong forum for Javascript
questions, even if you declare off topic in the subject header.

Cheers,
mel


--
mel matsuoka  (vox)1.808.531.5474
Head Geek (fax)1.808.526.4040
Hawaiian Image Productions  [EMAIL PROTECTED]
http://hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Need help with CGI module

2001-10-28 Thread Mel Matsuoka

At 01:12 AM 10/28/01 -0700, Dave Turner wrote:
I have scanned the docs and can't seem to find the answer to this anywhere.

I want to change the color of the text and the font size on a web page 
using CGI:pm.

my code looks like:

$q-h2( Something witty here);

but I'd like to have the flexibility to do FONT SIZE=+2FONT COLOR=white


First off, you shouldn't be using the FONT tag to specify type attributes
unless you have a rabid need to support legacy (i.e. non-CSS enabled)
browsers. And you should /definitely/ not use the named aliases for HTML
colors...always use their hexadecimal equivalents. The FONT tag is
deprecated in the W3C HTML specs.

That being said, you can easily apply an inline style using the CGI.pm
span() method. It's explained clearly in the documentation for CGI.pm:

http://stein.cshl.org/WWW/software/CGI/


Aloha,
mel



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: no luck pie charts and perl

2001-10-25 Thread Mel Matsuoka

At 04:10 PM 10/25/2001 -0700, tom poe wrote:
Hi, Zentara:  I fiddled [far more than one would expect], and used the 
recently posted write to file format above, and it works with the top line, 
#! /usr/bin/perl -w.  But, if I add use strict; at the top of the
script, 
I can't compile:
tompoe@aether:~/perlStuff  createpng
Global symbol $im requires explicit package name at ./createpng line 5.
Global symbol $red requires explicit package name at ./createpng line 7.
Global symbol $im requires explicit package name at ./createpng line 7.
 (more errors snipped)

So, since we're here, do you understand what the message is?  A required 
explicit package name?  I'm lost.  Thanks, Tom

You should first understand what 'use strict; does before anything:

perldoc strict

Turning on strict mode requires that you declare your variable scope before
using them. This is the source of your errors.

Aloha,
mel



--
mel matsuoka  (vox)1.808.531.5474
Head Geek (fax)1.808.526.4040
Hawaiian Image Productions  [EMAIL PROTECTED]
http://hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Simple Guestbook CGI.pm in @INC???

2001-10-23 Thread Mel Matsuoka

At 06:44 PM 10/23/2001 -0700, pAuLyOYo wrote:
Hey~
I've been trying to made a simple guestbook, i
copyed the whole code from Learning Pearl(O'Reillys
book) i uploaded to tripod and didn't work
show me this:

..
It looks like there was an error: 
Your script produced this error: Can't locate CGI.pm
in @INC (@INC contains: .) at ./guestbook.cgi line 5.
BEGIN failed--compilation aborted at ./guestbook.cgi
line 5. 
..


The fifth line is

use CGI qw(:standart);

qw(:standard), not standart. 


there is the problem i guess...

This is my code:


#/usr/bin/pearl -w


For some strange reason, you seem to like spelling Perl as pearl. This is
obviously incorrect. Also, your shebang line is missing the bang part.
It should look like this:

#!/usr/bin/perl -w


use 5.004;
use strict;
use CGI qw(:standart);

Once again, its spelled standard


my{
   $CHATNAME,
   $MAXSAVE,
   $TITLE,
   cur,
   @entries,
   $entry,
};


(lots more code that I have no desire to comb through snipped ;))

What's with the cur bareword in the my block? And a my() declaration
should not be enclosed with braces, but parenthesis.

Aloha,
mel


--
mel matsuoka  (vox)1.808.531.5474
Head Geek (fax)1.808.526.4040
Hawaiian Image Productions  [EMAIL PROTECTED]
http://hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: I want out, but I'm no idiot.

2001-10-21 Thread Mel Matsuoka

At 04:18 AM 10/21/2001 -0400, Yugo Acimovic wrote:
you are not the only one, I was trying to unsubscribe for months without 
success.
Looks like this group is run by loosers.


I will give them one more week to unsubscribe me, and then report them.
That is what everyone with same problem should do.

Report them to who? The Net Cops(tm) ?


--
mel matsuoka  (vox)1.808.531.5474
Head Geek (fax)1.808.526.4040
Hawaiian Image Productions  [EMAIL PROTECTED]
http://hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: strange exclamation marks

2001-10-21 Thread Mel Matsuoka

At 06:11 AM 10/21/2001 +0100, Guy Tubbs wrote:

I'm trying to finish my script that will read part of an html page and stick
it into an email which is sent with sendmail.

However, I'm having problems with the email that sendmail is sending out, as
it is inserting exclamation marks in the message followed by a line return.

Such as

img src=../gfx/logos/!
ponorth.gif border=0 alt=Pamp;O North Sea Ferries height=52
width=140

which is obviously messing the resulting html up.

Any ideas why these exclamation marks are appearing?

Because sendmail is just following the guidelines of RFC821, which says
that text lines must not exceed 1000 characters. 

Aloha,
mel


--
mel matsuoka  (vox)1.808.531.5474
Head Geek (fax)1.808.526.4040
Hawaiian Image Productions  [EMAIL PROTECTED]
http://hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Free CGI Hosting?

2001-10-21 Thread Mel Matsuoka

At 06:26 PM 10/21/2001 -0700, pAuLyOYo wrote:
Hi all,
I'm a newbie in pearl. I'm reading Learning Perl, is
kind a easy, well, if i wouldn't know c, would be
hard...
enough of that...
i need a free server that allows cgi, to star
practice...
can somebody recomment me some servers?

You don't have to rely on a hosting provider to practice CGI and Perl. Just
download and install a webserver on your own computer, such as Apache or
Xitami. Or you can download IndigoPerl at
http://www.indigostar.com/indigoperl.htm, which makes it really easy to
install a Perl/CGI enabled local Apache webserver.

Hope this helps. Aloha,
mel

--
mel matsuoka  (vox)1.808.531.5474
Head Geek (fax)1.808.526.4040
Hawaiian Image Productions  [EMAIL PROTECTED]
http://hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: finding text in a gif image

2001-10-20 Thread Mel Matsuoka

At 10:45 PM 10/20/01 -0400, David Kirol wrote:
Hi All,
I need a way to extract the text portion from a .gif image of the
type attached. Any ideas?


Ooo, you're gonna have a ton of fun trying to pull that off :)

You're probably going to have to write your own OCR routines and tie them
into the GD or ImageMagick modules. As to how to write said OCR routines,
I'm the entirely wrong dude to ask :)  There's an opensource OCR project
called GOCR that you might want to check out, at
http://altmark.nat.uni-magdeburg.de/~jschulen/ocr/index.html

However, if all you want to do is crop the text out the image, it's
extremely easy using GD.pm 

Aloha,
mel

 
--
mel matsuoka  (vox)1.808.531.5474
Head Geek (fax)1.808.526.4040
Hawaiian Image Productions  [EMAIL PROTECTED]
http://hawaiianimage.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Don't print...

2001-10-04 Thread Mel Matsuoka

At 04:02 PM 10/04/2001 +0930, Daniel Falkenberg wrote:
List,

Can some one tell me why it is that the following code prints the
results on the screen when I don't have the print command in there at
all???

$shell = ifconfig(ppp0);
cp($shell, /etc/ppp/ppp);

Probably something in your ifconfig routine is sending its output to STDOUT...

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Please Stop (was: Re: eval problem)

2001-10-02 Thread Mel Matsuoka

At 03:23 PM 10/02/2001 -0700, Michael Kelly wrote:
Well, being somewhat of a beginner myself, I think it is very helpful to
look at stuff that's above your head. I certainly don't mind the fact that
80% of the stuff on this list is above me, and I think that, when I do start
dealing with some of the more advanced stuff, I'll have had a little
introduction to it here (Oh yeah, I remember so-and-so mentioned that...).

Overall, I think it's beneficial to see stuff that's above your head, no
matter what level you're at, as long as it's made clear that total beginners
can can ask simple questions and not be flamed for it.

I definitely agree with you, Michael. It's kind of like any activity, such
as basketball or tennis. If you force yourself to watch and play with
people who are much more advanced than you, you'll naturally end up getting
better by osmosis. Although a lot of the Perl discussion that goes on in
c.l.p.m. goes over my head, I'll end up digging that discussion out of my
memory banks (and dejanews) the next time I have a Perl problem, simply by
virtue of having seen such a discussion take place.  

Of course that being said, I suppose is it out of the charter of this
mailing list to exercise ones advanced Perl muscle needlessly. I can
understand that it does more harm than good to show a newbie some cool and
efficient--yet obfuscated--method of getting a simple task done, when said
newbie is still in the stages of learning the core language and
methodologies first. I can imagine this is why many people are turned off
by Perl because they see a lot of compact, read only code written by
experienced Perl jockeys :)

Just my $.02...Aloha,
mel
--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Perl/Postgres hosting providers (WAS Re: How to save and retreive form)

2001-09-26 Thread Mel Matsuoka

At 12:02 PM 09/26/2001, Mel Matsuoka wrote:

Agreed.

Now if we could only get web hosting providers to agree as well. 

Replying to my own post...I was wondering if anyone here can make a
recommendation on a GOOD hosting provider that supports Perl5 and
PostgreSQL (and PHP4 as well, ideally). I know there are many out there,
but I'm looking for one that is developer friendly (like my current kickass
provider, FutureQuest.net) and whose servers and connections are fast and
reliable.

Any suggestions would be appreciated. 
Aloha,
mel

--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: printing out yesterdays date

2001-09-26 Thread Mel Matsuoka

At 12:45 PM 09/26/2001 +0530, Rahul Garg wrote:
is there any command in linux to get yesterdays date  -mm/dd/yy

or can a program be written for it in perl...any suggestions

One way to do it is to get the time(), subtract 86400 from it, then feed
the result to localtime().

Or you could just use Date::Calc, but thats just not as fun ;)

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Please solve the problem

2001-09-26 Thread Mel Matsuoka

At 07:14 AM 09/25/2001 -0700, parvatam jagannadh rao wrote:
Hi


I want to call a system command (linuxconf module
dnsconf) to pass parameters to console but i am unable
to do from a cgi program. if i execute from console
it is working fine.

The reason why it wont work via CGI is because the webserver runs as a
non-privledged user, and linuxconf requires root privs.

Whatever you're trying to do sounds rather dangerous. If you are intent on
doing system administration via a web-browser, I would recommend you take a
look at the Webmin package instead of trying to re-invent this particular
wheel.

I personally dont use Webmin, cause it still freaks me out to be doing
root-level configurations using a webbrowser, unless you restrict access
only to localhost.

HTH, Aloha,
mel

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: whats the best cgi/perl book around?

2001-09-25 Thread Mel Matsuoka

At 10:38 AM 09/26/2001 +0800, louie miranda [EMAIL PROTECTED]
wrote:

Hi, im just wondering whats the best cgi/perl book?


What's the best religion? ;)

There aint no such animal. You have to be more specific with the
question...It really depends on what your needs and skill level are. A book
that is great for people who have neither Perl or general programming
experience would probably be terrible for someone who has programming
background, but is new to Perl.

Personally, I can recommend the following books:

If you're new to both programming in general as well as Perl, Elements of
Programming with Perl by Andrew Johnson is one of the best primers out there.

I also heartily recommend Randal's book, Learning Perl. I haven't seen
the newly released third edition (which i understand is a complete rewrite
of the 2nd edition), but the 2nd edition really helped me get up to speed
with Perl. Randal is an excellent and funny writer as well, so the book is
actually fun to read.

If you're new to Perl, but already have experience with programming,
Programming Perl by Larry Wall (aka the Camel book) is the one to get.
It's considered to be the Bible of Perl programming in any case, so even if
you're a newbie programmer in general, you should get this book as well for
reference purposes.

In any case, this question is in the FAQ for this mailing list:
http://learn.perl.org/beginners-faq (item 3.3) you might want to check it
out for more suggestions, as well as: 

Uri Guttman's Perl book reviews: http://www.sysarch.com/cgi-bin/perl_books
Tom Christiansen's camel Critiques: language.perl.com/critiques/ 
Perlmonks review page: http://www.perlmonks.org/index.pl?node=Reviews

Aloha,
mel

--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: how to open a .iso file

2001-09-19 Thread Mel Matsuoka

At 08:44 AM 09/19/2001 -0700, Jon wrote:
Ditto.  If you don't like spam quit hanging in the canned good 
section.  You need to realize that RC might not be signed up with the 
.iso mailing list so he might choose to reach out to some of these more 
well trafficked maillists for friendly queries.  I don't have a problem 
with that.  No one should have a problem with questions that don't quite 
fit the group subject 

I refer you to this section in the FAQ for this very mailing list:

2.2 - What is this list _not_ for?
SPAM
Homework
Solicitation
Things that aren't Perl related
Monkeys
Monkeys solicitating homework on non-Perl related SPAM.

I'll leave you to decide which categories that the post falls under. 

 Everyone should 
have a problem with people who scold people publicly on this maillist 

No...people should have a problem with people who publically and RUDELY
flame people for making honest mistakes. On the other hand, people should
be mature and thick-skinned enough not to take rebuke pesonally and learn
from thier mistake. The answer is NOT to let such people get away with it
for the sake of being nice.

Like all communities in the real world and on the internet, this mailing
list has to abide by certain social norms in order to maintain a semblance
of order and efficiency. And this means *not* rewarding clearly off-topic
questions with answers posted to the rest of the list. I've been on way too
many  mailing lists where nobody bothered to enforce this simple rule, and
as such, the list eventually became unreadable due to everyone using it as
a 24 hour helpdesk on /everything/ computer related, even if it didnt apply
to the topic of the list. 

There is absolutely no reason to post off-topic messages like that when
there are already other forums (and search engines) that exist to answer
such questions. A simple search on groups.google.com would have revealed
the answer to the OP's question in less than 5 seconds. 

That being said, I think it was entirely inappropriate for some people to
flame the OP in the manner that they did. This is not comp.lang.perl.misc.,
if you want to be a bully to newbies, then you probably should hang out
there instead ;)

Aloha,
mel

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: how to open a .iso file

2001-09-19 Thread Mel Matsuoka



At 05:30 PM 09/19/2001 +0200, Andy McDowell wrote:
Spam... since when was asking questions and wanting to learn something spam??


Asking questions and wanting to learn is not spam.

Crossposting your questions to multiple unrelated mailing lists, on the
other hand, technically IS spam and considered bad netiquette in general.
It becomes especially annoying when you start getting crossposted followups
from people from other lists who didnt bother to edit the Reply-to: line,
which compounds the spam, because most of the time, these replies are
either people answering the question in a way that relates to the topic of
/thier/ list (i.e. Oracle, in this case), or people from those lists that
end up flaming the original crossposter for crossposting and asking OT
questions.

Yes, I suppose all you have to do in such a case is just hit the delete
key. But the point is, there ARE certain guidelines (aka rules) that are
explicitly in place on this, and most every other mailing list. As such,
you shouldnt HAVE to hit the delete key, because people are expected to
behave properly in such a forum. And when they don't, you tell them nicely
at first the cease the offending behavior. 

If you invited someone to your house and they torched up a cigarette, you
wouldn't just move yourself to another room and lock the door behind you
just so you wouldn't have to smell the smoke, would you?

Aloha,
mel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: DBI limitations

2001-09-19 Thread Mel Matsuoka

At 03:34 PM 09/19/2001 -0500, SAWMaster wrote:
Hello, can someone tell me why DBI can only handle 6 fields?  

No, because it can handle much more than 6 fields :)

I have a data base table that has more than 6, and I don't 
know how I'm going to accommodate it all in my cgi script.  

Please show us your code so we can help you better. I have used DBI for
everything as simple as a 3 field table all the way up to a ridiculous 20
field table, so your problem is almost certainly an issue with errors in
your Perl code, and not DBI itself.

What DBD are you using, btw?

Aloha,
mel



--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: how to open a .iso file

2001-09-19 Thread Mel Matsuoka

At 02:23 PM 09/19/2001 -0700, Jon wrote:
On the other hand, people should
be mature and thick-skinned enough not to take rebuke pesonally and learn
from thier mistake. The answer is NOT to let such people get away with it
for the sake of being nice.

so for example i could tell you something one of 2 ways:
Hey friend, you spelled 'their' incorrectly, it is actually spelled 
'their', have an awesome day!
or
Hey jackass, you're a big retard - (didn't even bother to refer the OP to 
dictionary.com) (grin none of that - pesonal)
(obviously I don't know the rules of borderline vulgarity on this list, 
hope i don't get kicked off...)

Actually, either way is wrong. You should know by now that spelling-flames
are the hallmark of a newbie/weenie poster. It ranks right up there with
questioning the sexuality of the person you're flaming ;)

Aloha,
mel

--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl - charts/graphs??

2001-09-17 Thread Mel Matsuoka

At 04:33 PM 09/17/2001 -0500, randy Peterman wrote:
open (BOOK, Programming Web Graphics with Perl and GNU software By Shawn P.
Wallace -published = O'reilly.) or die I don't have enough money;.

That book isn't bad, but it's sorely out of date, especially regarding the
chapter on charting and graphing with GIFGraph, which is deprecated.
GD::Graph is the way to go nowadays.

Martien Verbruggen is supposed to have a new Perl graphics book coming out,
but the publication date seems to keep getting pushed back.

Then you could search for PerlMagick, or the module on CPAN called GD.pm.


PerlMagick is way overkill for simple charting applications, but if you
need its power, it's there. GD::Graph works for most of my needs though,
however I have to admit that it has some annoying limitations (especially
text/label placement) that forces me to create my own GD drawing routines
to work around.

aloha,
mel

--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: securing sensitive information in CGI scripts

2001-09-04 Thread Mel Matsuoka

At 07:20 PM 09/04/2001 +0100, yahoo wrote:
Hi all,
I'd like to find out peoples opinion on the following.

If you have a perl cgi script which accesses a database, are there any
security issues with having the DBI connection details in the perl script
(rather than, say, an external file not in the document root - is this
better?)?

My general policy regarding things like this is, the more paranoid you are
, the better :)

Having password information embedded in a publicly accessible document such
as a CGI script is playing with fire, as far as I'm concerned. There may be
a time when you least expect it when someone (or you) screws up the
webserver config, and accidentally allows cgi-scripts to be sent out as
plaintext documents. Ouch.

That's why for all of my Perl and PHP scripts, I include the database
server connection details using an include file which is saved outside of
the webserver root. Of course, this isn't 100% secure, since anyone who has
local filesystem access to the server can still get at the information, but
then again, if someone has achieved that level of access, you have bigger
problems than worrying about your DBI include files and CGI scripts ;)

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: help - what is this?

2001-08-21 Thread Mel Matsuoka

At 04:05 PM 08/21/2001 -0400, Quang Bui wrote:
I know this is a perl mailing list, but HTML is somewhat related
since they're both used in web development.

Java, Python and C++ are all used in web development as well, but
questions about these technologies are very obviously off-topic here. As
such, your logic about HTML questions doesn't follow.

For HTML related questions, I would highly recommend the Webmonster
(formerly Lynda Weinman's) webdesign-l . http://www.webmonster.net

Aloha,
mel

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: dynamic table help

2001-08-20 Thread Mel Matsuoka

At 05:08 AM 08/20/2001 -0700, Keith  Rachel Murphy wrote:

Basically, I want to pull data from a database and display 
it in the form of a table, with a row in the table for 
each row from the database. What happens is each row from the 
database ends up as its own seperate table.  The current code 
portion is as follows: 

 (snip)
## fetch results and print

while ( my @row = $sth-fetchrow_array() ) {

($id, $first_name, $last_name, $phone_number, 
 $street_address, $city, $state, $zip, $email) = @row;

print center table ({-border=5},
Tr({-valign=CENTER},
[
td(['First Name', $first_name]),
td(['Last Name', $last_name]),
 (snip more td lines)
td(['E-Mail', $email]) 
]
));
print p;

}


This code does exactly as it's supposed to :)  What you want to do is put
your table method /outside/ of the while loop. Otherwise you're just
generating a new table for each fetchrow.

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: dynamic table help

2001-08-20 Thread Mel Matsuoka

At 05:08 AM 08/20/2001 -0700, Keith  Rachel Murphy wrote:
## fetch results and print

while ( my @row = $sth-fetchrow_array() ) {

($id,$first_name, $last_name, $phone_number, $street_address, $city,
$state, $zip, $email) = @row;
print center table ({-border=5},
Tr({-valign=CENTER},
[
td(['First Name', $first_name]),
td(['Last Name', $last_name]),
td(['Phone Number', $phone_number]),
td(['Street Address', $street_address]),
td(['City', $city]),
td(['State', $state]),
td(['Zip', $zip]),
td(['E-Mail', $email]) 
]
));
print p;

}


Also, on an unsolicited style/neatness noteI would use the
fetchrow_hashref method instead fetchrow_array. It eliminates the need to
load that temporary @row array, so you can just do something like this:

while ( my $hashref = $sth-fetchrow_hashref ) {

Tr({-valign='center'},
[
td( [ 'First Name', $hashref-{'Firstname') ] ),
td( [ 'Last Name', $hashref-{'Lastname') ] ),
td( [ 'Phone Number', $hashref-{'Phonenum') ] ),
 
]
));
print p;

...

Where the $hashref key is the original fieldname in your database. I find
this much easier to manage in my head than using temp arrays.

HTH...Aloha.

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: dynamic table help

2001-08-20 Thread Mel Matsuoka

At 02:41 AM 08/20/2001, Mel Matsuoka wrote:


td( [ 'First Name', $hashref-{'Firstname') ] ),
td( [ 'Last Name', $hashref-{'Lastname') ] ),
td( [ 'Phone Number', $hashref-{'Phonenum') ] ),

Of course that should read:

  td( [ 'First Name', $hashref-{'Firstname'} ] ),
  td( [ 'Last Name', $hashref-{'Lastname'} ] ),
  td( [ 'Phone Number', $hashref-{'Phonenum'} ] ),

i.e. closing braces around the hash key, instead of a parenthesis...

2:45 amits too damn early in the morning to be punctuating lucidly

mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Stumped over GD::Text strangeness....

2001-08-16 Thread Mel Matsuoka

I'm writing a CGI script that returns PNG graphs (using GD and GD::Graph)
based on database queries, and everything works great so far except for
this one annoying bug...

I have a subroutine which generates a text string on the GD canvas. You can
pass it an argument that sets the fontsize for the string to be printed.
This argument corresponds to key values in a hash which maps the argument
to a built-in GD font-name. 

The problem comes when I try to use the set_font() method, using values
returned from this hash. For some reason, I can't seem to use a variable as
the argument for this method, as it just prints the string using
gdSmallFont when I do it that way...yet when I hardcode the fontname into
the method, it works just as expected:

$align-set_font(gdGiantFont);# works
$align-set_font($fontsizes{$fontsize});  # doesn't

The wierd thing is that the method SHOULD be getting the correct value,
because, as you can see in my code below, the print statements I inserted
(for debugging purpose) both return the proper, expected values!

This is on a Linux box running Perl 5.005_03  GD::Text 0.80. What gives?
Any ideas?

Code sample followsThanks in advance!


GD_print_text('IMPROVEMENT PRIORITY FOR', 'left', 50, 20, 'giant');
GD_print_text('CLASSROOM SYSTEMS', 'left', 50, 38, 'giant');
GD_print_text('Hokulani Elementary', 'right', 650, 20, 'giant');
GD_print_text('School Year 2000-2001', 'right', 650, 38, 'giant');
GD_print_text('Results generated', 'center', 650, 70, 'small');
GD_print_text('Low', 'left', 167, 343);  # (note undef 5th arg)

sub GD_print_text {

my $textstring = $_[0];
my $alignment  = $_[1];
my $x  = $_[2];
my $y  = $_[3];

# set fontsize to gdSmallFont as default if no arg is passed.
my $fontsize   = !defined($_[4]) ? small : $_[4];

#print $fontsize;  # prints out expected value when uncommented!!!

my %fontsizes = ( tiny   = 'gdTinyFont',
  small  = 'gdSmallFont',
  mediumbold = 'gdMediumBoldFont',
  large  = 'gdLargeFont',
  giant  = 'gdGiantFont' );


my $align = GD::Text::Align-new($gd_image, 
 valign = 'top', 
 halign = 'left', 
 color  = $gd_black);
$align-set_text($textstring);
$align-set_halign($alignment);
$align-set_valign('top'); 
 # $align-set_font(gdGiantFont);  # works when value is hardcoded...
$align-set_font($fontsizes{$fontsize});  # but doesn't work when
it isnt.
$align-draw($x,$y); 

#print $fontsizes{$fontsize}; # yet this prints out the correct  expected 
 # value when uncommented!!!
}
---


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Graphing with PERL and HTML

2001-08-16 Thread Mel Matsuoka

At 08:51 AM 08/17/2001 +0930, Daniel Falkenberg wrote:
Dear list,

Has any one here worked with Perl and HTML to draw graphs on a web page?
Is there a module I can use to write these graphs.  I am im very
unfamilier ground here.  Any ideas or input would be greatly
appriciated.

Use GD::Graph.

http://search.cpan.org 

aloha,
mel
--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Image not coming in perl script while displaying n simple html with the same path..Why?

2001-08-09 Thread Mel Matsuoka

At 05:09 PM 08/09/2001 +0530, Rahul Garg wrote:
hello Everybody ,

In perl script code goes like this...
..
body
pIMG SRC=new.gif alt=sorry
/body
Its not running(image not shown)sorry is displayed ...but the complete
perl script except this is working very fine
if i run the same in simple html, image is shown.no path problem...

...is there anything that needs to be done in perl scripts to include
images..?

Generally, the only thing that can be accessed in a cgi-bin directory is
the cgi script itself. So if your images are housed in the cgi-bin
directory, your browser will not be allowed to access it, for security
reasons.

Save your images under the normal webserver document-root and reference
them in your HTML using relative or absolute paths.

Aloha,
mel



--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Check file permissions

2001-08-09 Thread Mel Matsuoka

At 03:47 PM 08/09/2001 -0500, Baartmans, Hans wrote:
Is there a module or command that returns the permissions of a file or
directory?

Thanks,
Hans


use the stat() function.

Aloha;
mel

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: NOT: very funny...

2001-08-08 Thread Mel Matsuoka
 with a smile is quite another...and I honestly don't
think he created these lists to serve as a venue for the latter.

Don't bother replying to the group on this subject, 


Too late, I just did ;)

rant mode off
Aloha,
mel



--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How to open a http or https url, as if it was a file

2001-08-08 Thread Mel Matsuoka

At 08:22 AM 08/08/2001 -0500, Camilo Gonzalez wrote:
Why not open the file itself? In other words, try:

open (FILE, 'somefile.html') or die Can't open HTML document $!;

I don't think you can open and search an entire site.  

I'm sure the O.P. wants to include the content of external webpages in a
CGI script, much like a standard SSI. So you couldn't just open() the URL
as if its a local file.

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl Editors

2001-08-08 Thread Mel Matsuoka

At 07:35 PM 08/08/2001 +0100, Joel Hughes wrote:
I've used ActiveStates Komodo editor which is nice  free


Not to start another editor religious-war, but Komodo, while being a great
idea on paper, just doesn't execute very well in real life (at least on
Windows2000). First off, the damn thing wants over 100 megabytes of
diskspace and consumes MASSIVE amounts of system resources while its
running. Very slow.

If Activestate can optimize Komodo so its faster and not so bloated, it
will definitely be a great option.

But for now, nothing on Windows can beat UltraEdit and PerlBuilder...at
least for me.

Aloha,
mel

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl Editors

2001-08-08 Thread Mel Matsuoka

At 02:59 PM 08/08/2001 -0700, Lynn Glessner wrote:
Ultra-Edit has a perl-specific mode (color coding, automatic indenting, the
normal) and has a killer save to FTP feature for doing your work on a
windows station and automatically saving to a Unix box.

Ultra-Edit has almost everything to recommend for a Perl programmer, except
for its lack of a subroutine navigator, which is the only reason why I
keep PerlBuilder around. But UE is truly a swiss-army chainsaw that does
almost every concievable thing, yet manages to keep a very low footprint as
far as system resources and diskspace are concerned--its amazing that this
thing loads up just as quickly as Notepad/Wordpad, considering everything
it does...in fact, its so good, I rarely use Emacs anymore! :)

All it needs now are built-in CVS support and a subroutine navigator, and
UE would be perfect.

And no, I dont have any financial interest in this company...im just an
enthusiastic user. :)

Aloha,
mel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Creating a hash

2001-08-08 Thread Mel Matsuoka

At 03:15 PM 08/08/2001 -0700, Sofia wrote:
I have the following hash of first names and last
names:

%hash = (
   joe = smith,
   jim = jones,
   sof = comes,
);

If for example, jim now has two last names ie jones
taylor, how do I represent that on the hash?

You'd basically want to create a hash of arrays.

So instead of having each key pointing to a single scalar value, you'd make
it so each key points to an anonymous array instead. So the hash would look
like this:

%hash = (
   joe = smith,
   jim = [jones, taylor],
   sof = comes,
);

Then youd access the values like this:

$hash{jim}[0] # returns jones
$hash{jim}[1]; # returns taylor

hope this helps. Aloha,
mel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: After I load Perl

2001-08-08 Thread Mel Matsuoka

At 08:29 AM 08/08/2001 -0600, Kent Mercer wrote:
How do I begin my first script?

And how do I save it ?

Something simple like Hello World

Just started 2 days ago 
Need pointed in the right direction

Check out the resources and FAQs located at http://www.perl.com 

Theres a plethora of information on how to get started 
also, the Tutorials section of http://www.perlmonks.org

hth..aloha
mel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: very funny...

2001-08-07 Thread Mel Matsuoka

At 09:08 AM 08/08/2001 +0530, Karthik Krishnamurthy wrote:
All of the experts you are talking about started 
out some time as clueless newbies too. They didn't 
become experts by asking questions, the answers to 
which they could find themselves. 

Good point.

I didn't post a single thing to a Perl mailing list or newsgroup until
about a year and a half /after/ I started learning Perl. The main reason
why I didn't post is simply because I didn't really have to, since
virtually every question or problem I had was solvable by searching the web
or Dejanews. There are very very few totally original problems that no
one has ever asked before, so chances are you'll find your answer
yourself...you just have to get off your ass and mke the initiative to find
and learn it for yourself first. Then after all your attempts, you are
truly stumped, that is the time to bug the experts ;) Thats what learning
and is all about.

This is why I have a big problem with most types of formal (esp. public)
education. Children are taught WHAT to learn, and not HOW to learn. In my
opinion, finding the right answer is nowhere near as important as the
process you took in order to arrive at that answer.

Aloha,
mel

--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: href in CGI

2001-08-06 Thread Mel Matsuoka

At 10:04 PM 08/05/2001 -1000, . wrote:
What is the syntax of the href method in CGI.pm?  I can't find it in the man
pages.  Is it something like this:

href([URL],[Additional Attributes],[Link Text | Link Image]);

The HREF is an attribute of the anchor (A) tag, ergo:

print a( {-href = 'http://www.foo.bar'}, 'Text to link' );

HTH..Aloha,
mel



--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Creating Hypertext Links

2001-08-05 Thread Mel Matsuoka

Crossposts edited to reply only to beginners-cgi

At 10:01 PM 08/04/2001 -1000, . wrote:
How do I create hypertext links using CGI code?


hypertext links are merely HTML code, so you would do the same thing that
you would normally do to print any other text to the browser window.

Use can also use the methods in the standard CGI.pm module to create hrefs,
but imho, the benefits of doing it that way aren't worth it, as far as
readbility and maintenance are concerned.

The documentaion for CGI.pm is at:
http://stein.cshl.org/WWW/software/CGI/

HTH..Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Displaying Graphics

2001-08-05 Thread Mel Matsuoka

At 11:07 PM 08/04/2001 -1000, . wrote:
Why won't the images appear when this script is run?  I can tell by looking
at the bottom of the browser that they are loading properly, and the access
log confirms it.   But they don't appear, and there's no listing in the
error log about it.  Is there something special I have to do to get it to
work?

img src=../420hawaii/images/p4p2.jpg%
   What's this for?^

Aloha,
mel








--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Displaying Graphics

2001-08-05 Thread Mel Matsuoka


At 11:07 PM 08/04/2001 -1000, . wrote:
Why won't the images appear when this script is run?  I can tell by looking
at the bottom of the browser that they are loading properly, and the access
log confirms it.  

Oh, and also, I also noticed that you don't have a closing TABLE tag, which
would definitely cause the problem you describe.

HTH...Aloha
mel

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Reading file line by line regardless of type of end-of-line?

2001-08-05 Thread Mel Matsuoka

At 07:11 AM 08/04/2001 -0700, Arthur Klassen wrote:
[EMAIL PROTECTED] wrote:
 
  Michael Fowler [EMAIL PROTECTED] said:
 
  You left out the Macintosh EOL sequence, LFCR, and I don't know
  what uses simply CR as EOL.
 
 Macs use just CR.  No machine that I know of uses LFCR as a line
 terminator.

I don't know this from experience, but I remember hearing that Amigas used
LFCR as their line terminator. It's a piece of trivia that's been
floating about in my brain now for about 12 years which I've never had
reason to test, discard or even care about. Is someone else in a position to
tell me the rights and wrongs of this?

Actually, the miggyOS was very Unix-like, and thus shared the same LF
line terminator. 

IIRC, I actually installed the Amiga port of Perl, but never got around to
using it (and /learning it) on that box...then again I never had a use for
it, since AOS had that cool built-in ARexx interprocess scripting language
(like Applescript).

Ah, I sort of miss the good ol' days of the Video Toaster on my A2000
(souped up with a BLAZING Zeus 68040/28Mhz accelerator, of course ;))

Aloha,
mel





--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: isEmail function

2001-08-05 Thread Mel Matsuoka

At 08:02 PM 08/05/2001 -0400, Brett wrote:
Quick question, I have this isEmail function below.  Should this cover
the basis for verifying an email address or am i missing an possibility?


# input : scalar
# output: true or false
sub isemail {
my($val) = shift(@_);
return 0 if (!defined($val));
return $val =~ /

^\w+(?:[\.-]?\w+)*@\w+(?:[\.-]?\w+)*(?:\.[a-zA-Z]{2,3}){1}$
  |
  ^\w+(?:[\.-]?\w+)*@(?:\d{1,3}\.){3}(?:\d{1,3}){1}$
   /x ? 1 : 0;
}

Validating email addresses using regexps is really a futile exercise. It's,
for all intents and purposes, impossible. Theres a regexp which was
published in Mastering Regular Expressions which apparantly is as close
as you can get, but the regexp itself is 6,859 bytes long!

Most of this is covered in perlfaq(9). A better, more workable alternative
would be to check for a valid MX record for the given domain name. 

Aloha,
mel

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: sending mail (learning perl program)

2001-07-30 Thread Mel Matsuoka

At 01:39 PM 07/30/2001 -0700, [EMAIL PROTECTED] wrote:
 Stephen P. Potter [EMAIL PROTECTED] said:

 | 
 |  open (MAIL, |/usr/sbin/sendmail $email)
 | 
 | to which you should by the way add
 | 
 |  or die sendmail: $!\n;
 
 This probably does not do what you think it does.  It is almost always
 worthless to check the status of a pipe.  The only time the pipe will fail

Not to mention the fact that that open() call is a bigass security
vulnerability waiting to be exploited. What if the user-supplied value of
$email was something like ;rm -rf .  ? Not good.

You should really be using sendmail with the -t flag to avoid shell
exploits like this. 

Aloha,
mel
--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Using Perl with Apache

2001-07-29 Thread Mel Matsuoka

At 03:14 PM 07/29/2001 -1000, . wrote:
I'm currently running a RedHat 7.1 box, with Perl 5.005 (I think), and
Apache webserver 1.3.12.

My problem is that, after having followed the directions for configuring
Apache to handle cgi scripts (from both www.apache.org and the httpd.conf
documentation), I get a 403:forbidden error when I try to run my scripts
from the browser.

I tried to chmod the cgi-bin directory and my scripts to , but it still
doesn't work.  (So, I don't think it's Linux blocking me.)

chmod'ing a file or directory to  basically denys ANY type of access to
/anyone/.

Try chmod'ing the directory so it has read/execute permissions.

Aloha,
mel




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: CGI to rewrite a URL

2001-07-27 Thread Mel Matsuoka

At 03:09 PM 07/27/2001 -0400, Rich Fernandez wrote:
Hi,

I've been asked to write a CGI script that takes a URL of the form:
   https://webserver/cgi-bin/myscript.cgi/myreport

and redirects the browser to:
   https://webserver/cgi-bin/myscript.cgi/full/path/to/report/myreport

In other words, we want to hide the true URL of the report from the browser.

Can anyone give me an idea about how to start this? Specifically, if I have
a script called myscript.cgi, how do I get it to recognize myreport as a
parameter? It's probably easy to do, but my experience with CGI is next to
nothing.

If you're using Apache (and you realy should if you aren't :)), you might
want to look into mod_rewrite.

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: book for newbee

2001-07-26 Thread Mel Matsuoka

At 02:30 PM 07/26/2001 -0700, [EMAIL PROTECTED] wrote:

Hello,

I am a newbee, I have the book below.
Is it okay to start with this book??

Perl and Cgi for the world wide web
by Elizabeth Castro.

NO

Pretty terrible book, obviously not written by an experienced Perl
programmer. Check out Ovid's review at
http://www.perlmonks.org/index.pl?node_id=21576lastnode_id=23304

Start with Randal Schwartz's Learning Perl or Andrew Johnson's Elements
of Programming with Perl (the latter is better if you dont have any
programming experience to begin with)

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: File notOpening.........why?

2001-07-25 Thread Mel Matsuoka

At 02:09 PM 07/25/2001 +0530, Rahul Garg wrote:

the same program i am running independently on telnet with command line
arguments , is running perfectlybut thru browser its not
working..the problem its giving is as follows  ..
 
the code goes like this :

# !usr/bin/perl -w
use CGI;
$query =new CGI ;
print Endoftext;
Content-type: text/html
html/html

You're not sending out a valid HTTP header. Either add two newlines after
the Content-type header, OR just use the CGI.pm 'header' function to print
the header for you. 

Since you've gone through the trouble of use-ing CGI.pm, you might as well
use its functions instead of printing the headers out yourself.

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: File notOpening.........why?

2001-07-25 Thread Mel Matsuoka

Oh and a few additional problems I caught:

At 02:09 PM 07/25/2001 +0530, Rahul Garg wrote:
the code goes like this :

# !usr/bin/perl -w
  ^--- This space shouldnt be here. This alone will 
   stop your script from running from the get-go.
(Unless of course you specify the perl interpreter
   directly from the commandline)
   

print Endoftext;
Content-type: text/html
html/html
Endoftext 

AFAIK, it's customary to use an uppercase name for Here-doc delimiter
strings. Otherwise it can be a bit confusing sometimes to see what
otherwise looks like a bareword in the middle of a big chunk of code.

$mailids = $query-param('mailid') ; 
for($mailids)
{
s/^\s//;
s/\s+$//;
}

This seems a bit strange to me...Why are you using a for loop on a single
parameter? Or does the 'mailid' parameter contain a list of values from a
radiobutton group or something?


 $file =/var/www/cgi-bin/cgirahul/cli.txt ;

Big problem. This code doesn't even compile! You need to put quotes around
the path, otherwise Perl thinks you're trying to do some sort of wierd
pattern-match or something and chokes.

$old = $file ;

This is kind of a useless use of a temp variable, imo. You can just use 
$file in the places where you are using $old, since nothing happens to
the $file variable once you initially set its value...Though I can
understand that you probably did this for clarity, since you created
similar variablenames such as $new and $bak. 

$new =$file.tmp.$$ ;

MAJOR syntax error. Where's the beginning quote?


printSH;  

This code will work, but you need to put a space between the print
statement and the string to be printed. This as it stands is pretty
unreadable.

open(OLD, $old) or die cant open $old: $!;
print HE ; # fine till here

This shouldn't be fine, because $old is a copy of $file, which shouldn't
have been assigned in the first place, since your script should have bombed
out with a syntax error back when you tried to load the path/file name into
the $file variable.


open(NEW, $new) or die cant open $new: $!;  ###not opening 

It's not opening because there is no $new at that point, because $new
depends on $file having been properly assigned, which it wasn't because of
the syntax error.


Waiting for Reply.
Thanx in Advance,
Rahul

You need to do some major /basic/ debugging of this code. 

A few tips:

1. ALWAYS 'use strict'. This will force you to adhere to good programming
standards, and will help you prevent writing buggy code in the first place.

2. Don't use global variables! Use my to set the scope of all your
variables, for example:

my $mailids;
$mailids = $query-param('mailid'); 

Or, to be more succinct:

my $mailids = $query-param('mailid'); 

3. Test your code before posting to the list. Your code has numerous
*basic* syntax errors that you should have seen if you tried to run the
script from the commandline. There are places in the code where you say
fine till here, but in reality, it shouldn't have been fine at all,
because you would have seen the syntax errors pop up.

HTH. Aloha,
mel




--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Which perl book is the best for a newbie?

2001-07-25 Thread Mel Matsuoka

At 04:41 PM 07/25/2001 +0900, Super Newbie wrote:
Which Perl book is the best for a newbie? Any recommendation?


Elements of Programming with Perl from Andrew Johnson.

Learning Perl by Randal Schwartz.

Both books rock. 

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Linux commands in perl

2001-07-25 Thread Mel Matsuoka

At 05:13 PM 07/25/2001 +0530, KK wrote:
Hello Alessandro Lenzen -

I tried that. The perl script with the adduser command is getting executed
if I execute it from the command prompt when I am logged in as root, but
the same script script doesn't get executed from the browser. The web server
error_log file doesn't show any error description. Following is a sample
perl script:

adduser requires root priviledges, which your webserver does not have. 

Personally, I think that running root programs like adduser (or anything
else that messes with the passwd file) via a CGI script is way too freaky
to recommend in practice. It would probably require running your script
setuid root, which is doubly freaky.

Off the top of my head, perhaps a more secure method would be to have your
CGI script serve as a wrapper to pass username/passwd data to another
script (which has root or sudo root execute permissions) which is located
outside the webserver/cgi root that actually performs the adduser functions. 

Theres also a bunch of passwd authentication and manipulation modules on
CPAN too, but I haven't had any real world experience with them so I
couldnt attest to thier security.

HTH, aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Linux commands in perl

2001-07-25 Thread Mel Matsuoka

At 01:33 AM 07/25/2001, Mel Matsuoka wrote:

Off the top of my head, perhaps a more secure method would be to have your
CGI script serve as a wrapper to pass username/passwd data to another
script (which has root or sudo root execute permissions) which is located
outside the webserver/cgi root that actually performs the adduser functions.

I should have also mentioned that your wrapper script should perform
sanity-checks-from-hell before it ever even gets close to the adduser script.

Needless to say, being that this is a beginners list, I would have to say
that this is probably not the most recommended application to be learning
Perl on ;)

Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Whole Script, global symbol?

2001-07-25 Thread Mel Matsuoka

At 01:35 PM 07/25/2001 -0700, David Freeman wrote:


I modified the script to reflect what was suggested to me earlier, and now 
when i run it, i receive errors telling me i'm missing something at line 11 
regarding global symbols for my variables?

#!/usr/bin/perl -w
#Script to add e-mail address or domain name to /etc/mail/access file
#if it was not already listed.

use strict;
#use warnings;


open(NAMES,/etc/mail/access) || die Can't open access: $!\n;
while (NAMES){
 ( $email, $action )= split(/\t/);

You need to declare your variable scope using 'my'. The strict pragma
spanks you if you use global variables without specifically intending it:

my($email, action)

Aloha,
mel
--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: basename ?

2001-07-24 Thread Mel Matsuoka

At 01:48 PM 07/24/2001 -0500, Mooney Christophe-CMOONEY1 wrote:
Why not just use a regex?

($basename)=$file_string=~m!([^/]+)$!;

Why not just use File::Basename? ;)

Aloha,
mel



--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: e-mailing HTML form results

2001-07-20 Thread Mel Matsuoka

At 07:57 AM 07/20/2001 -0400, Helen Dickey wrote:
Thank you so far.  I now get
(myfile).pl has too many errors. when I try my perl script.
Is there any debugging tool for perl scripts?

perldoc perldebug

Aloha,
mel

--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Do I use fork() for this?

2001-07-19 Thread Mel Matsuoka

At 09:52 AM 07/19/2001 -0700, Randal L. Schwartz wrote:

Type search in progress into
http://www.stonehenge.com/perl/googlecolumnsearch
and see the column I've already written on it.

In fact, keep that URL bookmarked, because anytime you have *any* Perl
problem, I've probably already written a column on it. :)   ^

I typed in Impressing hot chicks using obfuscated perl one-liners and
didn't get any results from your search engine. Will you be writing a
WebTechniques column about this important topic in the near future?

Thank you for your help.


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: error info...

2001-07-19 Thread Mel Matsuoka

At 02:54 PM 07/19/2001 -0400, bc wrote:
does anyone know of a site that lets you use free space to 
learn perl/cgi?  my current one, netfirms, does, but when 
i get errors, all it prints to the browser is it could be a 
programing error or a syntax error   I used to use VBScript, 
and it, when you did an error, it at least told the line # 
that i thinks the error is on?


Use CGI::Carp qw/fatalsToBrowser/



--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: error info...

2001-07-19 Thread Mel Matsuoka

At 05:13 PM 07/19/2001 -0400, bc wrote: 
if i use wordpad, in windows, instead of 
notepad, which i was told b/c of this reason, 
what do i save the script file as:  the 
choices are:

Arghwhoever told you to use Wordpad without qualifying the RIGHT way to
save out of Wordpad needs to be flogged with a herring :P

My guess is that you've been saving your scripts out as RTF format, or one
of the other non-ASCII fileformats listed in the Wordpad save dialog. Use
Notepad instead...

Or better yet, if you're using windows, get yourself a real text-editor
such as UltraEdit (http://www.ultraedit), which will make your coding life
so much better. Notepad is good for writing hello world-level scripts, but
in order to manage real programs and scripts, you need to have something
more robust.

Aloha,
mel



--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: error info...

2001-07-19 Thread Mel Matsuoka

At 05:17 PM 07/19/2001 -0400, bc wrote:
here is the error:

Execution of customgame.pl aborted due to compilation errors.


Have you tried to run your script from the commandline using -w and 'use
strict' ?

I just did, and it spewed back a ton of syntax errors and other
strict-related problems.

I can tell you one thing though, elseif is NOT elsif ;)

Try it for yourself and see what you come up with.

aloha,
mel 

--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Perl editors (WAS: Re: error info...)

2001-07-19 Thread Mel Matsuoka

At 05:32 PM 07/19/2001 -0400, Brett W. McCoy wrote:
 Better yet, get a programming editor like
UltraEdit, emacs, Komodo, etc -- they are designed especially for
programmers and have lots of nice little bells and whistles to help you,
like color sytax highlighting, online help, debugging, compiling, etc.

I also really like Perl Builder, from Solutionsoft. It's probably the only
decent Perl-specific editor available AFAIK. I don't really find syntax
highlighting all that useful, but its subroutine navigator is SO helpful.
Just put your cursor over any subroutine call, press Ctrl-D, and the cursor
takes you to the actual subroutine. It also works in reverse as well.
Incredibly timesaving feature, that I've never seen in any other editor
(except for DZsoft's perl editor, whose subroutine navigator only /barely/
works, if at all...though I like the tree view of subroutines it has. In
Perl Builder, you have to call up a seperate popup window to get a list of
subroutines)

Aloha,
mel
--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: error info...

2001-07-19 Thread Mel Matsuoka

At 05:36 PM 07/19/2001 -0400, bc wrote:
now this???

Can't find string terminator end_of_page 
anywhere before EOF at customgame.pl line 27. 

Here-doc syntax is very touchy. The problem is that your heredoc terminator
string is NOT on a line by itself. This means any whitespace after the
terminator string as well.

Make sure that your heredoc terminator is the ONLY thing on that line.

HTH. Aloha
mel

--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: error info...

2001-07-19 Thread Mel Matsuoka

quoting of replies reformatted

I wrote:
 At 05:36 PM 07/19/2001 -0400, bc wrote:
 now this???
 
 Can't find string terminator end_of_page
 anywhere before EOF at customgame.pl line 27.

 Here-doc syntax is very touchy. The problem is that your heredoc
terminator
 string is NOT on a line by itself. This means any whitespace after the
 terminator string as well.

 Make sure that your heredoc terminator is the ONLY thing on that line.

And at 05:41 PM 07/19/2001 -0400, bc wrote:
i though it was?

I guess the one exception to the heredoc terminator rule is that it must
end with a newline, if im not mistaken. Since the terminator in question
appears at the very end of your script, i'll bet dollars to dougnuts that
you didnt add a newline at the end of the end_of_page terminator.

btw, try not to post responses in jeopardy style (aka top posting)...it
makes quoting and followups very disjointed and hard to follow...not to
mention a PITA to reformat :)

Aloha,
mel

--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: stupid question

2001-07-19 Thread Mel Matsuoka

At 11:53 PM 07/19/2001 -0400, Tom Malone wrote:
I know this is a simple, stupid question, but i can't seem to find the
answer. I've never used Perl before - only PHP. NOt very familiar with unix
either...
I'm trying to get this hello world script to work - I have the shebang -
#!/usr/bin/perl at the beginning of the file, and verified with my host that
it is the correct path. The host said to put the file in my cgi-bin, which i
also did, and i chmoded it to 755, which was also a direction from my host.
I tried naming it hworld.pl and hworld.cgi, but i still get this stupid 500
internal server error and can't figure out why.

The script is very simple:

#!/usr/bin/perl
print Hello World!\n;


You need to send valid HTTP headers before the output of your script. The
best way to do this is by using the CGI.pm module and calling the 'header'
method. You can manually set the header yourself by doing a print
Content-type:foo/bar, but you're better off using CGI.pm, as it will
eliminate any potential mistakes you might make in setting the headers
yourself

e.g.,

#!/usr/bin/perl -w

use CGI;
use strict;

my $q = new CGI;
print $q-header;
print Hello World!\n;


Also remember to ALWAYS use strict and -w, no matter how trivial the script.

HTH..aloha,
mel
--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Apache and cgi-bin directory - Redhat 7.1

2001-07-17 Thread Mel Matsuoka

At 05:15 PM 07/16/2001 -0400, you wrote:
I have apache set up on a Linux machine running Redhat 7.1 (local home
network).  The install (from rpm) placed the directories as follows:

/var/www/html
/var/www/cgi-bin
/var/www/icons

I can point a browser to 192.168.xxx.xxx and I am taken to the /var/www/html
directory and the file index.html is displayed showing that the apache
install went ok.  I can replace that index.html file with another (or edit
the original) to include a link to a script in the cgi-bin directory which
is executed with the URL shown as
http://192.168.xxx.xxx/cgi-bin/perlfile.cgi.

However I can't point the browser to http://192.168.xxx.xxx//cgi-bin
directly to execute a script.

Any idea what is going on I appear to have the same permissions in both
directories.

I have to say i'm a bit surprised that you haven't received the right
answer to this question yet :P

This is almost certainly an Apache configuration issue, specifically with
the ScriptAlias directive in your httpd.conf file. IIRC, with recent
versions of Apache, you must *explicitly* configure the httpd to allow
ExecCGI (for security reasons).

This is covered very well in the Apache server docs/faq at
http://httpd.apache.org/

HTH...Aloha,
mel


--
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Copy and past HTML into a perl script

2001-07-13 Thread Mel Matsuoka

At 03:16 PM 07/13/2001 -0500, Camilo Gonzalez wrote:
Yes it does, thank you. I'm afraid I'll have to disagree with you. My
Programming Perl book tells me otherwise. I still consider myself a newbie,
however and welcome other comments.

Don't disagree without first trying it for yourself.

As several others have already mentioned... 

print ( 'The rain in $Spain' );
print ( 'The rain in $Spain' );

...returns the following strings, respectively:

The rain in $Spain
The rain in $Spain

This is on both Activestate Perl 5.6.1 on windows2000 and Perl on my
Mandrake Linux box.






--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Nasty

2001-07-13 Thread Mel Matsuoka

At 03:45 PM 07/13/2001 -0500, Camilo Gonzalez wrote:
I don't work with a lot of programmers. I hope to get into a situation where
I do. Is it fair to say the majority are *holes?

A LOT of them are (just read c.l.p.m ;), but thier saving grace is that you
can learn a LOT from them if you don't take thier impatience and terseness
personally. It seems that one of the downsides to being a knowledgable
programmer is that you constantly have scads of grasshoppers constantly
asking you how to do this or how to do that, when they should be trying to
figure it out for themselves first. 

Even gurus like Randal can get pretty testy sometimes (and rightfully so),
but I'd like to think that for the most part, this doesn't reflect thier
general personality on the whole. In fact I've met Randal in real life
(at the CNET Builder.com Live! '98 conference in New Orleans..I'm sure you
don't remember, Randal ;)), and he is really a cool guy.

Basically, have fun, and don't take things personally. Remember that
impatience is one of the three great virtues of a programmer that Larry
Wall speaks of :)

Aloha,
mel

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Nasty

2001-07-13 Thread Mel Matsuoka

At 10:34 PM 07/13/2001 -0400, fliptop wrote:
Curtis Poe wrote:
 
 There are other reasons, too.  Just today, I was asked to break 
 a version of a Web site we were about to publically release.  
 It took me 5 minutes to find a security hole and demonstrate 
 that I could execute any arbitrary SQL against our database by 
 passing it through the URL (it's easier than one might think 
 for many sites).  Fortunately, that stopped this code from 
 moving out, but the programmer who wrote the code explained 
 that hackers would first have to know the names of the tables 
 they were affecting and thus, things were secure.

that sounds more like an excuse than an explanation.

Let there be one mantra that ALL programmers must repeat to themselves over
and over again until they go insane:

Security through obscurity is NO security at all

Aloha,
mel
--
mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: pop3 account

2001-07-11 Thread Mel Matsuoka

At 12:28 PM 07/11/2001 +0200, Greg wrote:
Hi,
I want to make an automatic script e add/delete users pop3 account ...
Does anyone have suggestions to help me out ?

Check out your best friend, CPAN.

http://search.cpan.org/Catalog/Mail_and_Usenet_News/

Aloha,
mel



__
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040



RE: dropping off a few decimal points

2001-07-10 Thread Mel Matsuoka

At 04:11 PM 07/10/2001 -0400, Moon, John wrote:
One way to do it ...

 perl -e '$x=1234.5678; ($y)=$x=~/(\d*\.{0,1}\d{0,2})/;print $y .\n;' 

heh...that was pretty close to perl bowling ;-)

Don't do wierd contrortions with regexps when theres a simple built-in
function to pull off the same results. Use sprintf:

print sprintf %.2f, $number;

Aloha,
mel



__
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040



Re: The binary file as CGI output

2001-07-10 Thread Mel Matsuoka

At 05:51 AM 07/10/2001 +0200, Evgeny Goldin (aka Genie) wrote:

  Hello,

 My goal is following : after user accesses http://host/script.pl ( either
 by direct link or by submitting the filled form ) I'd like to open a
 Save as dialog - to let him download a binary ( compressed ) file.

 1) print header( application/x-gzip );
open ( FIN, TXTs.tar.gz );
binmode FIN;
print FIN;
 
works, but the file is going to be saved under script.gz name
instead of
original TXTs.tar.gz - how can I specify the original name ?

Try setting a Content-disposition: filename=filename.gz http header.

Also, I've had better luck using the application/octet-stream
Content-type header instead. I have a secure download script which
basically streams binary data off the webserver root and allows the user to
download it. The headers I set look like this (where $fs is the filesize of
the data to be sent): 

Content-Type: application/octet-stream
Accept-Ranges: bytes
Content-Length: $fs
Content-disposition: filename=downloaded.mp3

hth...aloha!

mel



mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 



Re-inventing wheels (WAS re: Required Fields Module)

2001-07-10 Thread Mel Matsuoka

At 09:22 AM 07/10/2001 -0600, Ken Scott wrote:

But a wheel is just a wheel. Why not use the one that exists, and leave
your mental energy and talent available to solve your real problem at
hand?

I often ponder this subject, especially after reading c.l.p.m.

Without question, perl (or general programming) newbies need to learn and
adhere to certain established defacto standards, ESPECIALLY when dealing
with CGI. You wouldn't let your 4 year old child attempt a triple-bypass
operation on your own heart without spending at least a year in medical
school, after all :)

But in all my years of reading c.l.p.m., it seems like it's impossible to
/not/ get flamed or rebuked for trying to figure out the internals of
functions that existing perl modules implement. From a programming and
educational standpoint, I would think that it's a *good* thing to try and
implement your own routines, even if there's a perl module that already
does it in a simple and efficient manner. 

In all likelihood, you will end up writing something that breaks, or is
altogether completely redundant. But *attempting it* in the first place is
the cornerstone of good hacker ethic, IMHO, and can only help a person in
becoming a better overall programmer (with the proper guidance, of course).
 After all, SOMEONE has to write these de facto modules in the first
place!  

Of course, you would be a fool to implement hand-rolled routines (such as
CGI param parsing) in production code...I would never suggest that people
eschew the use of well-established modules when they exist. But, even
though I like to think that I am in-tune with the philosophy of Perl
culture, it just seems wierd to me that there is this cargo-cult type of
mentality that discourages Perl programmers from figuring out for
themselves the magic that happens behind the scenes. They are just told
to rely on such-and-such module, and leave it at that. 

While I am an adamant proponent of not re-inventing the wheel when you just
need to get the damn job done and out the door, if this mentality was
religiously adhered to by upcoming Perl programmers, I would think that it
would hinder thier potential for guru-hood, simply because they've learned
to just wait for miraculous .pm's to fall from the sky and onto their code,
instead of DIY'ing it. They would never learn about the ugly internals of
/anything/, and hence would probably never end up writing any modules that
would benefit the entire Perl community as a whole.

That being said, I /do/ think that on a list like this, which is
specifically geared towards perl novices, it does a great disservice to
show hand-rolled functions that are otherwise better left to existing perl
modules. All of my comments are with the understanding that a certain level
of experience with Perl and general programming has been achieved.
Beginners should be spending thier time perfecting the fundamentals of the
language itself before trying to re-invent wheels that have already been
inventedor patented for that matter (see
http://www.theage.com.au/news/state/2001/07/02/FFX0ADFPLOC.html )

just my unsolicited $.02. I would love to hear any comments or
disagreements about this, since I've been meaning to present this issue to
c.l.p.m for years, yet never got around to it :P

just another wannabe perl hacker on lunch break,
mel

mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 



Re: Re-inventing wheels (WAS re: Required Fields Module)

2001-07-10 Thread Mel Matsuoka

At 03:58 PM 07/10/2001 -0700, Randal L. Schwartz wrote:

Please note that CGI.pm is a special case.

Too many books show bad handrolled code.

Too many downloads have bad handrolled code.

This I couldn't agree with more. It is definitely apropos (and an
obligation) to compel someone to use CGI.pm when it's obvious that they are
a C.P.P. (cut-and-paste-programmer :)


Most people using this code are not programmers trying to invent
better code to handle the CGI protocol, but are just trying to get
interactivity into their web pages.

Code that was being handrolled for personal use almost always ends up
being shared, starting Yet Another bad implementation into the meme
pool.

Doing the CGI protocol *wrong* means it'll break or open a security
hole for some combination of browser, server, upload, language, form
value, or whatever that the person didn't test.

Lincoln Stein has been yelled at enough to get it right, in a very
portable way.

All excellent points.  

So, for CGI.pm, we have an especially itchy trigger finger to say DO
NOT DO THAT.
If you can show me where else that happens, I can probably show you a
similar story.  But I don't think you'll find many other examples.

Now that I think about it, you're right. Most of the spankings have been
in reference to some CGI related issue where the original poster should
have just been using CGI.pm. 


I think i'll go crawl back into my philosophical hole now :)





mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 



Re: If I could get just one Perl Book what should it be?

2001-06-25 Thread Mel Matsuoka

At 10:03 AM 06/25/2001 -0400, Brian Jackson [EMAIL PROTECTED] wrote:
To all,

I have programmed in C, Fortran, C++, Java, Awk, Korn Shell, but  I am
new to Perl.   I already have a few quick reference documentation for
Perl in a Linux in a nutshell book.   I have money to buy just one Perl
book.   What is the best one book that I can get to teach me Perl??


I'll chime in with another enthusiastic recommendation of Randal's book,
Learning Perl (aka Llama book). If you already have basic programming
fundamentals under your belt, this book will really help bring you up to
speed with Perl in no time at all. I was frankly shocked how well this book
worked for me, especially after plunking down tons of money on other really
lame Perl books such as Perl 5 for dummies and 2 of Selena Sol's horrible
Perl/CGI books (heh...I didn't know any better at the time!)

Another book which i like is the Perl Black Book. I know /many/
experienced perl-tistas would disagree with me, but I actually like it's
Problem-Solution approach to presenting perl functions. Though I would
like to find out where the technical flaws are in this book from some of
the more enlightened Perl reviewers.

I also think the O'reilly Perl Cookbook is fabulous too (in the same vein
as the Black Book).

I know you only asked for one book, but I don't believe there is such a
thing as THE book for learning perl matters :)

Aloha, 
mel



__
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040



RE: If I could get just one Perl Book what should it be?

2001-06-25 Thread Mel Matsuoka

At 09:13 AM 06/25/2001 -0500, Kris Cook wrote:
Well, if you have the money for just one book, I'd order two from
Bookpool.com for about the same price ;) 

Bookpool definitely rocks! Thier prices are outstanding! Definitely blows
Amazon out of the water...Though I definitely lucked out on buying a User
Friendly comicstrip book on Amazon the other day for only $3.88! 

Aloha,
mel



__
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040



Re: Re: Running CGI's locally

2001-06-21 Thread Mel Matsuoka

At 12:10 PM 06/20/2001 +0200, Aaron Craig wrote:

At the office, I'm running Apache 1.3 locally on Win2000, and I don't have 
to use the shebang line, as I have Perl in my path.  However, I just 
installed Apache on my Win2000 machine at home, using the current Apache 
installation for Windows (ends with an .msi extension) found on 
www.apache.org.  Now, I need to use the shebang line, using Windows style 
paths (ie C:/perl/perl.exe).  I vaguely remember adding a registry entry by 
hand to get Apache running Perl on my Win2000 here in the office, which I 
didn't do on my computer at home.  Is that what I'm missing, or has Apache 
changed and now requires the shebang line on Windows as well.

Thw Win32 port of apache has the ScriptInterpreterSource directive which
you must uncomment in the httpd.conf file in order for it to ignore the
shebang lines and use the file associations set in the windows registry.

This is such a great convinience for developing perl scripts on a windows
box that have to be deployed on a unix box. I cant tell you how many times
I've torn my hair out, debugging and trying to figure out why my win32
developed scripts bomb out on my unix boxen...when the problem was just
that I forgot to change the shebang line to point to the unix perl path!

Aloha,
mel



__
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040



Re: Extra INPUT TYPE=hidden NAME=.cgifields VALUE=ACTION ?

2001-06-21 Thread Mel Matsuoka

At 04:21 PM 06/21/2001 -0400, Timothy Kimball wrote:

Randal L. Schwartz wrote:
: ...
: Second might mean something like:
: 
: $foo_length = SOME_LIST # although this can't happen
:   = list
: =   assigned to
: === scalar
: 
: See the difference?  And the latter can't happen.

Sure it can. Well, the list itself doesn't get assigned to the scalar,
but an assignment does get made: The last element of SOME_LIST to
$foo_length. So

my $number_of_pets = ('dog','cat','iguana');

sets $number_of_pets to 'iguana'.


Methinks you actually /validated/ Randal's post, not contradicted it ;)

Randal said:
Ahh, there's HUGE difference between

list assignment _in_ scalar context

and

list assigned _to_ [a scalar]

So your example would fit in the list assignment _in_ scalar context
category...the keyword being assignMENT, and not assignED

aloha,
mel



mel matsuoka  Hawaiian Image Productions
Chief Executive Alphageek(vox)1.808.531.5474
[EMAIL PROTECTED](fax)1.808.526.4040
 



Re: converting MS access DB to mysql

2001-06-19 Thread Mel Matsuoka

At 01:07 AM 06/19/2001 +0100, you wrote:
i have an Ms Access DB and need to use it on a linux web server !! 

does anyone know how i can go about converting it to Mysql or suchlike ??
as it is quite large. !!


I have used a Access module called exportsql, which you can get  at
http://www.cynergi.net/exportsql/, with great success. It tries as best as
it can to preserve your Access97 table relations, and for the most part
does a decent job. It converts the data and fieldtypes pretty damn
accurately. But you should still check its results by hand before yo go
live with the MySQL database, as theres really no such thing as a
transparent database conversion.

The export to CSV route works too, but for a database with a lot of tables,
it would seem to be an unwieldly pain in the butt.

Theres also something called DBTools, at http://dbtools.vila.bol.com.br/,
which looks promising, but I've never used it so I cant comment on its
worthiness. 

I also noticed something called MyAccess, which actually looks like the
best of the bunch, if it works as it claims. http://www.accessmysql.com/ 

Hope this helps!

Aloha,
mel



__
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040



Re: Telnet

2001-06-14 Thread Mel Matsuoka

At 01:59 PM 06/14/2001 -0400, Brett W. McCoy wrote:


PuTTY is another decent Telent/SSH client, and provides a lot of decent
xterm functionality, including mouse clipbaord support.


Let me chime in to endorse PuTTY as well. It's a fantastic, fast and free
(with no strings attached) telnet/ssh client. One of the great things about
it is that it's a small standalone executable, so theres no installer
that throws goofy .dlls and crap all over your hard drive. I just drop it
into my main Windows folder so I can get at it from any DOS window.

You can download it from http://www.chiark.greenend.org.uk/~sgtatham/putty/

IMO, telnet *should* be considered defunct, except when using it for
debugging and diagnostic purposes (i.e. telnetting directly to service
ports). If you (or your server admin) aren't using SSH, it's about high
time that you should, for security's sake.

Aloha,
mel

__
mel matsuokaHawaiian Image Productions
Chief Executive Alphageek  (vox)1.808.531.5474
[EMAIL PROTECTED]  (fax)1.808.526.4040