RE: HTML::Template is choking

2004-09-28 Thread Hanson, Rob
> The nested quotes in my attempt to put TMPL_VARs > into the value field make me suspicious that I > am misusing HTML::Template It may look odd, but the nested quotes are fine. If I had to guess I would say it is because there is a newline within the tag (as it seems to be in your example). I

RE: image manipulation (scaling)

2004-09-17 Thread Hanson, Rob
The best module that I know of for scaling is Image::Magick. I didn't find the docs very easy to navigate, but it does a very good job. [Very light documentation] http://search.cpan.org/~jcristy/PerlMagick-6.02/Magick.pm [Additional docs] http://www.imagemagick.org/www/perl.html The code you wa

RE: PHPerl

2004-09-08 Thread Hanson, Rob
There is embperl like was mentioned. Also Mason is very popular and well documented. Rob -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 11:57 AM To: [EMAIL PROTECTED] Subject: PHPerl Hi all, Is there a way to embed Perl program

RE: Month-Year Links....

2004-09-07 Thread Hanson, Rob
--$months) } return $time; } sub first_day { my $time = shift; my @time = localtime($time); $time[3] = 1; return timelocal(@time); } sub get_date { my $time = shift; my @time = localtime($time); return sprintf('%02d-%04d', $time[4]+1, $time[5]+1900); } -Origin

RE: Month-Year Links....

2004-09-07 Thread Hanson, Rob
The trick is to use Time::Local to find the first day of the month, then subtract 1 day. This prints: 09-2004 08-2004 07-2004 ### use Time::Local; use constant DAY => 86_400; $current = time; $previous = first_day($current) - DAY; $current_2 = first_day($previous) - D

RE: quote marks in DBM

2004-02-08 Thread Hanson, Rob
> Must I abandon trying to get double-quote marks > into my hash element? No, it would be silly if the language didn't support that. And I want to apologize for my long winded answer that is to follow... I guess I just felt like typing. ... As for an answer I think some explanation is needed, o

RE: Hidden field on a form in perl

2003-11-21 Thread Hanson, Rob
I'll see if I can explain it gently as you seem to be a gov't worker ;) There is no "perl" translation... you just aren't thinking about it in a web-app type of way. The sequence would look like this... 1. display page "A" to user 2. user submits page "A" with hidden form field 3. perl script pr

RE: quotes problem

2003-10-20 Thread Hanson, Rob
I'm not sure if John or Greg from the previous answers understand the question... or maybe it is me that is misunderstanding it. You are receiving a string from the query string that includes quotes, but it isn't printing the whole value. Correct? If that is the case, I am not sure I know where

RE: Where is Apache::Session

2003-10-20 Thread Hanson, Rob
On CPAN. http://search.cpan.org/~jbaker/Apache-Session-1.54/ Rob -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2003 6:15 PM To: [EMAIL PROTECTED] Subject: Where is Apache::Session I'm looking for the download of Apache::Session. There is

RE: accessing a hash map...

2003-09-09 Thread Hanson, Rob
You have it slightly wrong... print $hashref{'disks'}->{'io'}; ...And the quotes are optional (usually)... print $hashref{disks}->{io}; > Is there a more generic mailing list > for the different perl modules? Thare are other lists/newsgroups, but most are geared to specific port (ActiveState),

RE: File existence under Microsoft IIS

2003-09-05 Thread Hanson, Rob
The -e test does work on MS-Win, not sure what the problem might be. One thing I can think of is that you should avoid relative paths because IIS will set the current directory to C: (if I remember correctly). These work for me on Win2K: print -e 'C:/Perl'; print -e 'C:/Perl/bin/perl.exe'; print

RE: Stripping HTML from a text file.

2003-09-04 Thread Hanson, Rob
he module then come back with questions. There are also the base modules such as HTML::Parser, etc. that the one previously mentioned builds on, among others check CPAN. http://danconia.org Hanson, Rob wrote: > A simple regex will do the trick... > > # untested > $text = "...

RE: Stripping HTML from a text file.

2003-09-04 Thread Hanson, Rob
A simple regex will do the trick... # untested $text = "..."; $text =~ s|.*?||s; Or something more generic... # untested $tag = "head"; $text =~ s|<$tag[^>]*?>.*?||s; This second one also allows for possible attributes in the start tag. You may need more than this if the HTML isn't well formed

RE: cgi error

2003-08-15 Thread Hanson, Rob
The message you see in the browser usually means very little, and doesn't help much. Check your web server's error logs to see the real error. If you are getting that error you can be pretty sure that your web server is at least trying to execute the script. So after checking your logs, I would

RE: .htaccess

2003-07-24 Thread Hanson, Rob
This is really an Apache question, not Perl. Most things that can be done in the Apache config can be done in a .htaccess file, assuming the main Apache config file allows you to do so. You might want to check out the Apache docs at http://httpd.apache.org. Rob -Original Message- From:

RE: Running process in background?

2003-07-03 Thread Hanson, Rob
lse the DB engine handles for you. Rob -Original Message- From: Scot Robnett [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 2:39 PM To: Hanson, Rob; [EMAIL PROTECTED] Subject: RE: Running process in background? I sort of follow you, but I'm not exactly sure how to implemen

RE: Running process in background?

2003-07-03 Thread Hanson, Rob
Your first solution is prone to memory leaks and your second is just a pain (INHO). > Is there a third alternative? Sure. Create a cron that runs every hour (or less) and checks for scheduled mail to send. All you need to do is have some sort of persistant storage (file or preferably a DB) to s

RE: I am having trouble using SSI(Server side includes) from cgi using perl

2003-06-06 Thread Hanson, Rob
Right, Apache 2.0 supports this with filters. Rob -Original Message- From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 5:32 PM To: Edson Manners; [EMAIL PROTECTED] Subject: Re: I am having trouble using SSI(Server side includes) from cgi using perl CGI is h

RE: Problem with regular expressions!!!

2003-03-19 Thread Hanson, Rob
*? = 0 or more, non-greedy. Non-greeday meaning "as few as possible". $test = 'foobar foobar'; # matches "foobar foobar", as many of "." as possible. $test =~ /foo.*bar/; # matches "foobar", as few of "." as possible (in this case, none). $test =~ /foo.*?bar/; Also... + = 1 or more (greedy) +

RE: my( $string )

2003-03-06 Thread Hanson, Rob
> do I need them every time I declare a variable? Nope. The parens force "list context". Without them is "scalar" context. For example... my @foo = qw(1 2 3 4 5); my $x = @foo; # =5, the number of elements my ($y) = @foo; # =1, the first element Certain functions and operations will do diffe

RE: data structures

2003-03-04 Thread Hanson, Rob
> any suggestions? I'll try. > @bags = param('handbag'); get all of the bags styles Missing comment... @bags = param('handbag'); # get all of the bags styles > push %bags_ordered,$bag_name; You can't push onto a hash, only an array. So either %bags_ordered need to be an array, or you mean s

RE: How much is too much

2003-02-27 Thread Hanson, Rob
I dunno for sure, but if they wanted to measure the processor time they could. It is also likely that they give CGI scripts a lower priority than system functions, so a very greedy Perl script would end up being pretty slow. > they make vague statements about removing > inappropriately-greedy scr

RE: parsing text files ...

2003-02-26 Thread Hanson, Rob
> is there a way to tell the program to > "read until you see this line and > place everything you have read up to > that line into @array" # yes. my @lines = (); open IN, "somefile" or die $!; while () { last if /some_match/; pusdh @lines, $_; } close IN; > could this start at the bottom of

RE: DBI question

2003-02-14 Thread Hanson, Rob
> Basically, i'm trying to write a little abstraction layer Someone already did the work for you, check out Class::DBI. Here is a good article on it, it might be all you need. http://www.perl.com/pub/a/2002/11/27/classdbi.html Rob -Original Message- From: Peter Kappus [mailto:[EMAIL PRO

RE: Better regrex method

2002-08-14 Thread Hanson, Rob
This works for me... # sample data my @tags = qw(K001900 L001234 GP001675); my @prefixs = qw(SP 8 L K GP TP MP); # join them with pipes for use in the regex my $prefix = join('|', @prefixs); # match prefix against each tag, seprate the parts. # the "o" switch cause the regex to only compile onc

RE: Submitting Form Passes Old Values

2002-08-14 Thread Hanson, Rob
Running Perl as a CGI will *not* cache any variables (or anything else). Each time the script is called the Perl executable will be started, and when finished it will free all memory that it was using. If you are using mod_perl it is a little different. mod_perl will cache a script (and any modu