[22658] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4879 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 23 14:06:15 2003

Date: Wed, 23 Apr 2003 11:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 23 Apr 2003     Volume: 10 Number: 4879

Today's topics:
        cant connect to remote database (a_wim)
    Re: cant connect to remote database <goedicke@goedsole.com>
        DESPERATE: Win32::OLE Iteration Variable Problem <tim@mcguireland.com>
    Re: English --> Orkish text filter (Arduin)
    Re: file upload not working anymore <jpagnew@vcu.edu>
    Re: file upload not working anymore <hyagillot@tesco.net>
        ftp script <rrunner@san.rr.com>
    Re: ftp script <tony_curtis32@yahoo.com>
    Re: ftp script <rrunner@san.rr.com>
        grep and parse problem <robert.j.sipe@boeing.com>
    Re: grep and parse problem <krahnj@acm.org>
    Re: grep and parse problem <mbudash@sonic.net>
        Newbie asking: How do I start? <gkaraganis@nospam.spireholdings.com>
    Re: Newbie asking: How do I start? <matthew@weierophinney.net>
    Re: Newbie asking: How do I start? <goedicke@goedsole.com>
        OT slightly: mod_perl vs JSP <richard@zync.co.uk>
    Re: OT slightly: mod_perl vs JSP <goedicke@goedsole.com>
    Re: OT slightly: mod_perl vs JSP <ubl@schaffhausen.de>
        Perl and ASp <ddl76@singnet.com.sg>
    Re: Perl and ASp <nospam@raytheon.com>
    Re: Perl and ASp <ddl76@singnet.com.sg>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 23 Apr 2003 07:27:20 -0700
From: a_wim@yahoo.de (a_wim)
Subject: cant connect to remote database
Message-Id: <addcf2d2.0304230627.5852c5b5@posting.google.com>

hi everybody,
im in big trouble, i hope there is anybody who can help me!
i want to connect to a database which is installd on hpux system and i
want to
connect from a sun to this database. on both machins, perl is
installed and the oci driver although. on the sun machine i had
installed the DBI-modul and DBD-modul
the test-skript which were included in the DBD-module-direction works
fine.
now my problem:
i cant connect to the remote database on the hpux, with my own perl
skript !!!!!
what can i do? or which modul i need more? 

thanx for help
bye


------------------------------

Date: Wed, 23 Apr 2003 15:09:44 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: cant connect to remote database
Message-Id: <m34r4pgsi7.fsf@mail.goedsole.com>

Dear a_wim - 

a_wim@yahoo.de (a_wim) writes:

> i had installed the DBI-modul and DBD-modul i cant connect to the
> remote database on the hpux, with my own perl skript !!!!!  what can
> i do? or which modul i need more?

You've got the right modules.  Can you post your code so we can look
for bugs?

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

Finesse not force.

		- William Goedicke


------------------------------

Date: Wed, 23 Apr 2003 10:37:20 -0400
From: "Tim McGuire" <tim@mcguireland.com>
Subject: DESPERATE: Win32::OLE Iteration Variable Problem
Message-Id: <b868fj0v59@enews1.newsguy.com>

I am trying to get a very simple piece of data out....My perl code is below
and the ASP script I am mimicking is blow that...the only problem is when I
get to the enumeration part...I only get one record into the $Project object
(a hash)...The automation library's EnumProjects routine gets a $Iterator
passed to it, which I think is supposed increment by itself as you call the
routine again and again...My code will not work this way...The $Iterator
never gets incremented because the while loop runs forever and always
displays only the first Project Name...I have tried incrementing the
$Iterator myself, I have tried making $Project an Win32::OLE::Enum object
(which gives an error that $Project is not a valid collection object)....I
have tried using the Next method on $Project which runs, but gives a 'member
not found' error....I should have at least four projects....when this
originally happened I added a project...the same thing happened, but my
newly added project name showed up instead of the original one so I believe
the code is good...


 I am pretty sure that the magic iteration variable is not getting
incremented...any help greatly appreciated....I AM STUMPED


 ###PERL CODE
 #
 #


 use Win32::OLE;
 use Win32::OLE::Enum;
 #Win32::OLE->Option(_NewEnum => 1);
 $CrsSrv = Win32::OLE->new("CrsApi.ReplicationServer");
 &OLEErrorCheck;
 $CrsSrv->Initialize("");
 &OLEErrorCheck;
 $Iterator = 0;
 $Project = $CrsSrv->EnumProjects($Iterator) || die "ERROR: " .
Win32::OLE->LastError();
 #$Enum = Win32::OLE::Enum->new($Project);
 #@Projects=$Enum->All;
 while (!Win32::OLE->LastError()) {
    print "Name: " . $Project->Name() . "\n";
    undef $Project;
    $Project = $CrsSrv->EnumProjects($Iterator)
 }

 sub OLEErrorCheck {
    $errorcheck = Win32::OLE->LastError();
    if ($errorcheck) {
       print "\n***ERROR***: $errorcheck";
       return 1;
    }
    else
       {return 0;}
 }


 ############################################
 ###Working ASP Script (CatchAndReportError() sub omitted for brevity)
 #

     Set m_objCrsServer = Server.CreateObject("CrsApi.ReplicationServer")
     Call CatchAndReportError()
     m_objCrsServer.Initialize("")
     If (Err.Number <> 0) Then
       Call CatchAndReportError()
       Exit Sub
     End If
     nIterator = 0
     Set objCrsProject = m_objCrsServer.EnumProjects(nIterator)
     While (Err.Number = 0)
       Response.Write objCrsProject.Name
       Set objCrsProject = Nothing
       Set objCrsProject = m_objCrsServer.EnumProjects(nIterator)
     Wend







------------------------------

Date: 23 Apr 2003 09:14:00 -0700
From: Arduin58@netscape.net (Arduin)
Subject: Re: English --> Orkish text filter
Message-Id: <80d892ce.0304230814.70dc4cbb@posting.google.com>

Nils Petter Vaskinn <no@spam.for.me.invalid> wrote in message news:<pan.2003.04.22.08.55.40.263727.20126@spam.for.me.invalid>...
> We need numerical conversion:
> 
> sub convert_number
> {
<snip>

Ha!! Yes, a good one. Unfortunately it isn't that easy to distinguish between
a simple number and a month day, for example. So "January many" wouldn't make
much sense. (Not that the filter output makes much sense anyway. :-)

--
  Bob


------------------------------

Date: Wed, 23 Apr 2003 09:22:04 -0400
From: Jim Agnew <jpagnew@vcu.edu>
To: Andy Meier <andy@mindpilot.ch>
Subject: Re: file upload not working anymore
Message-Id: <3EA6937C.912DF0CF@vcu.edu>

hhmm... did you "upgrade" your browser???  put in security patches?  ??



Andy Meier wrote:
> 
> >>>> I did not modify the perl program at all. The Plesk hosting panel says
> >>>> that there is still plenty of disc space available. I'm also using the
> >>>> same program on different servers where it still works.
> >>>
> >>>
> >>> In that case what makes you think this is a Perl question?
> >
> > It may be off topic but chances are we've made the mistake.
> >
> >> You are right. It looks like this is a problem on the server side. But
> > since
> >> my provider could not give me an answer in the first place I hoped that
> > some
> >> other perl programmer might have experienced the same problem in the past
> >> and know why this happens. I'll expand my research on the server group as
> >> well...
> 
> > I'd bet 10:1 that its the HTML in the web page sending the data.
> >
> > You haven't mentioned whether you have the "multipart" etc.etc. enctype set.
> 
> Hm, the HTML page looks like this. It's not working with a bare bones
> version of the form or forms/scripts from other programmers either. I also
> tested on different browsers/plattforms and connections: it does not work
> anymore.
> 
> What's bothering me most is, that it always worked until now!
> 
> Andy
> 
> ----
> 
> <html>
> 
>  <head>
>   <title>send new file to server</title>
>  </head>
>  <body bgcolor="#FFFFFF" text="#000000" link="#FF9900" alink="#FF0000"
> vlink="#999999" leftmargin="0" marginwidth="0" topmargin="0"
> marginheight="0">
>   <center>
>    <table border="0" cellpadding="2" cellspacing="0" width="100%"
> bgcolor="#006699">
>     <tr>
>      <td></td>
>      <td><strong><font color="#ffffff">Upload</font></strong></td>
>     </tr>
>    </table>
>    <p>&nbsp;</p>
> 
>    <form name="UploadForm" enctype="multipart/form-data"
> action="/cgi-bin/upload/imgUp2.pl" method="POST">
> 
>     <table border="0" cellpadding="7" cellspacing="0">
>      <tr>
>       <td><font size="5"><strong>1.</strong></font></td>
>       <td>Datei ausw&auml;hlen... (max. 200 kb)</td>
>      </tr>
>      <tr>
>       <td></td>
>       <td><input type="FILE" name="file_to_upload" size="28"></td>
>      </tr>
>      <tr>
>       <td><font size="5"><strong>2.</strong></font></td>
>       <td><input type="submit" value="senden"></td>
>      </tr>
>     </table>
>     <p>
> 
>    </form>
>   </center>
>  </body>
> 
> </html>

-- 
"4,000 years ago I made a mistake."  Elrond Half-Elven, in "Fellowship
of the Ring"


------------------------------

Date: Wed, 23 Apr 2003 17:04:01 +0000 (UTC)
From: "W K" <hyagillot@tesco.net>
Subject: Re: file upload not working anymore
Message-Id: <b86h21$h1q$1@hercules.btinternet.com>


"Andy Meier" <andy@mindpilot.ch> wrote in message
news:BACC485A.4CA0%andy@mindpilot.ch...

ME:
> > I'd bet 10:1 that its the HTML in the web page sending the data.

>    <form name="UploadForm" enctype="multipart/form-data"
> action="/cgi-bin/upload/imgUp2.pl" method="POST">

OK I lose that one.




------------------------------

Date: Wed, 23 Apr 2003 15:47:13 GMT
From: "Danny" <rrunner@san.rr.com>
Subject: ftp script
Message-Id: <5Aypa.36581$va.1376210@twister.socal.rr.com>

I do not know how to write scripts so I am asking for some help. I need to
creat a script that will help me ftp a firmware to over 200 locations. I
want it to do it using linux. Is there a way to do this and can anyone help
me with some direction?

Thanks




------------------------------

Date: Wed, 23 Apr 2003 10:45:00 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: ftp script
Message-Id: <87wuhl8bgj.fsf@limey.hpcc.uh.edu>

>> On Wed, 23 Apr 2003 15:47:13 GMT,
>> "Danny" <rrunner@san.rr.com> said:

> I do not know how to write scripts so I am asking for
> some help. I need to creat a script that will help me
> ftp a firmware to over 200 locations. I want it to do it
> using linux. Is there a way to do this and can anyone
> help me with some direction?

Net::FTP

hth
t


------------------------------

Date: Wed, 23 Apr 2003 15:56:10 GMT
From: "Danny" <rrunner@san.rr.com>
Subject: Re: ftp script
Message-Id: <uIypa.36584$va.1377394@twister.socal.rr.com>

Net::Ftp is what I can use for this purpose. I am really not a perl user but
I have looked on cpan.org and found net::ftp. So do I create a file with a
*.pl extension with the commands for net::ftp for each site I need to do the
ftp to? I would use this command to run the file $perl test-ftp.pl*

Is this correct?


"Tony Curtis" <tony_curtis32@yahoo.com> wrote in message
news:87wuhl8bgj.fsf@limey.hpcc.uh.edu...
> >> On Wed, 23 Apr 2003 15:47:13 GMT,
> >> "Danny" <rrunner@san.rr.com> said:
>
> > I do not know how to write scripts so I am asking for
> > some help. I need to creat a script that will help me
> > ftp a firmware to over 200 locations. I want it to do it
> > using linux. Is there a way to do this and can anyone
> > help me with some direction?
>
> Net::FTP
>
> hth
> t




------------------------------

Date: Wed, 23 Apr 2003 14:28:18 GMT
From: "Robert" <robert.j.sipe@boeing.com>
Subject: grep and parse problem
Message-Id: <HDsw76.KAv@news.boeing.com>

I am using 'grep' to parse several lines from an array (@symarray).  The
snipet of code gets me 90% of what I want.  I am pattern matching $SGVG
(which might have the value of 78090000) and pushing in the two lines into
@list.  What I want to do is push just the first elements (/dev/dsk/cXtYdZ)
into list.  I have tried several methods using map and split (one example is
commented out) but in either case I get the entire line or nothing.  My code
and data are as follows:

Snipet of code:

   foreach $VG (keys %VGS) {
      foreach $SGVG (@{$VGS{$VG}}) {
         print  "$VG is $SGVG\n";
         @list =  grep { /$SGVG/ } @symarray;
#         @newlist = map { [ /(\/dev\/dsk\/c).*/,$_ ] } @list;
         push(@$VG,@list);
      }
   }

Data: @symarray =

/dev/rdsk/c3t0d3   M(3) EMC       SYMMETRIX        5567 7806C000  17844480
/dev/rdsk/c3t0d4   M(3) EMC       SYMMETRIX        5567 78090000  17844480
/dev/rdsk/c3t0d5   M(3) EMC       SYMMETRIX        5567 780B4000  17844480
 .
 .250 lines removed here for brevity

/dev/rdsk/c31t0d4   M(3) EMC       SYMMETRIX        5567 78090000  17844480
/dev/rdsk/c32t0d5   M(3) EMC       SYMMETRIX        5567 780B4000  17844480
 .
 .250 lines removed here for brevity.
 .

I am sure this is not difficult but I am stumped.  Thanx in advance.






------------------------------

Date: Wed, 23 Apr 2003 15:28:57 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: grep and parse problem
Message-Id: <3EA6B127.CF29604D@acm.org>

Robert wrote:
> 
> I am using 'grep' to parse several lines from an array (@symarray).  The
> snipet of code gets me 90% of what I want.  I am pattern matching $SGVG
> (which might have the value of 78090000) and pushing in the two lines into
> @list.  What I want to do is push just the first elements (/dev/dsk/cXtYdZ)
> into list.  I have tried several methods using map and split (one example is
> commented out) but in either case I get the entire line or nothing.  My code
> and data are as follows:
> 
> Snipet of code:
> 
>    foreach $VG (keys %VGS) {
>       foreach $SGVG (@{$VGS{$VG}}) {
>          print  "$VG is $SGVG\n";
>          @list =  grep { /$SGVG/ } @symarray;
> #         @newlist = map { [ /(\/dev\/dsk\/c).*/,$_ ] } @list;
>          push(@$VG,@list);
>       }
>    }

push @$VG, grep { /\b$SGVG\b/ and $_ = (split)[0] } @symarray;


John
-- 
use Perl;
program
fulfillment


------------------------------

Date: Wed, 23 Apr 2003 15:56:48 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: grep and parse problem
Message-Id: <mbudash-DCC89C.08564923042003@typhoon.sonic.net>

In article <HDsw76.KAv@news.boeing.com>,
 "Robert" <robert.j.sipe@boeing.com> wrote:

> I am using 'grep' to parse several lines from an array (@symarray).  The
> snipet of code gets me 90% of what I want.  I am pattern matching $SGVG
> (which might have the value of 78090000) and pushing in the two lines into
> @list.  What I want to do is push just the first elements (/dev/dsk/cXtYdZ)
> into list.  I have tried several methods using map and split (one example is
> commented out) but in either case I get the entire line or nothing.  My code
> and data are as follows:
> 
> Snipet of code:
> 
>    foreach $VG (keys %VGS) {
>       foreach $SGVG (@{$VGS{$VG}}) {
>          print  "$VG is $SGVG\n";
>          @list =  grep { /$SGVG/ } @symarray;
> #         @newlist = map { [ /(\/dev\/dsk\/c).*/,$_ ] } @list;
>          push(@$VG,@list);
>       }
>    }
> 
> Data: @symarray =
> 
> /dev/rdsk/c3t0d3   M(3) EMC       SYMMETRIX        5567 7806C000  17844480
> /dev/rdsk/c3t0d4   M(3) EMC       SYMMETRIX        5567 78090000  17844480
> /dev/rdsk/c3t0d5   M(3) EMC       SYMMETRIX        5567 780B4000  17844480
> .
> .250 lines removed here for brevity
> 
> /dev/rdsk/c31t0d4   M(3) EMC       SYMMETRIX        5567 78090000  17844480
> /dev/rdsk/c32t0d5   M(3) EMC       SYMMETRIX        5567 780B4000  17844480
> .
> .250 lines removed here for brevity.
> .
> 
> I am sure this is not difficult but I am stumped.  Thanx in advance.

no need for the @list (or @newlist) vars at all:

foreach $VG (keys %VGS) {
  foreach $SGVG (@{$VGS{$VG}}) {
     print  "$VG is $SGVG\n";
     push(@$VG, (split /\s+/)[0]) foreach grep { /$SGVG/ } @symarray;
  }
}

hth-

-- 
Michael Budash


------------------------------

Date: Wed, 23 Apr 2003 14:42:38 +0100
From: "GMK" <gkaraganis@nospam.spireholdings.com>
Subject: Newbie asking: How do I start?
Message-Id: <GLwpa.67$4n1.16@newsr2.u-net.net>

Hi guys,

I am interested in getting into Perl but do not know where to start from. I
have access to the O' Reily books. Should I read those first or jump into
perl.org?

Many thanks,

G.




------------------------------

Date: Wed, 23 Apr 2003 14:43:57 GMT
From: Matthew Weier O'Phinney <matthew@weierophinney.net>
Subject: Re: Newbie asking: How do I start?
Message-Id: <slrnbad9ld.oc.matthew@kavalier.weierophinney.net>

* GMK <gkaraganis@nospam.spireholdings.com>:
> I am interested in getting into Perl but do not know where to start from. I
> have access to the O' Reily books. Should I read those first or jump into
> perl.org?

Both. I highly recommend "Learning Perl", and then going into
"Programming Perl" (particularly for a good discussion of regular
expressions). Going onto the various perl websites (learn.perl.org,
perlmonks.org, etc.) will help give you more context.

-- 
Matthew Weier O'Phinney
matthew@weierophinney.net
http://matthew.weierophinney.net


------------------------------

Date: Wed, 23 Apr 2003 15:06:24 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: Newbie asking: How do I start?
Message-Id: <m38yu1gsnr.fsf@mail.goedsole.com>

Dear G. - 

"GMK" <gkaraganis@nospam.spireholdings.com> writes:

> I am interested in getting into Perl but do not know where to start from.

A very wise friend of mine was once asked "How do I become a perl
programmer like you?".  He responded "Well, a perl programmer is
someone who writes perl programs; so go ahead and write some."

I would suggest that you install perl on your computer, get the
O'Reilly "Learning Perl" book and start writing some code.  You should
probably get yourself a decent programmer's text editor as well.  I
suggest xemacs from http://www.xemacs.org.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

You can "see" the clams.

		- Pauline Goedicke (aka Nana)


------------------------------

Date: Wed, 23 Apr 2003 15:50:23 +0100
From: "Richard Gration" <richard@zync.co.uk>
Subject: OT slightly: mod_perl vs JSP
Message-Id: <20030423.155022.1671581032.18265@richg.zync>

Hi All

I have a biggish (~15000 lines) web application written as cgis, and not
surprisingly it's suffering from speed issues. (Don't start. If you had to
develop in the environment I do, it would take you 2 weeks to learn to
maintain a train of thought long enough to write "Hello world". Spec? We
don't need no steenking spec ...)

I'm going to rewrite it now, mainly to improve performance. My intention
was to convert to Apache modules, implement a cache, persistent db
connections and some other goodies, possibly even moving the
computationally intensive bits into C. But my boss has mentioned JSP, so
now I have a choice to make. I've done a bit of reading and it seems that
the major advantages of JSP over CGI cease to be relevant in comparison to
Apache modules eg. startup overhead, access to web server internals, etc.

I know there are some Perl monks out there who are unfaithful ;-) every
now and then, and I would very much appreciate anything you have to say.
Portability is not an issue, speed and maintainability of code is.

Thanks for listening
Rick


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


------------------------------

Date: Wed, 23 Apr 2003 15:16:32 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: OT slightly: mod_perl vs JSP
Message-Id: <m3znmhfdmf.fsf@mail.goedsole.com>

Dear Richard - 

"Richard Gration" <richard@zync.co.uk> writes:

> my boss has mentioned JSP, so now I have a choice to make. I've done
> a bit of reading and it seems that the major advantages of JSP over
> CGI cease to be relevant in comparison to Apache modules

Don't overlook the issue of in-house skills.  If you and your fellow
employees are already skilled at perl but not java, then you'll save a
lot of time and money by not trying to employ new, foreign technology.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

Good management involves five activities:

	o Facilitate your staff's efforts by removing organizational
	  impediments.

	o Identify each staff member's strengths and goals 
	  and veer their responsibilities towards them.

	o Assign responsibility with commensurate authority.

	o Set realistic expectations in your customers.

	o Evangelize your services.

		- William Goedicke


------------------------------

Date: Wed, 23 Apr 2003 17:19:19 +0200
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: OT slightly: mod_perl vs JSP
Message-Id: <b86e30$cip$1@news.dtag.de>

Richard Gration wrote:
> Hi All
> 
> I have a biggish (~15000 lines) web application written as cgis, and not
> surprisingly it's suffering from speed issues. (Don't start. If you had to
> develop in the environment I do, it would take you 2 weeks to learn to
> maintain a train of thought long enough to write "Hello world". Spec? We
> don't need no steenking spec ...)
> 
> I'm going to rewrite it now, mainly to improve performance. My intention
> was to convert to Apache modules, implement a cache, persistent db
> connections and some other goodies, possibly even moving the
> computationally intensive bits into C. But my boss has mentioned JSP, so
> now I have a choice to make. I've done a bit of reading and it seems that
> the major advantages of JSP over CGI cease to be relevant in comparison to
> Apache modules eg. startup overhead, access to web server internals, etc.
> 
> I know there are some Perl monks out there who are unfaithful ;-) every
> now and then, and I would very much appreciate anything you have to say.
> Portability is not an issue, speed and maintainability of code is.

Can't say much about the comparisson to JSP. As far as I'm concerned the 
choice of web application technology is only a matter of taste.

Did you look into using Apache::Registry? It could be your killer app if 
you want to reuse your old code (if the old code is half way sane). It 
could gain you more speed instantly and you could do the conversion to 
real mod_perl with maximum performance afterwards.

I just did some studying about Apache JServ (Apache's old servlet 
engine). The result might have changed with the advent of faster Java 
runtimes but the article on the apache site says that mod_perl is likely 
to be faster than JServ.

 From my experience mod_perl sites can be a breeze to maintain; however, 
that really has to do nothing with mod_perl and all with your 
programming style.

Bye,
->malte


-- 
srand 108641088; print chr int rand 256 for qw<J A P H>



------------------------------

Date: Wed, 23 Apr 2003 21:38:24 +0800
From: "ldd" <ddl76@singnet.com.sg>
Subject: Perl and ASp
Message-Id: <b8647u$ttu$1@reader01.singnet.com.sg>

Hi,

I need to extract data from a ASP page which contains users registration
information and pass the parameters to Perl for validation. If everything is
Ok. then it will be passwd back to ASP and updated to the database.

Anyone knows how to mix Perl and ASP to do the above?.

Thanks




------------------------------

Date: Wed, 23 Apr 2003 09:07:11 -0500
From: Chris Olive <nospam@raytheon.com>
Subject: Re: Perl and ASp
Message-Id: <k9xpa.335$35.792@dfw-service2.ext.raytheon.com>

ldd wrote:
> Hi,
> 
> I need to extract data from a ASP page which contains users registration
> information and pass the parameters to Perl for validation. If everything is
> Ok. then it will be passwd back to ASP and updated to the database.
> 
> Anyone knows how to mix Perl and ASP to do the above?.
> 
> Thanks
> 

Well, I guess one way would be to make the ACTION= option on your ASP 
form point to your Perl script.  When the form is submitted, it runs 
your Perl CGI script.  Then when your Perl script is done have it return 
to an ASP page via a redirect of some sort.  JS redirection or a 
Location: redirect with a GET URL.  There are a number of ways to do 
this.  This is one.

In your ASP form:

<form name="Form1" method="POST" action=/cgi-bin/my-perl-script.cgi">
<yada-yada></yada-yada>
<input type="submit" value="Do Perl Extraction">
</form>

In your Perl script:

print "Location: /return-to.asp?var1=1&var2=2&var3=3&etc\n\n";


If you are wanting to use Perl for this one thing because it is way more 
powerful than VBScript and JScript at doing data manipulation, see if 
you can install PerlScript and write your one ASP page in PerlScript and 
then you never have to CGI at all.  Everything stays Classic ASP.  If 
you are using sessions or one of the other Classic ASP objects, you 
maintain direct access to all those objects via PerlScript.

But mixing CGI and ASP is totally possible to do as above or in a few 
other ways.

Chris
-----
Chris Olive
Systems Consultant
Raytheon Technical Services Corporation
Indianapolis, IN

email: olivec(AT)indy(DOT)raytheon(DOT)com



------------------------------

Date: Wed, 23 Apr 2003 23:48:31 +0800
From: "ldd" <ddl76@singnet.com.sg>
Subject: Re: Perl and ASp
Message-Id: <b86bs0$ut8$1@reader01.singnet.com.sg>

Thanks I tried to incorporate Perlscript in ASP but it doesn't work not sure
why.

I modified instructions from here but it still doesn't work. Basically after
a parameter like $name is passed into the Perlscript, an if statement is
used to check if its "ddl". But the parameter is not compared correctly. I
even tried to print out the value from the Perlscript section and it even
cannot be printed.

I'm desparate Can anyone kind soul in this world help me. Thanks a million
and billi.....

Following is a simple ASP document that contains a PerlScript function, and
VBScript code that calls it:

1    <% @LANGUAGE="VBSCRIPT" %>
2    <script language="PerlScript" runat="server">
3    sub sayHello {
4    # This function takes two parameters, creates a string
5    # from the parameters, and returns the string.
6
7     # get the two parameters into local variables
8     my ($strName, $strTime) = @_;
9     #now, create the return string.
10    $strRetVal="Hello $strName. The time is $strTime.";
11
12    # Return the string
13    $strRetVal;
14   }
15   </script>
16   <html>
17   <head>
18   <title>Test of a PerlScript function being called from VBScript</title>
19   </head>
20   <body>
21   <h2>Test of a PerlScript function being called from VBScript</h2>
22   <%
23
24    strOutput=sayHello("Richard",Now & "")
25    Response.Write strOutput & "<br>"
26   %>
27
28
29   <p><%
30   '-- asp stub
31   if (Request("CloseMe")) then
32   %>
33   </p>
34   <form method="POST" action="" onsubmit="return false">
35    <p><input type="button" value="Close" onclick="self.close();"></p>
36   </form>
37   <p><%
38   end if
39   '-- asp stub
40   %>
41   </p>
42
43
44
45   </body>
46   </html>






"Chris Olive" <nospam@raytheon.com> wrote in message
news:k9xpa.335$35.792@dfw-service2.ext.raytheon.com...
> ldd wrote:
> > Hi,
> >
> > I need to extract data from a ASP page which contains users registration
> > information and pass the parameters to Perl for validation. If
everything is
> > Ok. then it will be passwd back to ASP and updated to the database.
> >
> > Anyone knows how to mix Perl and ASP to do the above?.
> >
> > Thanks
> >
>
> Well, I guess one way would be to make the ACTION= option on your ASP
> form point to your Perl script.  When the form is submitted, it runs
> your Perl CGI script.  Then when your Perl script is done have it return
> to an ASP page via a redirect of some sort.  JS redirection or a
> Location: redirect with a GET URL.  There are a number of ways to do
> this.  This is one.
>
> In your ASP form:
>
> <form name="Form1" method="POST" action=/cgi-bin/my-perl-script.cgi">
> <yada-yada></yada-yada>
> <input type="submit" value="Do Perl Extraction">
> </form>
>
> In your Perl script:
>
> print "Location: /return-to.asp?var1=1&var2=2&var3=3&etc\n\n";
>
>
> If you are wanting to use Perl for this one thing because it is way more
> powerful than VBScript and JScript at doing data manipulation, see if
> you can install PerlScript and write your one ASP page in PerlScript and
> then you never have to CGI at all.  Everything stays Classic ASP.  If
> you are using sessions or one of the other Classic ASP objects, you
> maintain direct access to all those objects via PerlScript.
>
> But mixing CGI and ASP is totally possible to do as above or in a few
> other ways.
>
> Chris
> -----
> Chris Olive
> Systems Consultant
> Raytheon Technical Services Corporation
> Indianapolis, IN
>
> email: olivec(AT)indy(DOT)raytheon(DOT)com
>




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 4879
***************************************


home help back first fref pref prev next nref lref last post