Re: return(bless $rant, $class) || Fwd: PHP vs Perl

2003-07-30 Thread Ovid
--- drieux [EMAIL PROTECTED] wrote:
 Ovid,
 
 I love the smell of 'primate-ism' 
 
 It could be merely the way that you are presenting the
 problem - and a desire to defend an anachronistic model
 of MVC, based upon the underlying 'primate-ism', and
 the scary thought of 'recursion' in conceptual models
 that might mean sticking the primate in a chair, and
 leaving the heavy lifting to sentient life forms.
[snip]

Hi drieux,

Clearly I need to read my email more frequently.  It looks like there was a bit of a
miscommunication and in rereading what I originally wrote, I think the problem lies in 
my assuming
too much background information and, as a result, not explaining as much as I should 
have.  I've
been bitten by that before and I can only apologize and offer the following 
clarification:

The only point that I was intending to make was that the MVC model that people discuss 
had it's
roots in the MVC model as described by the GoF (Gang of Four -- the Design Patterns 
authors) and
if people are learning about MVC from the discussion on this list, it is probably a 
good thing
that they know a bit of the history of said pattern rather than assume that it was 
coughed up from
the void fully formed in the way that it's being discussed on this list.

I am not saying that the GoF presented the only correct view of how MVC should work 
(in fact, I
object to a common interpretation that DP can only be used for OO languages).  
However, the
original point of Design Patterns (the architectural ones preceeding the programmatic 
ones) was to
give people a common vocabulary so they can discuss a situation and know what each 
other is
talking about.

I'm sure plenty of us have had conversations where we say foo, the other person says 
foo, but
the conversation goes nowhere.  That's quite often due to each person having a 
different
conceptual idea of what foo is.  If the people on this list are handed a version of 
MVC for the
Web and have no idea of the history and origins of said pattern, then someone who only 
knows it
from the GoF description is going to have a very confused conversation with someone 
who doesn't
know the GoF description.  No either description is necessarily good or bad, but they 
have
significantly different implementations and that's an important difference.  
Considering that
another name for the MVC pattern is the Observer and that the term Observer 
doesn't make much
sense when using the Web, I think that's important to know.

In other words, if everyone starts using similar terms, they should have similar 
meanings or at
least know where their definitions differ.  That's all I meant.

Sorry for the confusion.

Cheers,
Ovid

=
Silence is Evilhttp://users.easystreet.com/ovid/philosophy/indexdecency.htm
Ovid   http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl  http://users.easystreet.com/ovid/cgi_course/

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does CGI.pm handles Content-type: text/html\n\n ?

2003-07-30 Thread LI NGOK LAM
What I actually trying to do is to make the error send to my mail
box ( at this moment ) while my script is running in public. So it does 
a little more then die, but I still trying to keep the command line simple.
looks like unless $something or die  

My code is some what like this :
package CGI::Fatals;

require Exporter;
our @ISA = qw (Exporter);
our @EXPORT = qw /die warn/;

use strict;
use mail2me; # my pm
use ContentType; # my pm

sub die
{ContentType ('text/html') unless $ENV{contenttype};
print @_;
mail2me (@_);
exit (0);
}

sub warn
{ .. }

$main::SIG{__DIE__} = \die;
$main::SIG{__WARN__} = \warn;

 EOS 

I don't know if that's similar to pass the die message to a sub
or which is better. As a beginner (me), I would like to ask, 
which is better, or does my concept or direction is going wrong 
or not.

- Original Message - 
From: drieux [EMAIL PROTECTED]
To: cgi cgi-list [EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 10:37 AM
Subject: Re: How does CGI.pm handles Content-type: text/html\n\n ?


 
 On Tuesday, Jul 29, 2003, at 18:36 US/Pacific, LI NGOK LAM wrote:
 [..]
 
  So.. if I create my own style of fatalsToBrowser.
  Is that possible to do in this way :
 
 [..]
 
 The reason that 'fatalsToBrowser' and the rest came about
 is because many perl modules are built on 'die' or 'Carp'.
 
 And that 'die' would make the foo.cgi code 'exit abruptly'
 and that would generate a 500 error.
 
 So if the code you are building on does not do a 'die',
 'Carp', 'Croak' - then you really do not need to 'worry about it'.
 
 What you will want to learn about is how to set a local
 signal handler - if you want to write your own. I built
 some stuff ontop of some code that I knew had a series
 of places where it would invoke 'die' - since that code
 was not 'designed for the web' and in those case 'dying'
 was a good thing - so the wrapper call solves it:
 
   sub wrapper_call
   {
 my ($me,$host_port,$uri,$q) = @_;
 
 our ($page,$h) ;
 our $wrapper_flag = 0;
 our $bytes_read = 0;
 
 eval {
 
 local $SIG{'__DIE__'} = sub { $wrapper_flag = 1;} ;
 
 ($bytes_read, $page, $h ) =
 get_from_server($host_port, $uri, $q);
 };
 
 return({ run_time_error =
 Problems connecting to $host_port got status: $@ }
 ) if ( $wrapper_flag );
 
 return({ run_time_error =
 Server $host_port Returned: $h-{dtk_status}})
 if ($h-{dtk_status} !~ /OK/);
 
 return $page if ($bytes_read);
 \$page;
 
   } # end of wrapper_call
 
 In this case the caller either gets the reference to the
 page, or a reference to a hash, that has the 'run_time_error'
 message in it...
 
 This way if the caller wants to report out the error case
 then they can do that, or they can also decide that they
 do not care that the error occurred, and go on to some
 other strategy...
 
 ciao
 drieux
 
 ---
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Where's the Perl jobs, baby?

2003-07-30 Thread Camilo Gonzalez
I'm not sure if this question has been asked before but it may never be 
as relevant. I'm a Perl programmer trying to survive the Bush recession. 
What's a good resource for finding jobs? All I ever see are job listings 
for that icky Microsoft stuff. What options are open to the nattering 
contrarian? Has anyone on this list been affected by outsourcing yet? 
Are Perl people as vulnerable?

If this query is totally off base, please don't hesitate to tell me so 
(somehow, I don't think that will be a problem). However, I believe this 
list is supposed to be a resource and I don't think the employment issue 
is necessarily off base.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[OT] Re: Where's the Perl jobs, baby?

2003-07-30 Thread Casey West
It was Wednesday, July 30, 2003 when Camilo Gonzalez took the soap box, saying:
: I'm not sure if this question has been asked before but it may never be 
: as relevant. I'm a Perl programmer trying to survive the Bush recession. 
: What's a good resource for finding jobs? All I ever see are job listings 
: for that icky Microsoft stuff. What options are open to the nattering 
: contrarian? Has anyone on this list been affected by outsourcing yet? 
: Are Perl people as vulnerable?

http://jobs.perl.org

Good luck!

: If this query is totally off base, please don't hesitate to tell me so 
: (somehow, I don't think that will be a problem). However, I believe this 
: list is supposed to be a resource and I don't think the employment issue 
: is necessarily off base.

Um, it's off base, but not a problem.  :-)

  Casey West

-- 
Shooting yourself in the foot with Oracle
You decide to shoot yuourself in the foot and go out to buy a gun -
except the gun won't work without deploying a shoulder holster
solution, and relational titanium alloy bullets, and body armour
infrastructure, and a laser sight assistant, and a retractable arm
stock application, and an enterprise team of ballistics experts and a
chiropodist.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AS/400 and Comsoft systems

2003-07-30 Thread Dennis Stout
Heyuck Heyuck.

So I'm told I need to write a simple database to handle ticketing information
for customers when they call.

Things like DSL problems, dialup problems... nothing major.  MySQL database
backend with a perl powered web frontend.

Then I was told it needs to go htrough a VPN.  Cool, not my department, I send
them off to SysAdmin to do that.

Now I'm told I have to make it talk to 2 more SQL servers, an Oracle server,
an LDAP server, a Comsoft system, and an AS/400.

Is this possible with Perl or am I needing to find a solution deeper rooted
then a CGI script?

The current simple ticket system runs under mod_perl

Dennis

*SIGH*  need beer.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Help with page reloads

2003-07-30 Thread Johnstone, Colin
Hi all,

I am writing my own form processing script as a learning exercise and
want to know how to reload the page after processing the form to clear
the forms processor, to prevent the user from refreshing the page and
duplicating their submission.

Im a PHP guy normally and just simply type the following to reload the
page.

header('Location: index.php?message=on');

I have tried the following in PERL

But all it does is output to the screen.

print 'Location: http://www.mydomain.com/cgi-bin/myform.cgi';

Thanking you in anticipation
Colin Johnstone
**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help with page reloads

2003-07-30 Thread Wiggins d'Anconia
Johnstone, Colin wrote:
Hi all,

I am writing my own form processing script as a learning exercise and
want to know how to reload the page after processing the form to clear
the forms processor, to prevent the user from refreshing the page and
duplicating their submission.
Im a PHP guy normally and just simply type the following to reload the
page.
header('Location: index.php?message=on');

I have tried the following in PERL

But all it does is output to the screen.

print 'Location: http://www.mydomain.com/cgi-bin/myform.cgi';

This should work, if it is displaying in the browser then you have 
already printed a header usually a Content-type: text/html... You should 
not have both...

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: AS/400 and Comsoft systems

2003-07-30 Thread Todd W.

Dennis Stout [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Heyuck Heyuck.

 So I'm told I need to write a simple database to handle ticketing
information
 for customers when they call.

 Now I'm told I have to make it talk to 2 more SQL servers, an Oracle
server,
 an LDAP server, a Comsoft system, and an AS/400.

 Is this possible with Perl or am I needing to find a solution deeper
rooted
 then a CGI script?


Sure its possible. Just go to CPAN, install the interfaces to each type of
storage system, and then in your program connect to each data source. You
said you will be connecting to 3 data sources, so you will have 3 objects
representing each connection.

There are already interfaces to the most common SQL databases. Theres also a
perl LDAP interface. You may have to build your own interfaces for the
Comsoft and AS/400 applications if you must access them with perl. The way
you do this is by creating perl wrappers to the C api that comes with your
data stores.

see: perldoc perlxstut

I would create a custom object that stores each object as a property. This
will make managing the connection objects easier.

Todd W.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help with page reloads

2003-07-30 Thread Wiggins d'Anconia
Always group reply so everyone can help and be helped.

Johnstone, Colin wrote:

Thank You,

I tried this but with no success

#!/usr/bin/perl -w

print 'Location: http://www.mydomain.com/cgi-bin/myform.cgi';

You need to indicate the end of the headers with a double new line:

print Location: http://danconia.org\n\n;;

Then the browser will know to start doing its job and how to do it.

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Help with page reloads

2003-07-30 Thread Johnstone, Colin
It works!, Thank you for your help

-Original Message-
From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 31 July 2003 2:50 PM
To: Johnstone, Colin; [EMAIL PROTECTED]
Subject: Re: Help with page reloads


Always group reply so everyone can help and be helped.

Johnstone, Colin wrote:

 Thank You,
 
 I tried this but with no success
 
 #!/usr/bin/perl -w
 
 print 'Location: http://www.mydomain.com/cgi-bin/myform.cgi';
 

You need to indicate the end of the headers with a double new line:

print Location: http://danconia.org\n\n;;

Then the browser will know to start doing its job and how to do it.

http://danconia.org

**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]