Re: HTML tags in hash
Em 22 Jan 2003 10:29:43 -0500
Farouk Khawaja <[EMAIL PROTECTED]> escreveu:
> Hi all,
>
> I'd like to do the following
>
> $req->{msg} = "some text some more text";
>
> Unfortunately the '' is not breaking. It's just getting
> displayed. The HTML output looks like '
'. Any ideas on how
> I can accomplish this... or if this is a dumb way to go about this.
>
> I've tried escaping like so "\" to no avail.
If you are using double quotes you have to use double escapes. If you
don't have any variable inside the value use single quotes and it should
work:
$req->{msg} = 'some text \ some more text';
And don't forget the [+ local $escmode=0; ... +] in the output block.
Regards,
Luiz Fernando B. Ribeiro
Engenho Soluções para a Internet
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to execute an epl as if url parms were passed?
On Wednesday 22 January 2003 06:00 pm, Kee Hinckley wrote:
> >Quote from Gerald:
> >>Embperl passes the URL parameters in %fdat. That's what it always did.
> >> Only if you have POST data (from a form) and URL parameters, you only
> >> get the POST data in %fdat
>
> Ah. Right. I've never been able to determine from any spec what is
> supposed to be done if there is both POST *and* GET data. Just
> taking the POST seems as good as any solution.
>
> >Yes, I'm using HTML::Embperl::Execute. How do I pass URL parameters to it
> >just like it was receiving data from a browser? Do I just :
> >
> >[- Execute "/www/htdocs/page.epl?key=$value" -]
>
> That's what I was trying to say with my hurried example. From the
> documentation it looks like you should be able to say:
>
> Execute({ inputfile => "/www/htdocs/page.epl", $fdat => {key =>
> $value}, $ffld -> ['key']});
This is not right, Kee. The URL parameters are NOT part of $fdat when you
POST data so passing the URL parameters to the Execute'd page in $fdat is not
right.
I've tried passing the parameters to the Execute command like I mentioned
above and that doesn't work. I'm quite at a loss on how this should be
accomplished. They need to arrive at the $ENV{QUERY_STRING} in order for
them to be handled correctly by the receiving page, but I'm wondering if
there's a Embperl way of doing this besides trying to set the environment
variables manually before calling Execute.
Anyone?
Scott
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to execute an epl as if url parms were passed?
> This is not right, Kee. The URL parameters are NOT part of $fdat when you > POST data so passing the URL parameters to the Execute'd page in $fdat is not > right. perhaps this is an ignorant statement (mine that I am about to make), but why are you trying to use both POST and GET parameters? Use 'hidden' parameters in something like %udat (sessions) and then use get to do the '?key=value' URL processing - which should then be in %fdat. Would this solve your problem? Just a thought. Cameron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache httpd start error (fails on Embperl.so)
Hello, I have Apache 1.3.27 installed with mod-perl 1.27 and Embperl 1.3.5. I have everything setup to use shared objects. I'm getting the following error message when I try to run ./apachectl start: Syntax error on line 1235 of /www/www/apache-1.3.27/conf/httpd.conf: Can't load '/usr/common/perl5.6.0/lib/5.6.0/sgi6-irix/auto/Embperl/Embperl.so' for module Embperl: 135415818:/www/www/apache-1.3.27/bin/httpd: rld: Fatal Error: unresolvable symbol in /usr/common/perl5.6.0/lib/5.6.0/sgi6-irix/auto/Embperl/Embperl.so: PL_Sv at /usr/common/perl5.6.0/lib/5.6.0/sgi6-irix/DynaLoader.pm line 200. at (eval 4) line 3 Compilation failed in require at (eval 4) line 3. Does anyone have any ideas? Thanks! Danielle - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
importing subroutines with Execute()
Hi folks.
I recently started working on a web project utilizing embperl2 and
apache2, and what I thought would be the simple task of having subs
available from a module seems to be not as simple after all. Or at
least, not for me :)
I have a file (utils.pm say) with some perl style subs that look
something like this:
utils.pm
sub test
{
return 1 if($fdat{field1} == 42 );
return 0;
}
(Note that it assumes that %fdat (and %udat) are available)
If I throw this file into something in the default @INC
(/usr/lib/perl/.../utils.pm) I can call code with:
index.html
--
[-
require "utils.pm";
$val = test( "test123" );
-]
blah [+ $val +]
--
This works, but is (IMHO) ugly, and means that the file with the subs
has to be either in the @INC path, or imported in with a use lib(...).
The way that the CVS tree is structured, I'd like to just put the subs
in a file in the base of the html tree, maybe have it loaded in via
Embperl::Object in my base.epl or something.
Anyway, what I thought I could do is something like:
index.html
--
[-
Execute("../utils.pm");
$val = test( "test123" );
-]
blah [+ $val +]
--
This doesn't seem to work. I can change the code to this it works:
index.html
--
[-
$obj = Execute ({object => 'utils.pm', syntax => 'Perl'}) ;
$val = $obj->test( "test123" );
-]
blah [+ $val +]
--
However, this would mean changing a lot of code to use the $obj syntax,
as well as the library code to put a "$self = shift;" in them.
If you're not hopelessly confused by now, is there a way to do what I'm
looking for (ie: import via relative path, or automagically via
embperl::object, so that minimul code changes are needed?
Regards,
Alan
--
Alan <[EMAIL PROTECTED]> - http://arcterex.net
-
"The only thing that experience teaches us is that experience teaches
us nothing. -- Andre Maurois (Emile Herzog)
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to execute an epl as if url parms were passed?
At 12:50 PM -0800 1/23/03, Scott Chapman wrote:
This is not right, Kee. The URL parameters are NOT part of $fdat when you
POST data so passing the URL parameters to the Execute'd page in $fdat is not
right.
I thought the problem was how to pass fdat via an Execute.
If the problem is that the POST parameters aren't in %fdat, then I'm
confused--because they are when I use POST.
On the other hand, if the problem is that the URL parameters aren't
in %fdat when you do a POST then can't you just grab them from
$ENV{REQUEST_URI}?
And I don't know what this has to do with hand Executing a file.
Although do note the documentation on the flags you should pass in
execute to ensure it doesn't try and read STDIN again. (I forget the
details--I just remember seeing a comment in there at some point.)
All of this begs the question--why are you POSTing to a URL with
arguments? There's a reason they aren't automatically put in
%fdat--the expected behavior is ambiguous. Does one override the
other? Do you merge the results if two have the same name? It's not
clear. Ignoring the URL arguments seems like the safest choice, and
usually it's easy enough to make sure it's never an issue. In fact
it's often a feature, since you can easily end up at a URL with extra
arguments, and then if the POST occurs without specifying a new URL
(a handy thing to do when you are reusing code) you'll accidentally
have URL arguments that you didn't anticipate--so throwing them out
makes a lot of sense.
--
Kee Hinckley
http://www.puremessaging.com/Junk-Free Email
http://commons.somewhere.com/buzz/ Writings on Technology and Society
I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
importing subroutines with Execute()
Hi folks.
I recently started working on a web project utilizing embperl2 and
apache2, and what I thought would be the simple task of having subs
available from a module seems to be not as simple after all. Or at
least, not for me :)
I have a file (utils.pm say) with some perl style subs that look
something like this:
utils.pm
sub test
{
return 1 if($fdat{field1} == 42 );
return 0;
}
(Note that it assumes that %fdat (and %udat) are available)
If I throw this file into something in the default @INC
(/usr/lib/perl/.../utils.pm) I can call code with:
index.html
--
[-
require "utils.pm";
$val = test( "test123" );
-]
blah [+ $val +]
--
This works, but is (IMHO) ugly, and means that the file with the subs
has to be either in the @INC path, or imported in with a use lib(...).
The way that the CVS tree is structured, I'd like to just put the subs
in a file in the base of the html tree, maybe have it loaded in via
Embperl::Object in my base.epl or something.
Anyway, what I thought I could do is something like:
index.html
--
[-
Execute("../utils.pm");
$val = test( "test123" );
-]
blah [+ $val +]
--
This doesn't seem to work. I can change the code to this it works:
index.html
--
[-
$obj = Execute ({object => 'utils.pm', syntax => 'Perl'}) ;
$val = $obj->test( "test123" );
-]
blah [+ $val +]
--
However, this would mean changing a lot of code to use the $obj syntax,
as well as the library code to put a "$self = shift;" in them. After a
bit of looking it seems that I can import with the package =>
__PACKAGE__ if I only import once, which seems to mostly work.
Also, is there a way to make sure that the subs imported with the
Execute() are kept up to date if the utils.pm file is changed?
Currently I have to HUP my webserver to get changes recognized, and one
of the advantages in embperl is that you don't have to do that :)
If you're not hopelessly confused by now, is there a way to do what I'm
looking for (ie: import via relative path, or automagically via
embperl::object, so that minimul code changes are needed?
Regards,
Alan
--
Alan <[EMAIL PROTECTED]> - http://arcterex.net
-
"The only thing that experience teaches us is that experience teaches
us nothing. -- Andre Maurois (Emile Herzog)
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Re: importing subroutines with Execute()
You're right. It's all kind of ugly. And beware of virtual-hosts
where the process is shared -- make sure your site-relative libraries
either have different names, or are always the same version.
I do one of two things.
For libraries that are really perl libraries, I have the following at
the head of every file.
[! use lib "$ENV{DOCUMENT_ROOT}/path-to-library"; !]
and also
[$ var $this $]
[- $this = shift -]
Then I can include them to my hearts content.
For libraries that have HTML code--so they really are embperl files,
I usually do this
[- Execute({ isa => 'SiteInit.html' }); -]
Note that if you are using HTML::EmbperlObject you can put that in
the template file, which is handy. Then you can access the routines
in that using
$this->routinename
I wish more of that were transparent. Haven't looked to see what's
happening in Embperl 2
--
Kee Hinckley
http://www.puremessaging.com/Junk-Free Email
http://commons.somewhere.com/buzz/ Writings on Technology and Society
I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Display using array ref of NULLs in dynamic table
G'Day, After selecting a set of data using the following: ... $dat = $sth_rte_sel -> fetchall_arrayref; ... and then attempting to display in a table: [+ $dat->[$row][1] +] [+ $dat->[$row][3] +] [+ $dat->[$row][4] +] [+ $dat->[$row][5] +] [+ $dat->[$row][6] +] I'm finding that if a record contains a field with a NULL value then the whole record is not displayed. Is there a way of turning off this behaviour? Thanks Jim This message (including any attachments) is intended solely for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of the NSW Department of Transport. The whole or parts of this e-mail may be subject to copyright of the Department or third parties. You should only re-transmit, distribute or use the material for commercial purposes if you are authorised to do so. Visit us at: www.transport.nsw.gov.auwww.131500.com.au - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
