Re: Call to a function is a seperate file

2003-08-25 Thread Kristofer Hoch
For what it is worth, I highly recommend this book. I just bought it this past saturday, and I love it. It is written as if it was designed to a student/instructer. (Props to Randal, and Tom) Kristofer --- drieux [EMAIL PROTECTED] wrote: On Monday, Aug 25, 2003, at 09:30 US/Pacific, Jattie

Re: create log as well as print on screen

2003-08-20 Thread Kristofer Hoch
sub Log{ my $message = shift(); my $LOGNAME = 'log.log'; open(LOGFILE, $LOGNAME) or die(Could not open log file: $!); print LOGFILE $message; close(LOGFILE); } sub Print{ my message = shift(); #Assuming you are passing a string my $Out = *STDOUT; # Standard out. print $Out

Re: Why executable?

2003-08-14 Thread Kristofer Hoch
You should never be able to guess the implementation language by looking at a URL. Wrong. Wrong. I couldn't agree more. None of my scripts are executed directly...IE there is not script called 'index.pl'. Alternatly, I use HTML::Mason for dynamic web content. The Mason handler calls the

Re: Why executable?

2003-08-11 Thread Kristofer Hoch
This is what I do for security on my webserver. I don't have the shebang line in my scripts. The webserver has a list of approved perl script extensions. When it runs across a file with this extension, the web server executes it with perl. Otherwise, it treats the file as if it is text/html.

Re: Escaping

2003-08-08 Thread Kristofer Hoch
Marcus, You are going to have to URL escape it. Review URI::Escape... http://theoryx5.uwinnipeg.ca/CPAN/data/URI/URI/Escape.html Thanks, Kristofer = -BEGIN GEEK CODE BLOCK- Version: 3.12 GIT d s+:++ a C++ UL++ US+ P+++ L++ W+++ w PS PE t++ b+ G e r+++ z --END GEEK CODE

Re: Mail::Send question

2003-08-04 Thread Kristofer Hoch
Fine, go get the SendMail book, rent a truck to bring it home in, A very large truck, OR the Abridged version. The box said 'Windows XP or better' so I chose Mac OS X. Must have been a trick requirement. Nearly everything is better. = -BEGIN GEEK CODE BLOCK- Version: 3.12 GIT d

Re: Variable $q will not stay shared at

2003-07-17 Thread Kristofer Hoch
B, Please post the entire code base of envir.pl. Feel free to obfuscate any data that it requires. I cannot get the code you posted to fail. There is something amiss, and we need to see the code to help. Kristofer. --- B. Fongo [EMAIL PROTECTED] wrote: Hello, I'm working on my first

Re: Script's Name

2003-07-17 Thread Kristofer Hoch
--- Nigel Peck - MIS Web Design [EMAIL PROTECTED] wrote: Can someone please remind a forgetful idiot how to get the name of the script being run (the file itself)? Cheers, Nigel MIS Web Design http://www.miswebdesign.com/ print Full File name: $0\n; Forgetfulness does not

Re: look arounds

2003-07-06 Thread Kristofer Hoch
Mark, I get this... color = brown, animal = fox --- mark sony [EMAIL PROTECTED] wrote: Hi All, Can anyone plz explain to me why this one is not working : $_ = The brown fox jumps over the lazy dog; /the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal = $^N })/i; print color =

Re: Clearing Printers w/CGI

2003-06-26 Thread Kristofer Hoch
Rob, The problem is in the permissions of the user id that is running the script, not the owner of the script. In this case, your webserver is the person running the script. So more than likely, you should use 'clearpq.cgi' to kick off a different script 'clearpl.pl' as ROOT. The script

Re: slash question

2003-06-25 Thread Kristofer Hoch
Susan, Since everything you wrote only contains forward slashes ('/'), I am a bit confused as to what you are trying to do. Are you trying to convert the forward slashes to back slashes ('\')? $dir =~ s!//!\\!g; Please clarify what you are trying to do:( Kristofer --- Susan Aurand

Re: cgi.pm popup menus

2003-06-17 Thread Kristofer Hoch
: On Tuesday, June 17, 2003, at 04:21 PM, Kristofer Hoch wrote: Here you assign element[0] of @_ to $selectName. Then you assign all remaining elements (indexes 1 through infinity) to @selectValues. @selectValues slurps up all remaining elements of @_ leaving poor little $selection

RE: Subroutine Syntax

2003-06-15 Thread Kristofer Hoch
David, I the reason this worked for Scot and not you is something that is both simple and EASILY OVERLOOKED. Consider the lines. #Scot if ($_ == 1) { ^^--- Scot is using a comparison operator #David if ($_[0]=1) { ^-- You are using an assignment operator. So in

Re: Question about regexing/splitting results into array

2003-06-12 Thread Kristofer Hoch
split /p align=\center\/, $_ instead of matching p (space) a,l,i,g,n,=, \,c,e,n,t,e,r\ embrace it in parenthesis...no escaping neccessary... split /(p align=center)/, $_ At least I think that I am reading this book properlyh --- Scot Robnett [EMAIL PROTECTED] wrote: I was wondering

Re: Inserting data into MySql using perl script

2003-06-10 Thread Kristofer Hoch
David, Try something a bit different === use DBI; # Added: This will probably break you in lots of places, # but use strict is worth it. use strict; # Strict on $infile my $infile = /cadfs8/sys/dnazary/mysql_test_data1; # Strict on $dbh my $dbh =

Re: Targeting two frames from one CGI

2003-06-08 Thread Kristofer Hoch
The answer to this one may seem a bit simplistic, but bear with me please. The 'main' frame should be a cgi script that does not ever change. You want the behaviour of this frame to change by passing parameters. The main file could be named main.pl and accept parameters such as doLogin if they

Re: More subroutine confusion

2003-06-08 Thread Kristofer Hoch
Rob, Have you considered useing the object oriented method? It is a little bit more complicated, BUT it will work. use strict; use warnings use CGI; my $CgiObject = new CGI; my $STRING = There are not any trains running on thi day.brUse the date dropdowns above to select adifferent day.; my

Re: Getting my head round hashes

2003-06-06 Thread Kristofer Hoch
David, You don't have a response set at execute. You have a reference to a responce set. You need to use DBI methods to access the results. Try this... $response-execute(); my $hash = {}; while (my $rows = $response-fetchrow_hashref){

Re: Difference of $hash, and %hash. (was Getting my head round hashes)

2003-06-06 Thread Kristofer Hoch
got the hang of the logic yet. Dave On Thursday, June 5, 2003, at 07:25 pm, Kristofer Hoch wrote: David, You don't have a response set at execute. You have a reference to a responce set. You need to use DBI methods to access the results. Try

Re: Difference of $hash, and %hash. (was Getting my head round hashes)

2003-06-06 Thread Kristofer Hoch
This is possibly the best answer. I won't give any other. --- drieux [EMAIL PROTECTED] wrote: On Thursday, Jun 5, 2003, at 13:07 US/Pacific, Andrew Brosnan wrote: [..] my $hash = {}; while (my $rows = $response-fetchrow_hashref){ $hash-{$rows-{task_ID}} = $rows; } Why is

Re: function/module to check if visitors have their cookies enabled

2003-06-06 Thread Kristofer Hoch
What sometimes helps me is this... Add a domain. -domain = '.some.com', --- Ahrent [EMAIL PROTECTED] wrote: Hi I’m looking for a function/module to check if visitors have their cookies enabled when they come to my site. I think that there might all-ready might be a module for this, but I

RE: DBI indexing question

2003-06-04 Thread Kristofer Hoch
CURDATE() has to be selected SELECT(CURDATE()); --- Bob Showalter [EMAIL PROTECTED] wrote: Greenhalgh David wrote: ... Second question. If I use the following: my $query=CURDATE(); my $sth-prepare($query); $sth-execute; I understand that $sth now just contains the reference to

Re: Extract numbers from in between parentheses with regex

2002-06-27 Thread Kristofer Hoch
the variables with there previous values. Something to watch/test for... ~Brian On Wednesday 26 June 2002 11:21, Kristofer Hoch wrote: Hi all, Please forgive the simple nature of this question. I have never really used regular expression extensivly. Here goes. I am trying to extract

Extract numbers from in between parentheses with regex

2002-06-26 Thread Kristofer Hoch
Hi all, Please forgive the simple nature of this question. I have never really used regular expression extensivly. Here goes. I am trying to extract a number from in between two parenthesis. I want the first value I find (from right to left) in a string. These numbers could be phone

Re: Extract numbers from in between parentheses with regex

2002-06-26 Thread Kristofer Hoch
803 without the enclosing parens? Thank you Kristofer Original Message Follows From: [EMAIL PROTECTED] To: Kristofer Hoch [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: Extract numbers from in between parentheses with regex Date: Wed, 26 Jun 2002 11:26:23 -0600

Re: Extract numbers from in between parentheses with regex

2002-06-26 Thread Kristofer Hoch
PROTECTED] To: perl beginners cgi [EMAIL PROTECTED] CC: Kristofer Hoch [EMAIL PROTECTED] Subject: Re: Extract numbers from in between parentheses with regex Date: Wed, 26 Jun 2002 14:03:52 -0500 Kristofer -- and then Kristofer Hoch said... % % David, % Thank you very much for your help. Don't

Re: file read and then write problem

2002-06-10 Thread Kristofer Hoch
Aman, I think that we are going to need same sample code. I can't get this to happen. Thanks Kristofer Original Message Follows From: aman cgiperl [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: file read and then write problem Date: Mon, 10 Jun 2002 13:09:54 -0500 Hi all I posted

Re: AW: AW: parsing xml files for variables

2002-06-05 Thread Kristofer Hoch
testsystemTest System 3/testsystem /Other /Other /Testing Again I am sorry for my grammar and cloudly descriptions. Kristofer Hoch Original Message Follows From: Theuerkorn Johannes [EMAIL PROTECTED] To: 'kris hoch' [EMAIL

Re: Perl/CGI mysql book

2002-06-05 Thread Kristofer Hoch
Try O'Reilly's MySql mSQL. Also use the Online reference at www.mysql.org (documentation, MySQL APIs) Kristofer Original Message Follows From: Maureen E Fischer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Perl/CGI mysql book Date: Wed, 5 Jun 2002 11:12:13 -0700 I am writing