> 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
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
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
--$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
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
> 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
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
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
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
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),
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
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 = "...
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
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
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:
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
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
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
*? = 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)
+
> 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
> 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
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
> 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
> 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
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
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
26 matches
Mail list logo