Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

apache-asp · Apache::ASP

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 404
  • Category: Perl
  • Founded: Dec 5, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

Advanced
Messages Help
Messages 227 - 256 of 2322   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#227 From: "constfilin" <constfilin@...>
Date: Tue Mar 19, 2002 1:57 am
Subject: A newbie question
constfilin@...
Send Email Send Email
 
greetings -

Let me start with a confession that I'm a newbie to perl and
modules although I've got truckloads of experience on Windows
ASP side. Anyway, I need a bit of wizdom on how to use
packages with Apache::ASP. Please read on.

In my httpd.conf I have

PerlSetVar UseStrict 1
PerlSetVar UniquePackages 0

then I have a script - called "Login.pl" - that goes like this:

<html>
<%
$Response->Include($Server->MapPath("/pls/Common/consts.pl"),"");
$Response->Write(blabla()."<BR>");
$Response->Write("A_VARIABLE=".$A_VARIABLE."<BR>");
%>
</html>

The contents of /pls/Common/consts.pl is

<%
our $A_VARIABLE = "whatever";
sub blabla {
     "blabla";
}
%>

Now, when I execute Login.pl, I get this error in errors_log
"Variable "$A_VARIABLE" is not imported at Login.pl line 5."

I would like to get rid of this error without having
"PerlSetVar UseStrict 0" in httpd.conf. But how? Using
"no strict" in Login.pls does not help, and all perl
keywords "local", "my", and "our" are scoped to the current
file, eval or block. Using no keyword at all to declare
$A_VARIABLE gives the same error, but now in file consts.pl.

Should I really make a separate Perl package out of consts.pl
and then import the variables from package consts into Login.pl?
This seems a little absurd because per "PerlSetVar UniquePackages
0" in httpd.conf, both Login.pl and consts.pl are in the same
package, and there should be a simple way for any script in
the package to use variables declared in other scripts of the
package. Or am I wrong? Please let me know.

Thank you in advance

Constantine



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#228 From: Ellers <ellers@...>
Date: Tue Mar 19, 2002 6:36 am
Subject: Re: A newbie question
ellers@...
Send Email Send Email
 
>Let me start with a confession that I'm a newbie to perl and
>modules although I've got truckloads of experience on Windows
>ASP side. Anyway, I need a bit of wizdom on how to use
>packages with Apache::ASP. Please read on.
>
>In my httpd.conf I have
>
>PerlSetVar UseStrict 1

Definitely keep UseStrict turned on. When I was learning Perl I didn't quite get
why its useful - now I understand and its definitely a good
thing to have turned on!

>then I have a script - called "Login.pl" - that goes like this:
>
><html>
><%
>$Response->Include($Server->MapPath("/pls/Common/consts.pl"),"");
>$Response->Write(blabla()."<BR>");
>$Response->Write("A_VARIABLE=".$A_VARIABLE."<BR>");
>%>
></html>
>
>The contents of /pls/Common/consts.pl is
>
><%
>our $A_VARIABLE = "whatever";
>sub blabla {
>    "blabla";
>}
>%>

What you're after is something like:

	 use MyPackageToBeWritten;

or

	 require '/pls/Common/consts.pl';


However with Apache::ASP there is an easier way - and due to some of the quirks
of mod_perl (I'm _not_ an expert on mod_perl...) a much
more reliable way:  Put your reusable variables/subs in your global.asa file.


In your instance it'd be something like:

<< global.asa >>

use vars qw( $A_VARIABLE );

sub doSomething
{
	 return "blahblah";
}

<< >>


Further to that, if you're looking at doing a login system, I have just recently
done one that works really nicely - and requires _zero_ code to
your actual .asp files to ensure that the user is logged in. It may not suit
your needs, but this is what I added to my global.asa:

<< global.asa >>

sub Script_OnStart
{
     unless ( $Request->ServerVariables( 'SCRIPT_NAME') eq '/login.asp')
     {
         unless ( validateLogin( ))
         {
             my %param = ( 'u'=>$Request->ServerVariables('REQUEST_URI'));
             $Response->Redirect( $Server->URL('/login.asp', \%param ));
         }
     }
}

sub validateLogin
{
     return defined( $Session->{User} );
}

sub doLogin
{
     # This can be called by login.asp when the user presses a "login" button
with user id/password.

     # Depending how you validate, check the user/password, and store something
in $Session->{User}
}

<< >>

Your login.asp file is exempt from the check, but every other .asp file will
redirect to the login script.

Note also that the redirection saves the current request URI - after a
successful login I redirect back to the users original request.


>Should I really make a separate Perl package out of consts.pl
>and then import the variables from package consts into Login.pl?
>This seems a little absurd because per "PerlSetVar UniquePackages
>0" in httpd.conf, both Login.pl and consts.pl are in the same
>package, and there should be a simple way for any script in
>the package to use variables declared in other scripts of the
>package. Or am I wrong? Please let me know.
>

Not wrong, just leverage global.asa better and it should make your problems go
away. If you have extensive modules you can factor them
out into separate packages but that can be done later.

The ASP gurus on this list may have better suggestions; I'm a bit of a newbie

Ellers



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#229 From: "Jim Helm" <jjhelm@...>
Date: Thu Mar 21, 2002 2:56 am
Subject: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP
jjhelm@...
Send Email Send Email
 
This isn't specific to Apache:ASP, but I've seen a lot of good advice
here, and hopefully someone has already been through this.

I was just wondering if anyone had used/knows of anything for perl
similar to phpLens.  I haven't actually used it, but it looks pretty
impressive.  I'd prefer to stick with perl, though.  I've searched
through CPAN, and on google, and haven't found anything obviously like
phpLens for perl, but there's a lot out there and I may have just missed
it.  The closest I think I've seen so far is DBIx::HTMLView, but it's
only for mySQL and mSQL (needs some extra coding for other DBD drivers -
I think).

Basically, I'm just looking for some tools for generating things like
master/detail editing forms and backends.  I'm not looking to avoid
coding entirely, just for something to make life easier.  I don't need
all the bells and whistles of phpLens - though they would be nice.  And
I need to be able to make updates - simply displaying data is fairly
trivial, and I wouldn't need to ask for tools to do that - they are a
dime a dozen (though not all of the same quality!).

My alternative will probably be to use Oracle Forms (since we have a
site license for nearly every Oracle product for internal use only), but
I really want stick to perl if I can - mostly so I'm not tied to
Oracle's RDBMS in the future.  If you've read this far thanks.  If you
have suggestions, thanks a lot!

I suppose if there's nothing like phpLens, I'll either have to use
Forms, roll my own perlLens, or switch to PHP and buy phpLens.

Thanks again,

Jim

-----Original Message-----
From: constfilin [mailto:constfilin@...]
Sent: Monday, March 18, 2002 5:58 PM
To: asp@...
Subject: A newbie question


greetings -

Let me start with a confession that I'm a newbie to perl and
modules although I've got truckloads of experience on Windows ASP side.
Anyway, I need a bit of wizdom on how to use
packages with Apache::ASP. Please read on.

In my httpd.conf I have

PerlSetVar UseStrict 1
PerlSetVar UniquePackages 0

then I have a script - called "Login.pl" - that goes like this:

<html>
<% $Response->Include($Server->MapPath("/pls/Common/consts.pl"),"");
$Response->Write(blabla()."<BR>");
$Response->Write("A_VARIABLE=".$A_VARIABLE."<BR>");
%>
</html>

The contents of /pls/Common/consts.pl is

<%
our $A_VARIABLE = "whatever";
sub blabla {
     "blabla";
}
%>

Now, when I execute Login.pl, I get this error in errors_log
"Variable "$A_VARIABLE" is not imported at Login.pl line 5."

I would like to get rid of this error without having
"PerlSetVar UseStrict 0" in httpd.conf. But how? Using
"no strict" in Login.pls does not help, and all perl
keywords "local", "my", and "our" are scoped to the current
file, eval or block. Using no keyword at all to declare
$A_VARIABLE gives the same error, but now in file consts.pl.

Should I really make a separate Perl package out of consts.pl and then
import the variables from package consts into Login.pl? This seems a
little absurd because per "PerlSetVar UniquePackages
0" in httpd.conf, both Login.pl and consts.pl are in the same
package, and there should be a simple way for any script in
the package to use variables declared in other scripts of the
package. Or am I wrong? Please let me know.

Thank you in advance

Constantine



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#230 From: Ellers <ellers@...>
Date: Thu Mar 21, 2002 4:24 am
Subject: Re: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP
ellers@...
Send Email Send Email
 
At 6:56 PM -0800 20/3/02, Jim Helm wrote:
>This isn't specific to Apache:ASP, but I've seen a lot of good advice
>here, and hopefully someone has already been through this.
>...
>Basically, I'm just looking for some tools for generating things like
>master/detail editing forms and backends.  I'm not looking to avoid
>coding entirely, just for something to make life easier.


Its a good question... I haven't seen anything myself which suprised
me. It would have been really handy for me too. With DBI/DBD I
would've thought a set of classes could be designed to make it
easy(er) to browse and edit rows.

e.g.

<%  # browse_books.asp #

use DBD::Forms;

### prepare a Forms RowBrowser - note that the database
### handle could be oracle, mysql, etc...
my $browser = new DBD::Forms::RowBrowser( $dbh );

### prepare the browser to look at rows from the book table
$browser->prepare(
      Table => 'Book',
      SelectColumns => [qw/ title isbn authorlist year/],
      SortColumn => 'title',
      RowsPerPage => 10
      );

### format the title column as a link to book details
$browser->format(
     Column => 'title',
     FormatSub => sub {
        my ( $title, $hashRef ) = @_;
        my $isbn = $hashref->{ 'isbn' };
        my $url = $Server->URL( 'details.asp', { isbn => $isbn });
        return "<a href=\"$url\">$title</a>";
     },
     CellCSS => 'data',
    );

### print 10 rows from the table... could use default layout or
### templates (a'la CGI::FormBuilder)
print $browseRows->printHTML( Template => 'table_template.html' );

%>


I had a quick go at it when I first started the current project but
the deadlines made it very hard to spend the time needed to keep it
generic and intuitive. I had to go back to doing the app-specific
version :(


Ellers


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#231 From: "eamondaly" <eamon@...>
Date: Thu Mar 21, 2002 10:10 pm
Subject: Templating suggestions?
eamon@...
Send Email Send Email
 
This is going to be a long post, so please bear with me.

I'm implementing a new site in Apache::ASP. I'd like to develop a
framework similar to our existing mod_perl setup. The way we
currently create a page is like so:

- Templater creates template.html
   - Contains several tokens like __TITLE__, __HEADER__, __BODY__,
     __LEFT_COLUMN__
   - Some default variables are set: $var{'LEFT_COLUMN'},
     $var{'FOOTER'}, etc.
   - Also contains some perl logic

- Developer creates foo.html
   - Sets $var{'TEMPLATE'} to template.html
   - foo.html (optionally) contains variables like $var{'TITLE'},
     $var{'HEADER'}, and $var{'LEFT_COLUMN'}. These append to or
     override those set in the template
   - Everything else in foo.html is treated as $var{'BODY'}
   - Also contains perl logic

When a request comes in for foo.html, our perl module scans it for
the template name, reads in and executes everything in template.html,
executes everything in foo.html, substitutes all tokens with their
values (__TOKEN__ with $var{'TOKEN'}), and spits out the result. Can
I mimic this behavior in Apache::ASP?

I've been trying things along the lines of (in foo.html):

   <my:template href="/templates/simple.inc">
   WHEE! <% print scalar localtime %>
   </my:template>

and then, in global.asa:

   sub my::template {
     my($args, $html) = @_;
     my $template = $Server->MapPath($args->{'href'});
     my $template_ref = $Response->TrapInclude($template);
     $$template_ref =~ s/__BODY__/$html/;
     $main::Response->Write($$template_ref);
   }

which works, but obviously only gets me halfway there. Can I declare
variables like %var in foo.html that are accessible to the routine
my::template? I can't set these as globals, because they're not.

I really don't want our developers coding pages like:

   <!--#include file="everything_up_to_the_title.inc">
   This is my title!
   <!--#include file="everything_from_title_to_left_column.inc">
   This is my left column
   <!--#include file="everything_from_left_column_to_header.inc">
   ...

I've tried stuff like structuring foo.htm as XML, but parsing that
with XMLin breaks because the HEADER and LEFT_COLUMN variables often
contain arbitrary HTML.

I'm open to any and all suggestions!


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#232 From: Joshua Chamas <joshua@...>
Date: Fri Mar 22, 2002 12:32 am
Subject: Re: Templating suggestions?
joshua@...
Send Email Send Email
 
eamondaly wrote:
>
> This is going to be a long post, so please bear with me.
>
> I'm implementing a new site in Apache::ASP. I'd like to develop a
> framework similar to our existing mod_perl setup. The way we
> currently create a page is like so:
>
> - Templater creates template.html
>   - Contains several tokens like __TITLE__, __HEADER__, __BODY__,
>     __LEFT_COLUMN__
>   - Some default variables are set: $var{'LEFT_COLUMN'},
>     $var{'FOOTER'}, etc.
>   - Also contains some perl logic
>

If you want some standard templatting system other than
ASP style <%= $vars{TITLE} %>, then why not use another
templatting framework like Template Toolkit or Embperl ?
I would not invent yet another templatting language
when there are so many to choose from.  Please see:

   http://www.perl.com/pub/a/2001/08/21/templating.html

for templatting comparisons.

If you want to create an XMLSubs templatting system, you
can do that within Apache::ASP like

  <var name='TITLE' />

If you REALLY want to do __TITLE__, you could do this in
global.asa...

use vars qw(%vars);
sub Script_OnStart {
    %vars = (); # init per request
}

sub Script_OnFlush {
    my $data = $Response->{BinaryRef};
    $$data =~ s/__(\w+)__/$vars{$1}/isge;
}

> - Developer creates foo.html
>   - Sets $var{'TEMPLATE'} to template.html
>   - foo.html (optionally) contains variables like $var{'TITLE'},
>     $var{'HEADER'}, and $var{'LEFT_COLUMN'}. These append to or
>     override those set in the template
>   - Everything else in foo.html is treated as $var{'BODY'}
>   - Also contains perl logic
>

I am not sure where you are going with $var{BODY}, but you might
be more interested in using mod_perl handlers with a templatting
system instead like Template Toolkit or HTML::Template.

> When a request comes in for foo.html, our perl module scans it for
> the template name, reads in and executes everything in template.html,
> executes everything in foo.html, substitutes all tokens with their
> values (__TOKEN__ with $var{'TOKEN'}), and spits out the result. Can
> I mimic this behavior in Apache::ASP?
>

Script_OnFlush handler can be used for doing any post processing
of output your heart desires.  But weight carefully the difference
between can & should in this regards.

> I've been trying things along the lines of (in foo.html):
>
>   <my:template href="/templates/simple.inc">
>   WHEE! <% print scalar localtime %>
>   </my:template>
>
> and then, in global.asa:
>
>   sub my::template {
>     my($args, $html) = @_;
>     my $template = $Server->MapPath($args->{'href'});
>     my $template_ref = $Response->TrapInclude($template);
>     $$template_ref =~ s/__BODY__/$html/;
>     $main::Response->Write($$template_ref);
>   }
>
> which works, but obviously only gets me halfway there. Can I declare
> variables like %var in foo.html that are accessible to the routine
> my::template? I can't set these as globals, because they're not.
>

This is a pretty good use of XMLSubs to create your own
mini template system.  If $template is just an HTML template
and you don't want HTML developers adding ASP bits, then you
might just read in the file directly with

if(-e $file) {
   open(FILE, $file) || die("can't open file: $!");
   my $data = join('', <FILE>);
   close FILE;
}

This way your templates are safe from ASP code blocks,
and gives you greater control of the template system.
In order to allow XMLSubs tags use, but not ASP code
blocks, I have considered configs or params to
the Include() calls like CodeBlocks => 0 as in

   PerlSetVar CodeBlocks 0

or

   $Response->Include({ File => 1, CodeBlocks => 0 }, @args);

which could still allow for XMLSubs while disabling <% %>
in a script/template.  One of the complaints of ASP is
that is allows too much to be put into templates, and while
I see the above would be nice to have, no one has yet NEEDED
it, thus is has never been done.

> I really don't want our developers coding pages like:
>
>   <!--#include file="everything_up_to_the_title.inc">
>   This is my title!
>   <!--#include file="everything_from_title_to_left_column.inc">
>   This is my left column
>   <!--#include file="everything_from_left_column_to_header.inc">
>   ...

I agree, this is not so good these days, but Apache::ASP supports
it for SSI backwards compatibility.

> I'm open to any and all suggestions!

I have long wanted to build support for easier variables substitution
where one could do this:

   PerlSetVar QuickVars 1

sub Script_OnStart {
    $Vars->{DATA} = 1;
}

Then in the ASP script, PHP quick variables would be supported like:

<% for(1..10) { %>
   $DATA
<% } %>

$DATA would be pulled from $Vars->{DATA} automatically at runtime.
I think this would be a worthwhile extension to Apache::ASP since
<%= $Vars->{DATA} %> type templates can be unwieldy for HTML developers.

I would adopt a standard of $\w+ for regexp matching for QuickVars
since this is the kind of thing supported in PHP & is therefore
a widely used practice.  As a PerlSetVar QuickVars 1 config, this would
have the added benefit of not affecting those Apache::ASP users until
they explicitly want this feature.

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#233 From: Joshua Chamas <joshua@...>
Date: Fri Mar 22, 2002 2:08 am
Subject: Re: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP
joshua@...
Send Email Send Email
 
Jim Helm wrote:
>
> This isn't specific to Apache:ASP, but I've seen a lot of good advice
> here, and hopefully someone has already been through this.
>
> I was just wondering if anyone had used/knows of anything for perl
> similar to phpLens.  I haven't actually used it, but it looks pretty
> impressive.  I'd prefer to stick with perl, though.  I've searched
> through CPAN, and on google, and haven't found anything obviously like
> phpLens for perl, but there's a lot out there and I may have just missed
> it.  The closest I think I've seen so far is DBIx::HTMLView, but it's
> only for mySQL and mSQL (needs some extra coding for other DBD drivers -
> I think).
>

I have always rolled by own application by application, but my
apps have always had to be pretty tight to the database for
high performance with mixed OLAP/OLTP environments.

If you feel that RAD does not have to be GUI RAD, I might look
at these:

   CGI::FormBuilder ( promises 4x code reduction )
   DBIx::XHTML_Table

If you want something closer do the database, and don't mind doing
your own HTML, check out:

   DBIx::Recordset
   Alzabo

They at least abstract DBI slightly away from you.

> all the bells and whistles of phpLens - though they would be nice.  And
> I need to be able to make updates - simply displaying data is fairly
> trivial, and I wouldn't need to ask for tools to do that - they are a

phpLens looks nice.  You you want something that is more of a CMS in perl,
you can try Bricolage or Mason:

   http://bricolage.thepirtgroup.com/
   http://www.masonhq.com/

Sorry, I don't think any of these quite hit it on the head for
you, but I thought I'd try!  Best of luck, and if you find anything
interesting please share it with the rest of us, as it seems
to be a fairly common problem.  Also, you might try the mod_perl
list & I am sure you will get some opinions :)

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#234 From: "Kulp, David" <david_kulp@...>
Date: Fri Mar 22, 2002 2:25 am
Subject: RE: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP
david_kulp@...
Send Email Send Email
 
I must admit that there's nothing that's really "it" in CPAN.  A few months
ago I spent a lot of time looking through the modules that Joshua described
and never found what I wanted.  I didn't know about phpLens until now, but
it looks sweet.  Instead, I've been writing some Apache::ASP tags that, if I
do say so myself, nicely abstract away a lot of the database code.  I'm only
concerned with view and search (not editting (data entry), which I believe
to be a separate can of worms for all but the simplest databases).  I hope
to release it some day.

The basic idea is

<dbb:form>
<dbb:table table="foo" DSN=$DSN />
</dbb:form>

and it magically inserts a paginated, CSS savvy, searchable table to your
HTML document.
It relies on simple meta-data in the database to control things like layout
of numerics, etc. and you can write your own little perl "rendering" methods
to display a cell of a table however you like.  Additional tags
<dbb:selection> and <dbb:qset> allow for exporting a selection set or the
results of a query to a tab delimited or Excel output.

Sound interesting to anyone besides me?  If so, I might put more energy into
making a releasable package.

-d

> -----Original Message-----
> From: Joshua Chamas [mailto:joshua@...]
> Sent: Thursday, March 21, 2002 6:08 PM
> To: Jim Helm
> Cc: asp@...
> Subject: Re: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP
>
>
> Jim Helm wrote:
> >
> > This isn't specific to Apache:ASP, but I've seen a lot of
> good advice
> > here, and hopefully someone has already been through this.
> >
> > I was just wondering if anyone had used/knows of anything for perl
> > similar to phpLens.  I haven't actually used it, but it looks pretty
> > impressive.  I'd prefer to stick with perl, though.  I've searched
> > through CPAN, and on google, and haven't found anything
> obviously like
> > phpLens for perl, but there's a lot out there and I may
> have just missed
> > it.  The closest I think I've seen so far is
> DBIx::HTMLView, but it's
> > only for mySQL and mSQL (needs some extra coding for other
> DBD drivers -
> > I think).
> >
>
> I have always rolled by own application by application, but my
> apps have always had to be pretty tight to the database for
> high performance with mixed OLAP/OLTP environments.
>
> If you feel that RAD does not have to be GUI RAD, I might look
> at these:
>
>   CGI::FormBuilder ( promises 4x code reduction )
>   DBIx::XHTML_Table
>
> If you want something closer do the database, and don't mind doing
> your own HTML, check out:
>
>   DBIx::Recordset
>   Alzabo
>
> They at least abstract DBI slightly away from you.
>
> > all the bells and whistles of phpLens - though they would
> be nice.  And
> > I need to be able to make updates - simply displaying data is fairly
> > trivial, and I wouldn't need to ask for tools to do that -
> they are a
>
> phpLens looks nice.  You you want something that is more of a
> CMS in perl,
> you can try Bricolage or Mason:
>
>   http://bricolage.thepirtgroup.com/
>   http://www.masonhq.com/
>
> Sorry, I don't think any of these quite hit it on the head for
> you, but I thought I'd try!  Best of luck, and if you find anything
> interesting please share it with the rest of us, as it seems
> to be a fairly common problem.  Also, you might try the mod_perl
> list & I am sure you will get some opinions :)
>
> --Josh
> _________________________________________________________________
> Joshua Chamas                           Chamas Enterprises Inc.
> NodeWorks Founder                       Huntington Beach, CA  USA
> http://www.nodeworks.com                1-714-625-4051
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: asp-unsubscribe@...
> For additional commands, e-mail: asp-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#235 From: Ellers <ellers@...>
Date: Fri Mar 22, 2002 2:44 am
Subject: RE: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP
ellers@...
Send Email Send Email
 
>...
>
><dbb:form>
><dbb:table table="foo" DSN=$DSN />
></dbb:form>
>
>and it magically inserts a paginated, CSS savvy, searchable table to your
>HTML document.
>...
>
>Sound interesting to anyone besides me?  If so, I might put more energy into
>making a releasable package.

Definitely sounds interesting to me ;)

I'm sure others would be too

Ellers


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#236 From: Joshua Chamas <joshua@...>
Date: Fri Mar 22, 2002 3:24 am
Subject: Re: Future versions
joshua@...
Send Email Send Email
 
"Ken Y. Clark" wrote:
>
> On Wed, 20 Mar 2002, Aaron Roberts wrote:
>
> > Date: Wed, 20 Mar 2002 13:34:46 -0000
> > From: Aaron Roberts <aroberts@...>
> > To: modperl@...
> > Subject: Future versions
> >
> > Hi,
> >       I noticed that your "May be done" list on www.apache-asp.org
> > mentions an interpreter for VBScript.  I have been asked to setup a
> > Linux based corporate website, though my developers insist on using
> > VBScript and ASP.
> >
> > I realise that this is a bit of a time -wasting question, but how
> > certain is the "May be done" list of to dos? - should I wait for your
> > apache module to include VBScript support, or am I going to have to work
> > with something like Sun's Chilli ASP for apache/linux ?

Apache::ASP is written in perl, and the best that can be hoped
for some some VBScript light eumaltion layer implemented,
certainly we'll never see a full MS style implementation with
all the classes & objects that go with VBScript on Win32 platforms.

Ime Smits has provided a patch to Apache::ASP that enables some
basic VBScript functionality posted to me privately, and we'll
sure see at least basic VBScript support in Apache::ASP in the
not too distant future, based on development time as it becomes
available.

If you really need VBScript support today on Unix, I would check
out Chilisoft ASP & Halcyon's Instant ASP.

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#237 From: "Jim Helm" <jjhelm@...>
Date: Fri Mar 22, 2002 7:27 am
Subject: RE: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP
jjhelm@...
Send Email Send Email
 
Looks like CGI::FormBuilder/Template::Toolkit combined with
DBIx::Recordset is probably my best bet.  I knew about them
individually, but for some reason just didn't think to use them in
combination to achieve 95% of what I wanted... I'll still have to code,
but if I didn't have to code anything, what fun would it be!  And if I
ever do find anything better I'll be sure to pass it along.  FormBuilder
is pretty impressive looking so far - wish I head read over it more
thoroughly before asking the question.  Though it was a good exercise, I
think.

Thanks for the virtual whack upside the head. (doh!)

Jim

-----Original Message-----
From: Joshua Chamas [mailto:joshua@...]
Sent: Thursday, March 21, 2002 6:08 PM
To: Jim Helm
Cc: asp@...
Subject: Re: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP


Jim Helm wrote:
>
> This isn't specific to Apache:ASP, but I've seen a lot of good advice
> here, and hopefully someone has already been through this.
>
> I was just wondering if anyone had used/knows of anything for perl
> similar to phpLens.  I haven't actually used it, but it looks pretty
> impressive.  I'd prefer to stick with perl, though.  I've searched
> through CPAN, and on google, and haven't found anything obviously like

> phpLens for perl, but there's a lot out there and I may have just
> missed it.  The closest I think I've seen so far is DBIx::HTMLView,
> but it's only for mySQL and mSQL (needs some extra coding for other
> DBD drivers - I think).
>

I have always rolled by own application by application, but my
apps have always had to be pretty tight to the database for
high performance with mixed OLAP/OLTP environments.

If you feel that RAD does not have to be GUI RAD, I might look at these:

   CGI::FormBuilder ( promises 4x code reduction )
   DBIx::XHTML_Table

If you want something closer do the database, and don't mind doing your
own HTML, check out:

   DBIx::Recordset
   Alzabo

They at least abstract DBI slightly away from you.

> all the bells and whistles of phpLens - though they would be nice.
> And I need to be able to make updates - simply displaying data is
> fairly trivial, and I wouldn't need to ask for tools to do that - they

> are a

phpLens looks nice.  You you want something that is more of a CMS in
perl, you can try Bricolage or Mason:

   http://bricolage.thepirtgroup.com/
   http://www.masonhq.com/

Sorry, I don't think any of these quite hit it on the head for you, but
I thought I'd try!  Best of luck, and if you find anything interesting
please share it with the rest of us, as it seems to be a fairly common
problem.  Also, you might try the mod_perl list & I am sure you will get
some opinions :)

--Josh _________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#238 From: Ellers <ellers@...>
Date: Fri Mar 22, 2002 8:27 am
Subject: RE: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP -> FormBuilder
ellers@...
Send Email Send Email
 
At 11:27 PM -0800 21/3/02, Jim Helm wrote:
>Looks like CGI::FormBuilder/Template::Toolkit combined with
>DBIx::Recordset is probably my best bet.


Getting more off topic now, but thought I'd mention about FormBuilder...

I find CGI::FormBuilder really useful and have come to prefer it to
use CGI methods or HTML code directly.

To use it effectively in Apache::ASP several settings are useful:

	 javascript => 0,
	 header => 0,

Although the javascript one can sometimes be useful, I found it made
life more difficult than it was worth.

Also, with multistage forms (e.g. purchaser details on page 1,
product details page 2, card details page 3 etc) I came up with a few
tricks which I can post if anyone is interested.

Most of the time I used FormBuilder's inbuilt $form->render() method
because it was easier than doing a template; it dawned on me that it
would make sense to add another template method for FormBuilder,
something like:

	 $form->render( ASPInclude => 'inc_user_details.asp' )

or whatever, and instead of HTML::Template variables,
CGI::FormBuilder could just supply a hashref to the include file
allowing stuff like:

[inc_user_details.asp]

	 <p>User Name: <%= $cgiform->{'field_user_name'} %>

etc


This isn't existing functionality in FormBuilder, but if anyone else
thinks its a worthy idea it could be recommended to the author.

Ellers


>
>-----Original Message-----
>From: Joshua Chamas [mailto:joshua@...]
>Sent: Thursday, March 21, 2002 6:08 PM
>To: Jim Helm
>Cc: asp@...
>Subject: Re: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP
>
>
>Jim Helm wrote:
>>
>>  This isn't specific to Apache:ASP, but I've seen a lot of good advice
>>  here, and hopefully someone has already been through this.
>>
>>  I was just wondering if anyone had used/knows of anything for perl
>>  similar to phpLens.  I haven't actually used it, but it looks pretty
>>  impressive.  I'd prefer to stick with perl, though.  I've searched
>>  through CPAN, and on google, and haven't found anything obviously like
>
>>  phpLens for perl, but there's a lot out there and I may have just
>>  missed it.  The closest I think I've seen so far is DBIx::HTMLView,
>>  but it's only for mySQL and mSQL (needs some extra coding for other
>>  DBD drivers - I think).
>>
>
>I have always rolled by own application by application, but my
>apps have always had to be pretty tight to the database for
>high performance with mixed OLAP/OLTP environments.
>
>If you feel that RAD does not have to be GUI RAD, I might look at these:
>
>   CGI::FormBuilder ( promises 4x code reduction )
>   DBIx::XHTML_Table
>
>If you want something closer do the database, and don't mind doing your
>own HTML, check out:
>
>   DBIx::Recordset
>   Alzabo
>
>They at least abstract DBI slightly away from you.
>
>>  all the bells and whistles of phpLens - though they would be nice.
>>  And I need to be able to make updates - simply displaying data is
>>  fairly trivial, and I wouldn't need to ask for tools to do that - they
>
>>  are a
>
>phpLens looks nice.  You you want something that is more of a CMS in
>perl, you can try Bricolage or Mason:
>
>   http://bricolage.thepirtgroup.com/
>   http://www.masonhq.com/
>
>Sorry, I don't think any of these quite hit it on the head for you, but
>I thought I'd try!  Best of luck, and if you find anything interesting
>please share it with the rest of us, as it seems to be a fairly common
>problem.  Also, you might try the mod_perl list & I am sure you will get
>some opinions :)
>
>--Josh _________________________________________________________________
>Joshua Chamas                           Chamas Enterprises Inc.
>NodeWorks Founder                       Huntington Beach, CA  USA
>http://www.nodeworks.com                1-714-625-4051
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: asp-unsubscribe@...
>For additional commands, e-mail: asp-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#239 From: "eamondaly" <eamon@...>
Date: Fri Mar 22, 2002 8:48 pm
Subject: Re: Templating suggestions?
eamon@...
Send Email Send Email
 
Joshua Chamas, you're my hero.

The key, of course, was the Script_OnStart event. Declaring %var
there made $var{'TITLE'}, $var{'HEADER'}, $var{'BODY'}, etc.
available to the page, its template, and its includes. You're a
life-saver!

For those curious, we ended up with the following:

global.asa contains:

     sub Script_OnStart {
       use vars qw(%var);
       %var = ();
     }

     sub Script_OnEnd {
       $var{'TITLE'} ||= $var{'HEADER'};
       my $template_ref = $Response->TrapInclude($var{'TEMPLATE'});
       $main::Response->Write($$template_ref);
     }

     sub my::header {
       shift;
       $var{'HEADER'} .= shift;
     }

     sub my::template {
       my $args = shift;
       $var{'TEMPLATE'} = $Server->MapPath($args->{'href'});
     }

     sub my::body {
       my $args = shift;
       $var{'BODY'} = shift;
     }

A typical page, foo.html, contains:

     <my:template href="/templates/simple.html" />

     <my:header>
     Welcome back, <%= $Session->{'username'} %>!
     </my:header>

     <my:body>
     <!--#include file="foo.inc" -->
     </my:body>

And simple.html contains all the pretty formatting like so:

     <html>
     <head><title><%= $var{'TITLE'} %></title></head>
     <body>
     <h1><%= $var{'HEADER'} %></h1>
     <%= $var{'BODY'} %>
     </body>
     </html>

The really great thing is that code can be added anywhere: to
foo.html, simple.html, to their includes, in the subs-- it's
ridiculously flexible. Plus, it's pretty similar to our existing
module, which means I won't have a tough time retraining my staff.

> I have long wanted to build support for easier variables
substitution
> where one could do this:
>
>   PerlSetVar QuickVars 1
>
> sub Script_OnStart {
>    $Vars->{DATA} = 1;
> }
>
> Then in the ASP script, PHP quick variables would be supported like:
>
> <% for(1..10) { %>
>   $DATA
> <% } %>
>
> $DATA would be pulled from $Vars->{DATA} automatically at runtime.
> I think this would be a worthwhile extension to Apache::ASP since
> <%= $Vars->{DATA} %> type templates can be unwieldy for HTML
developers.

That's pretty much exactly how we do it:

   s/\$(\w+)/(exists $var{$1}) ? $var{$1} : "\$$1" /seg;

We also have some special hashes, like %input and %db, which simplify
development:

   s/\$input{'(\w+)'}/(exists $input{$1}) ? $input{$1} : "\$$1" /seg;

Seems like we could just pop that into Script_OnEnd.

Anyway, thanks again, Joshua. This stuff is great.


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#240 From: "Jim Helm" <jjhelm@...>
Date: Sat Mar 23, 2002 12:36 am
Subject: RE: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP -> FormBuilder
jjhelm@...
Send Email Send Email
 
Actually, using asp includes for the templating sounds great...  I
haven't looked at the code, but I wouldn't think it would be that hard
to add.  It'd be great not to have to learn yet another pseudo-language
to accomplish this (Template::Toolkit or HTML::Toolkit) when Apache::ASP
is something I already know!  I'll start looking at the FormBuilder
hooks, and see how involved it is - don't know if I have the time to
actually implement it, but it's a great idea.

I'm cc'ing Nate on this too, see what he thinks.

Jim

> -----Original Message-----
> From: Ellers [mailto:ellers@...]
|
|
> Most of the time I used FormBuilder's inbuilt $form->render() method
> because it was easier than doing a template; it dawned on me that it
> would make sense to add another template method for FormBuilder,
> something like:
>
>  $form->render( ASPInclude => 'inc_user_details.asp' )
>
> or whatever, and instead of HTML::Template variables,
> CGI::FormBuilder could just supply a hashref to the include file
> allowing stuff like:
>
> [inc_user_details.asp]
>
>  <p>User Name: <%= $cgiform->{'field_user_name'} %>
>
> etc
>
>
> This isn't existing functionality in FormBuilder, but if anyone else
> thinks its a worthy idea it could be recommended to the author.
>
> Ellers
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#241 From: Joshua Chamas <joshua@...>
Date: Sat Mar 23, 2002 1:50 am
Subject: Re: Templating suggestions?
joshua@...
Send Email Send Email
 
> A typical page, foo.html, contains:
>
>     <my:template href="/templates/simple.html" />
>
>     <my:header>
>     Welcome back, <%= $Session->{'username'} %>!
>     </my:header>
>
>     <my:body>
>     <!--#include file="foo.inc" -->
>     </my:body>
>

Glad its working out!

Looking at your solution, I think I would probably do
something more like:

<my:template href="/templates/simple.html" />
   <my:header>Welcome back, <%= $Session->{'username'} %>!</my:header>
   <my:body>
      <!--#include file="foo.inc" -->
   </my:body>
</my:template>

This would allow you to not have to do post processing in
the Script_OnEnd.  With the my:template enclosing my:header
and my:body, you would guarantee the execution of the
my:header & my:body before my:template, so when my:template
executes the %vars data would already be define.

This is a more natural use of the XMLSubs in my view, where
inner tags get executed before outer tags.

The only drawback to this approach is that $Response->Flush
is disabled during XMLSubs execution, so you would not
be able to flush a long running report data out periodically
if the report were wrapped up in a <my:template/> tag,
but your current method suffers from this same problem
I believe.

> Anyway, thanks again, Joshua. This stuff is great.
>

I'm glad you are making use of all the hooks.  Its really
nice to hear of creative solutions to intricate problems
like this.

-- Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#242 From: Joshua Chamas <joshua@...>
Date: Sat Mar 23, 2002 2:33 am
Subject: Re: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP
joshua@...
Send Email Send Email
 
"Kulp, David" wrote:
>
> I must admit that there's nothing that's really "it" in CPAN.  A few months
> ago I spent a lot of time looking through the modules that Joshua described
> and never found what I wanted.  I didn't know about phpLens until now, but
> it looks sweet.  Instead, I've been writing some Apache::ASP tags that, if I
> do say so myself, nicely abstract away a lot of the database code.  I'm only
> concerned with view and search (not editting (data entry), which I believe
> to be a separate can of worms for all but the simplest databases).  I hope
> to release it some day.
>
> The basic idea is
>
> <dbb:form>
> <dbb:table table="foo" DSN=$DSN />
> </dbb:form>
>

Sounds pretty cool to me.  I do not have my head around sharing taglibs
like this easily yet, but you might break some ground here if you pursue
this work.  Though flexible the XMLSubsMatch is kind of limiting in that
someone cannot just "register" their XMLSubs namespace on the fly.  If you
did pursue this we could look at how these packages could be easily
installed with CPAN like ease.  If we had enough "standard" extensions
like this, Apache::ASP could be an ever increasingly useful platform.

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#243 From: "Nathan Wiger" <nate@...>
Date: Sat Mar 23, 2002 2:26 am
Subject: Re: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP -> FormBuilder
nate@...
Send Email Send Email
 
Sure, the more templating engines the better! :-)

The only caveat here is that I definitely don't have the time to implement this,
and besides, I don't know ASP. Andy Wardley sent me a big patch to enable
Template Toolkit support, so if somebody wants to take a whack at this and send
me a corresponding patch, I will gladly add it. Look near the bottom of
render(), where there are some if/elsif/else statements looking for the type of
template specified. This shouldn't be too hard to slot in there.

-Nate

----- Original Message -----
From: "Jim Helm" <jjhelm@...>
To: "'Ellers'" <ellers@...>
Cc: <asp@...>; <nate@...>
Sent: Friday, March 22, 2002 4:36 PM
Subject: RE: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP -> FormBuilder


> Actually, using asp includes for the templating sounds great...  I
> haven't looked at the code, but I wouldn't think it would be that hard
> to add.  It'd be great not to have to learn yet another pseudo-language
> to accomplish this (Template::Toolkit or HTML::Toolkit) when Apache::ASP
> is something I already know!  I'll start looking at the FormBuilder
> hooks, and see how involved it is - don't know if I have the time to
> actually implement it, but it's a great idea.
>
> I'm cc'ing Nate on this too, see what he thinks.
>
> Jim
>
> > -----Original Message-----
> > From: Ellers [mailto:ellers@...]
> |
> |
> > Most of the time I used FormBuilder's inbuilt $form->render() method
> > because it was easier than doing a template; it dawned on me that it
> > would make sense to add another template method for FormBuilder,
> > something like:
> >
> > $form->render( ASPInclude => 'inc_user_details.asp' )
> >
> > or whatever, and instead of HTML::Template variables,
> > CGI::FormBuilder could just supply a hashref to the include file
> > allowing stuff like:
> >
> > [inc_user_details.asp]
> >
> > <p>User Name: <%= $cgiform->{'field_user_name'} %>
> >
> > etc
> >
> >
> > This isn't existing functionality in FormBuilder, but if anyone else
> > thinks its a worthy idea it could be recommended to the author.
> >
> > Ellers
> >
> >
>


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#244 From: "WRFan" <PhoenixWR@...>
Date: Sat Mar 23, 2002 5:48 am
Subject: expat.dll version 2.30 needed
PhoenixWR@...
Send Email Send Email
 
Hi,
 
had problems with one of the example modules. XML::Parser::Expat was needed, but I got only version 2.27 of expat.dll . The version on cpan has no dll. only the pm files, they are version 2.30, but dom.pm, another module, which requires XML::Parser, requires at least version 2.28.  So I had to reduce the requirement in dom.pm to 2.27 and set parser.pm and expat.pm to 2.27 to match each other and the old expat.dll which was already on my system, don't know, maybe it has been installed with activeperl. of course, I could also change the number in expat.dll to 2.30 with a hex editor, but I rather would like to have the real 2.30 version. I am on windows and somehow can't find out how to compile. If somebody got this dll file with version 2.30 to match the corresponding pm files I have, please email me it.
 
Also, maybe you know how to make apache asp and halcyonsoft asp work together on the same server? poor apache gets confused, and everytime I start a vbscript, the apache asp module kicks in. i use ifdefine tags in httpd.conf to start only one of the modules, but I'd rather start both modules at the same time, otherwise I have to restart the server to test the respective other scripts. Maybe through a .htaccess file? I put the halcyonsoft asp directives from httpd.conf to a htaccess file, but the apache asp module still kicked in; or by renaming apache asp scripts extension to something else?
 
Another small problem is that the tmp directory, which is needed for some of the example scripts, is not created properly. First of all, it is created ONLY by the bookmarks example (and I think also the search engine example). As soon as it is created, all other scripts work, but before none of the other scripts creates this directory. Also, the first time I start the bookmarks script (i.e., the time when the tmp directory is created), I get an error. When i refresh the browser, everything is normal, because the tmp directory has been already created. I post the errors below. Not so important, since it works fine, when the tmp directory is created, but still...:
 
 
 
Errors Output
errors compiling global.asa: DBD::CSV::db do failed: Cannot open C:\Programme\Server\Apache\public\ApacheASP\tmp\bookmarks for writing: No such file or directory at C:/Programme/Server/Perl/lib/DBD/File.pm line 466. DBD::File::Statement::open_table('DBD::CSV::Statement=HASH(0x2167e00)', 'DBI::st=HASH(0x205c768)', 'bookmarks', 1, 1) called at C:/Programme/Server/Perl/lib/DBD/CSV.pm line 130 DBD::CSV::Statement::open... see compile error for rest
Debug Output
errors compiling global.asa: DBD::CSV::db do failed: Cannot open C:\Programme\Server\Apache\public\ApacheASP\tmp\bookmarks for writing: No such file or directory at C:/Programme/Server/Perl/lib/DBD/File.pm line 466. DBD::File::Statement::open_table('DBD::CSV::Statement=HASH(0x2167e00)', 'DBI::st=HASH(0x205c768)', 'bookmarks', 1, 1) called at C:/Programme/Server/Perl/lib/DBD/CSV.pm line 130 DBD::CSV::Statement::open_table('DBD::CSV::Statement=HASH(0x2167e00)', 'DBI::st=HASH(0x205c768)', 'bookma ...
Compile Error
 
errors compiling global.asa: DBD::CSV::db do failed: Cannot open C:\Programme\Server\Apache\public\ApacheASP\tmp\bookmarks for writing: No such file or directory at C:/Programme/Server/Perl/lib/DBD/File.pm line 466.
 DBD::File::Statement::open_table('DBD::CSV::Statement=HASH(0x2167e00)', 'DBI::st=HASH(0x205c768)', 'bookmarks', 1, 1) called at C:/Programme/Server/Perl/lib/DBD/CSV.pm line 130
 DBD::CSV::Statement::open_table('DBD::CSV::Statement=HASH(0x2167e00)', 'DBI::st=HASH(0x205c768)', 'bookma ...
 
Compiled Data with Error
 
  -: E) || die("can't create table $DBI::errstr");
  -:   ;
  -: }
  -:
  -: $Db->do("select * from bookmarks")
  -:   || die("can't do select against bookmarks: $DBI::errstr");
  -:
  -: sub Script_OnStart {
  -:     $Basename = basename($0);
  -:     $Title = $Name.' / '.$Titles{$Basename};
  -:     $Response->Include('header.inc');
  -:     $Form = $Request->Form();
  -:     $Query = $Request->QueryString();
  -:     $Response->Expires(0);
  -:
  -:     # a user may logout from any script, destroy session, and go
  -:     # to login / intro page
  -:     if($Form->{logout}) {
  -:  $Session->Abandon();
  -:  $Response->Redirect("index.asp?abandon=".
  -:        ++$Application->{abandon});
  -:     }
  -: }
  -:
  -: sub Script_OnEnd {
  -:     $Response->Include('footer.inc');
  -: }
  -:
  -: sub Application_OnStart {
  -:     # use max_bookmark_id as a pseudo sequence
  -:     $Application->Lock();
  -:     my $sth = $Db->prepare_cached
  -:       ("select bookmark_id from bookmarks order by bookmark_id desc");
  -:     $sth->execute();
  -:     $Application->{max_bookmark_id} = $sth->fetchrow_array();
  -:     $Application->UnLock();
  -: }
  -:  ;; sub exit { $main::Response->End(); }  ;; no lib qw(c:/programme/server/apache/public/apacheasp/site/apps/bookmarks//.); ;; 1;
 
 
 
--------------------------------------------------------------------------------
An error has occured with the Apache::ASP script just run. If you are the developer working on this script, and cannot work through this problem, please try researching it at the Apache::ASP web site, specifically the FAQ section. Failing that, check out your support options, and if necessary include this debug output with any query.

#245 From: "homeup_99" <homeup_99@...>
Date: Sat Mar 23, 2002 11:26 pm
Subject: How is Apache::ASP comparable to ASP under IIS ?
homeup_99@...
Send Email Send Email
 
I have installed Apache on Windows 2000. I have uninstalled IIS.

I need to know does Apache::ASp provide true ASP support? I mean will
my ASP sites, which were working with IIS continue to work with
Apache::ASP...does it support all Active Server Pages geatures,
syntax etc. ?

Thanks.
-Saurabh


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#246 From: Joshua Chamas <joshua@...>
Date: Sun Mar 24, 2002 3:43 am
Subject: Re: How is Apache::ASP comparable to ASP under IIS ?
joshua@...
Send Email Send Email
 
homeup_99 wrote:
>
> I have installed Apache on Windows 2000. I have uninstalled IIS.
>
> I need to know does Apache::ASp provide true ASP support? I mean will
> my ASP sites, which were working with IIS continue to work with
> Apache::ASP...does it support all Active Server Pages geatures,
> syntax etc. ?
>

Apache::ASP supports perl scripted ASP pages under Apache/mod_perl.
This allows for PerlScript pages running under IIS to run under
Apache with little or no modification.

Chances are you have VBScript pages which will not run under Apache::ASP.
If you are stuck with VBScript ASP, other options include commercial
Apache modules from Chilisoft & Halcyon, or converting your scripts
to PHP, please see http://www.asp2php.com

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#247 From: Ellers <ellers@...>
Date: Tue Mar 26, 2002 9:48 am
Subject: Re: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP -> FormBuilder
ellers@...
Send Email Send Email
 
I've done a first cut at modifying CGI::FormBuilder to use ASP's
$Response->Include() as a templating mechanism.

In an ASP file your form is created:

<<<

<html>
<head>
<title>Try Formbuilder with ASP</title>
</head>
<body>
<h2>A really simple CGI::FormBuilder example using ASP</h2>
<!-- before ASP/CGI::FormBuilder stuff -->
<%

require CGI::FormBuilder;

my $form = CGI::FormBuilder->new
(
     header => 0,
     method => 'GET',
     fields => [qw/email /],
     javascript => 0,
     reset => 0,
     required => [qw/email /],
     validate => { email => 'EMAIL' },
     sticky => 1,  # 0 or 1
);

$form->field ( name => 'email', validate => 'EMAIL', size => 25 );

if ( $form->submitted( ) && $form->validate( ) )
{
     print $form->confirm( );
}
else
{
     print $form->render
     (
         submit =>  'Submit',
         template => {
             type => 'ASPInclude',
             template => 'inc_show_params.asp',
             response => $Response,
         }
     );

}
%>

>>>



Note, in particular, the $form->render() method at the bottom. I pass $Response
as a parameter as its a simple and effective way to ensure
that CGI::FormBuilder gets the appropriate $Response object (which may be in
some odd namespace).

The file inc_show_params.asp is a demo that just dumps the parameters:

<<<
<p>This is my asp file

<p>Below is a dump of all arguments:
<p><hr>
<p><pre>
<%

use Data::Dumper;
$Data::Dumper::Indent = 1;

my ( @args ) = @_;
print $Server->HTMLEncode( Data::Dumper->Dump([@args], [qw(*args)]));

%>
</pre></p><hr>
>>>


The code below is a more-or-less replacement using ASP for the default
CGI::FormBuilder style:

<<<
<p>This is a demo form - this content is in a separate ASP file included by
CGI::FormBuilder.
<p>Fields marked with "*" must be supplied.

<%

my ( $formRef ) = @_;

my ( $fieldsArrayRef ) = $formRef->{ 'fields' };

if ( $formRef->{'invalid'}) { %>

<p><b>There were <%= $formRef->{'invalid'} %> error<%= ( $formRef->{'invalid'} >
1 ? 's' : '' ) %> in your submission.</b></p>

<%
}
%>

<p>
<%= $formRef->{ 'start' } %>
<table border="1" cellpadding="5">

<%

foreach my $fieldRef ( @{$fieldsArrayRef}) {

%>

<tr>
  <td>
   <%= ( $fieldRef->{ 'invalid' } ? '<font color="red">' : '' ) %>
   <%= $fieldRef->{ 'label' } %>
   <%= ( $fieldRef->{ 'required' } ? '*' : '' ) %>
   <%= ( $fieldRef->{ 'invalid' } ? '</font>' : '' ) %>
  </td>
  <td><%= $fieldRef->{ 'field' } %>
  </td>
</tr>

<% } %>

<tr>
  <td colspan="2" align="center">
   <%= $formRef->{ 'reset' } %>
   <%= $formRef->{ 'submit' } %>
  </td>
</tr>
</table>
<%= $formRef->{ 'end' } %>
>>>



Phew... hope this post isn't too long!


To achieve all this was surprisingly easy:

> diff /usr/local/lib/site_perl/CGI/FormBuilder.pm
/my/dodgy/CGI/Customised_FormBuilder.pm

953c955
<         if (ref $args{template} eq 'HASH' && $args{template}{type} eq 'TT2') {
---
>         if (ref $args{template} eq 'HASH' && $args{template}{type} =~
m/^(TT2|ASPInclude)$/ ) { # added by Ellers
1178a1183,1207
>
>         } elsif ($tmpltype eq 'ASPInclude') { # Added by Ellers
>
>             eval { require Apache::ASP };
>             puke "Can't use templates because the Apache::ASP is not
installed!" if $@;
>
>                       my ( $aspFile, $aspResponse, $aspContentRef, $aspArgRef
);
>                       $aspFile = $tmplopt{template}
>                               || puke "ASP Include not specified";
>                       $aspResponse = $tmplopt{response}
>                               || puke "ASP Response not specified";
>
>             # special fields
>             $tmplvar{'start'}  = $formtag;
>             $tmplvar{'submit'} = $submit;
>             $tmplvar{'reset'}  = $reset;
>             $tmplvar{'end'}    = '</form>';
>             $tmplvar{'jshead'} = $jsfunc;
>             $tmplvar{'invalid'} = $self->{state}{invalid};
>             $tmplvar{'fields'} = [ map $tmplvar{field}{$_},
>                    @{ $self->{field_names} } ];
>                       $aspArgRef = \%tmplvar;
>
>                       $aspContentRef = $aspResponse->TrapInclude( $aspFile,
$aspArgRef );
>                       $outhtml = $header . $$aspContentRef;


If that's a bit cumbersome, I've uploaded various files including my dodgy
modified FormBuilder.pm:

	 http://members.iinet.net.au/~ellers/cgi-formbuilder/

PLEASE NOTE:
  1. I've done a few other changes to the above, such as spaces between multiple
submit buttons etc, but it should be ok...
  2. The server above doesn't run Apache::ASP so best to save the files and run
on your own server

TODO:
  - check templating work for $form->confirm()
  - add overall doco, etc


It'd be great if anyone who is interested in this work could give it a go and
send comments through.  If/when its reliable enough I can
submit it as a patch to the 'real' thing.

Ellers



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#248 From: "Jim Helm" <jjhelm@...>
Date: Tue Mar 26, 2002 5:58 pm
Subject: RE: OT: (slightly) RAD RDBMS tools for perl/Apache::ASP -> FormBuilder
jjhelm@...
Send Email Send Email
 
Great work!

I started to take that approach and decided to try a callback, or
passing a hashref that would get populated, instead of calling another
page. That would make the render function more adaptable to other
frameworks, instead of having to add in specific code for each one.  I
have done much yet, but it's essentially what you have except instead of
calling $Response->Include at the end of render, it just assigns that
tmplvar hash to the hashref I pass in so all the various html chunks can
be used directly by the main asp script - I'm a mininalist, so main.asp
calling render calling another form.asp script going against my grain a
bit (please, no flames here - it's just a personal preference!).
Hopefully I'll have time to work on it today and post the results.

Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#249 From: "eamondaly" <eamon@...>
Date: Tue Mar 26, 2002 10:30 pm
Subject: Trying to patch Apache::ASP::FormFill
eamon@...
Send Email Send Email
 
I'm stuck on what should be a pretty simple patch to FormFill. We
pass data around via QueryString a lot, so I'd like our form fields
to be prefilled using both $Request->QueryString and $Request->Form.

I was trying a patch like so:

   my $fdat;
   eval { $asp->{Request}{Params} };
   if ($@) {
     $fdat = $asp->{Request}{Form};
     $asp->{dbg} && $asp->Debug("form fill: using $Request->Form");
   }
   else {
     $fdat = $asp->{Request}{Params};
     $asp->{dbg} && $asp->Debug("form fill: using Request->Params");
   }

   eval {
     my $fif = HTML::FillInForm->new();
     $form = $fif->fill(
                        scalarref => \$form,
                        fdat => $fdat
                       );
   };
   ...

This works fine when I add "PerlSetVar RequestParams 1" to httpd.conf.
However, when I remove RequestParams, the "$asp->{Request}{Params}"
eval doesn't throw an error!

If I create a plain old page and call:

   <%
     eval { $Request->Params; };
     print $@ ? "failed: $@" : "succeeded!";
   %>

the trap works just fine. Is there something special about the $asp
object in FormFill?


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#250 From: "eamondaly" <eamon@...>
Date: Wed Mar 27, 2002 2:05 pm
Subject: Re: Templating suggestions?
eamon@...
Send Email Send Email
 
--- In apache-asp@y..., Joshua Chamas <joshua@c...> wrote:
> Looking at your solution, I think I would probably do
> something more like:
>
> <my:template href="/templates/simple.html" />
>   <my:header>Welcome back, <%= $Session->{'username'} %>!
</my:header>
>   <my:body>
>      <!--#include file="foo.inc" -->
>   </my:body>
> </my:template>
>
> This is a more natural use of the XMLSubs in my view, where
> inner tags get executed before outer tags.

I agree. I've changed my code to work like this.

Of course, now I've run into a new roadblock. Can $Response->Redirect
be called from within XMLSubs? I've no trouble with normal <% blocks
and accessing objects like $Session, $Response, and such, but
redirects seem to be a no go. I have a very simple page like so:

   <my:template href="/templates/simple.html">
   <my:body>
   <% $Response->Redirect('/bar.html'); print "WHEE!" %>
   Didn't redirect.
   </my:body>
   </my:template>

Accessing the page results in no data:

   $ telnet 63.121.xxx.xxx 80
   Trying 63.121.xxx.xxx...
   Connected to 63.121.xxx.xxx (63.121.xxx.xxx).
   Escape character is '^]'.
   GET /env.html HTTP/1.1
   Host: xxx.fastweb.com

   Connection closed by foreign host.

I added debug hooks to my::template and my::body-- looking at the
error log, I see they're not even being called:

   [Wed Mar 27 07:50:30 2002] [error] [asp] [6293] [debug] [env.html] -
  Session_OnEnd 0fa9687de85bb7a63efa76e3be4a4a5a
   [Wed Mar 27 07:50:30 2002] [error] [asp] [6293] [debug] [env.html] -
  Application_OnEnd
   [Wed Mar 27 07:50:30 2002] [error] [asp] [6293] [debug] [env.html] -
  Application_OnStart
   [Wed Mar 27 07:50:30 2002] [error] [asp] [6293] [debug] [env.html] -
  Session_OnStart 09bd6388e1013e29a4522c21480c1669
   [Wed Mar 27 07:50:30 2002] [error] [asp] [6293] [debug] [env.html] -
  Script_OnStart /home/httpd/hosts/fastweb/jobs2/docs/env.html
   [Wed Mar 27 07:50:30 2002] [error] [asp] [6293] [debug] [env.html] -
  Script_OnEnd /home/httpd/hosts/fastweb/jobs2/docs/env.html

At debug level -3, I can see the redirect is being called:

   [Wed Mar 27 07:53:50 2002] [error] [asp] [6333] [debug]
[1017237230.8886;0.0017] executing
__ASP__xxx_env_htmlx4b2b5bcadbb7f3b32a28e389dcd5b4d7
   [Wed Mar 27 07:53:50 2002] [error] [asp] [6333] [debug]
[1017237230.8892;0.0006] redirect called - location: /bar.html;
   [Wed Mar 27 07:53:50 2002] [error] [asp] [6333] [debug]
[1017237230.8895;0.0003] parsed session into /bar.html?session-
id=03d219b11e03c858407d8e4bce265b97
   [Wed Mar 27 07:53:50 2002] [error] [asp] [6333] [debug]
[1017237230.8897;0.0002] new location after session query
parsing /bar.html?session-id=03d219b11e03c858407d8e4bce265b97
   [Wed Mar 27 07:53:50 2002] [error] [asp] [6333] [debug]
[1017237230.8900;0.0003] Script_OnEnd
   [Wed Mar 27 07:53:50 2002] [error] [asp] [6333] [debug]
[1017237230.8902;0.0002] executing Script_OnEnd
   [Wed Mar 27 07:53:50 2002] [error] [asp] [6333] [debug]
[1017237230.8904;0.0002] [env.html] -
Script_OnEnd /home/httpd/hosts/fastweb/jobs2/docs/env.html
   [Wed Mar 27 07:53:50 2002] [error] [asp] [6333] [debug]
[1017237230.8919;0.0015] ASP Done Processing - asp: Apache::ASP=HASH
(0x838d090);

but there's no output. I created a plain old ASP file like so:

   <% $Response->Redirect('/bar.html'); print "WHEE!" %>

which worked just fine. Any ideas? Any other debugging info I can
provide? I'm including my global.asa below.

use File::Basename qw(basename);

sub Session_OnStart {
     $Application->{'Session'.$Session->SessionID} = '?';
     $Response->Debug("Session_OnStart ". $Session->SessionID);
}

sub Session_OnEnd {
     my $t_session_active = time() - $Session->{onstart};
     $Application->{'Session'.$Session->SessionID} = $t_session_active;
     $Response->Debug("Session_OnEnd ". $Session->SessionID);
}

sub Application_OnStart {
     $Response->Debug("Application_OnStart");
}

sub Application_OnEnd {
     $Response->Debug("Application_OnEnd");
}

sub Script_OnStart {
     $ENV{'PATH'} = '/bin:/usr/bin';
     $Response->Debug("Script_OnStart $0");
     $Session->{Started}++;

     use vars qw(%var %db %error $input);
     %var = %db = %error = ();

     $input = $Request->Params;
}

sub Script_OnEnd {
     $Response->Debug("Script_OnEnd $0");
     $Session->{Ended}++;
}

sub Script_OnFlush {
     my $data = $Response->{BinaryRef};
     $Response->Debug("Script_OnFlush: about to flush ".length
($$data)." bytes to client");
}

$SIG{__DIE__} = \&Carp::confess;

sub my::login {
     $Response->Debug("Entered my::login");
     my $args = shift;

     if ($args->{'type'} eq 'db-only') {
         # Check the db for the username
     }
     else {
         unless ($Session->{'login'} == 1) {
             my %param;
             $param{'URL'} = $ENV{'REQUEST_URI'};
             $Response->Redirect( $Server->URL('/login/index.html', \%
param) );
         }
     }
     $Response->Debug("Exited my::login");
}

sub my::title {
     $Response->Debug("Entered my::title");
     shift;
     $var{'TITLE'} .= shift;
     $Response->Debug("Exited my::title");
}

sub my::header {
     $Response->Debug("Entered my::header");
     shift;
     $var{'HEADER'} .= shift;
     $Response->Debug("Exited my::header");
}

sub my::function {
     $Response->Debug("Entered my::function");
     shift;

     my $style;

     if ($var{'FUNCTION_COUNT'} == 0) {
       $style = 'border:1px solid #58B; background: #8BE';
     }
     elsif ($var{'FUNCTION_COUNT'} == 1) {
       $style = 'border:1px solid #69C; background: #9CF';
     }
     else {
       $style = 'border:1px solid #CCC; background: #FFF';
     }

     $var{'FUNCTIONS'} .= <<EOF;
   <tr>
   <td align="center" valign="center" height="150" style="$style">
EOF

     $var{'FUNCTIONS'} .= shift;

     $var{'FUNCTIONS'} .= <<EOF;
   </td>
   </tr>
   <tr>
   <td><img src="/spacer.gif" height="1" width="1"></td>
   </tr>
EOF

     $var{'FUNCTION_COUNT'}++;
     $Response->Debug("Exited my::function");
}

sub my::footer {
     $Response->Debug("Entered my::footer");
     shift;
     $var{'FOOTER'} .= shift;
     $Response->Debug("Exited my::footer");
}

sub my::body {
     $Response->Debug("Entered my::body");
     my $args = shift;
     $var{'BODY'} = shift;
     $Response->Debug("Exited my::body");
}

sub my::var {
     $Response->Debug("Entered my::var");
     my ($args, $data) = @_;
     $data =~ s/^\n//;
     $data =~ s/\n$//;
     $var{$args->{'name'}} = $data;
     $Response->Debug("Exited my::var");
}

sub my::template {
     $Response->Debug("Entered my::template");
     my ($args, $data) = @_;
     $var{'TITLE'} ||= $var{'HEADER'};
     $var{'TEMPLATE'} = $Server->MapPath($args->{'href'});
     $Response->Include($var{'TEMPLATE'});
     $Response->Debug("Exited my::template");
}





---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#251 From: "constfilin" <constfilin@...>
Date: Fri Mar 29, 2002 6:43 am
Subject: virtual includes
constfilin@...
Send Email Send Email
 
Greetings -

I'm a newbie to Perl and - so much the more - Apache::ASP,
but when I needed <!--#include virtual=...-> support by
Apache::ASP, all I had to do is changing a couple of lines
in Apache/ASP.pm module. Here's the diff's output :

<DIFF_OUTPUT>
921c921
<     while($munge =~ s/^(.*?)\<!--\#include\s+(file|virtual)
\s*=\s*\"?([^\s\"]*?)\"?(\s+args\s*=\s*\"?.*?)?\"?\s*--\>//so) {
---
>     while($munge =~ s/^(.*?)\<!--\#include\s+file\s*=\s*\"?([^\s\"]
*?)\"?(\s+args\s*=\s*\"?.*?)?\"?\s*--\>//so) {
923c923
<  my $file = ($2 eq "virtual") ? $ENV{"DOCUMENT_ROOT"}.$3 : $3;
---
>  my $file = $2;
950c950
<  my $has_args = $4;
---
>  my $has_args = $3;
</DIFF_OUTPUT>

After that I restarted httpd and virtual inline includes began
working just fine.

The questions:

1. Does my implementation look too easy to be right?
2. Is it a "no-no" to modify the standard ASP.pm module?
3. Is there is a bug in my implementation of virtual includes?
4. Is there is a better, *right* implementation of virtual
    includes in Apache::ASP. If so then what is it?
5. If my implementation is good enough then how do I submit
    a patch to the standard Apache::ASP distribution?

Thanks in advance

Constantine





---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#252 From: "eamondaly" <eamon@...>
Date: Fri Mar 29, 2002 7:59 pm
Subject: Re: virtual includes
eamon@...
Send Email Send Email
 
--- In apache-asp@y..., "constfilin" <constfilin@y...> wrote:
> 4. Is there is a better, *right* implementation of virtual
>    includes in Apache::ASP. If so then what is it?

You can get the same thing using the more ASP-ish:

<% $Response->Include( $Server->MapPath("/foo.html") ) %>

$Server->MapPath will translate a URL to a fill filename. See

   http://www.apache-asp.org/objects.html#%24Response-%3EI2a8df2f3

and

   http://www.apache-asp.org/objects.html#%24Server-%3EMap0fe1ebb5


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#253 From: Joshua Chamas <joshua@...>
Date: Fri Mar 29, 2002 8:53 pm
Subject: Re: Trying to patch Apache::ASP::FormFill
joshua@...
Send Email Send Email
 
eamondaly wrote:
>
> I'm stuck on what should be a pretty simple patch to FormFill. We
> pass data around via QueryString a lot, so I'd like our form fields
> to be prefilled using both $Request->QueryString and $Request->Form.
>

Try this in global.asa:

sub Script_OnStart {
   $Request->{Form} = $Request->{Params};
}

I would like to keep the FormFill functionality filling from
the form only so people do not have any unexpected surprises.
Hopefully the above will work for you.

--Josh
_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#254 From: "eamondaly" <eamon@...>
Date: Fri Mar 29, 2002 9:10 pm
Subject: Re: Trying to patch Apache::ASP::FormFill
eamon@...
Send Email Send Email
 
> Try this in global.asa:
>
> sub Script_OnStart {
>   $Request->{Form} = $Request->{Params};
> }
>
> I would like to keep the FormFill functionality filling from
> the form only so people do not have any unexpected surprises.
> Hopefully the above will work for you.

Works like a dream. Thanks, Joshua. That's /two/ beers I owe you.

________________________________________
Eamon Daly
Director, Web Development - FastWeb, Inc.
(847) 568-6410



---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#255 From: Joshua Chamas <joshua@...>
Date: Sat Mar 30, 2002 3:07 am
Subject: Re: virtual includes
joshua@...
Send Email Send Email
 
constfilin wrote:
>
> Greetings -
>
> I'm a newbie to Perl and - so much the more - Apache::ASP,
> but when I needed <!--#include virtual=...-> support by
> Apache::ASP, all I had to do is changing a couple of lines
> in Apache/ASP.pm module. Here's the diff's output :
>

Virtual includes for Apache::ASP are handled by hooking
Apache::ASP to Apache::SSI with the help of Apache::Filter.
For more about this, please see:

   http://apache-asp.org/config.html#Filter

File includes are handled natively so that the file includes
could be ASP code bits, but virtual includes are handled via
SSI so that the URLs could be referencing things like CGI scripts,
and other non-ASP executables.

--Josh

_________________________________________________________________
Joshua Chamas                           Chamas Enterprises Inc.
NodeWorks Founder                       Huntington Beach, CA  USA
http://www.nodeworks.com                1-714-625-4051

---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

#256 From: Brat Wizard <brat@...>
Date: Sun Mar 31, 2002 11:10 pm
Subject: ASP Modification Suggestion
brat@...
Send Email Send Email
 
Josh-

I would like to propose a minor change to the 'asp' perl program that
comes with Apache::ASP (in builddir/cgi). When the program runs it
expects to find its configuration file in the same directory. This makes
it awkward to load the config.asp file. The changes below add a '-c
<path>' parameter to the asp program to allow the location of the
configuration file to be specified on the command line. This enables
programs such as cron to more easily launch asp-related programs.

Thanks

John Whitten
brat@...
Wizard.Org, Inc.

<diff file follows>

## dir: Apache-ASP-2.31/cgi
## diff asp asp_ORIG > diff_file
13c13
< getopts('hsdbc:o:p:');
---
> getopts('hsdbo:p:');
29d28
<     -c  Where to find the config file (asp.config)
59d57
< my $cfgdir = $opt_c || '.';
61c59
< if(-e "$cfgdir/asp.config") {
---
> if(-e 'asp.config') {
63c61
<     open(CONFIG, "$cfgdir/asp.config") || die("can't open .asp: $!");
---
>     open(CONFIG, 'asp.config') || die("can't open .asp: $!");


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...

Messages 227 - 256 of 2322   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help