Re: XML Output to Web

2006-05-10 Thread Bruno Georges
Hi Carter

I suggest you have a look at the following XML modules:

In your scipt, these module should suffice.

use XML::Parser;
use XML::Simple;
# mod to convert from/to other output
use XML::Dumper;
use CGI::XML;


they should cover the basic XML parsing and generation requierment you
have.

There are other XML modules out of XML:: which are designed to writing
generic XML
XML::Generator
XML::Grove
XML::Writer

I haven't used them much recently but the modules documentation is great
and provides plenty of examples.

to get the doc for these modules, you can use for example:
on unix
man XML::Dumper
or on any OS
perldoc

hope this helps.

With Best Regards
Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


|-+-
| |   Carter Thompson   |
| |   [EMAIL PROTECTED]   |
| |   Sent by:  |
| |   [EMAIL PROTECTED]|
| |   veState.com   |
| | |
| | |
| |   09.05.06 21:28|
| | |
|-+-
  
--|
  | 
 |
  |To:  Perl Users perl-win32-users@listserv.ActiveState.com  
 |
  |cc:  
 |
  |Subject: XML Output to Web   
 |
  | 
 |
  |Distribute:  
 |
  |Personal?   |---|
 |
  || [ ] x |
 |
  ||---|
 |
  | 
 |
  
--|





Hi,

I need a little help finding a module that will write XML to a
webpage.  More specifically,
I have a CGI script that gathers information based on user input and
when all information
is collected I'd like to spit out XML for the user to cut and paste
into their favorite text editor.

Now, I could write all the special characters (gt, lt, amp, etc)
out to the page but that's
a hassle and I'm fairly certain someone's already done this before.

Any suggestions on what module to use to print XML to my page?

Thanks,

Carter.


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




LEGAL DISCLAIMER. The contents of this e-mail and any attachments are strictly
confidential and they may not be used or disclosed by someone who is not a
named recipient.
If you have received this email in error please notify the sender by replying
to this email inserting the word misdirected as the message and delete this
e-mail from your system.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: XML Output to Web

2006-05-10 Thread Bruno Georges
Hi Carter

I believe that there are perl modules that just does exactly that, helping
you to escape the generated XML.

In the meantime you can test your output with the (deprecated but still
supported) HTML tag: xmp

so your code XML will look like:
xmp
projectname=foobardefault=xyzbasedir=. /
/xmp

 With Best Regards
Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


|-+---
| |   Carter Thompson |
| |   [EMAIL PROTECTED]|
| |   ri.net |
| |   |
| |   10.05.06 16:13  |
| |   |
|-+---
  
--|
  | 
 |
  |To:  Bruno Georges [EMAIL PROTECTED]   
|
  |cc:  Perl Users perl-win32-users@listserv.ActiveState.com  
 |
  |Subject: Re: XML Output to Web   
 |
  | 
 |
  |Distribute:  
 |
  |Personal?   |---|
 |
  || [ ] x |
 |
  ||---|
 |
  | 
 |
  
--|





Thanks, Bruno.

I've been using XML::Writer to generate the XML and that works well.
Problem is I need to
display the generated XML code in a browser.   To display the code
you generally need to
escape the special characters, like the '  ' (gt, lt amp) which
is where I have the problem.
XML::Writer creates well formed XML, which is great, but I need to
create XML for displaying
in a browser.

So, instead of generating this:

projectname=foobardefault=xyzbasedir=. /

I need this:

ltprojectname=foobardefault=xyzbasedir=. /gt

I've looked at most of the modules you've listed but I haven't yet
found one that generates
escaped XML.

Guess I'll keep looking or write the XML myself.

Thanks again.

Carter.


On May 9, 2006, at 11:20 PM, Bruno Georges wrote:

 Hi Carter

 I suggest you have a look at the following XML modules:

 In your scipt, these module should suffice.

 use XML::Parser;
 use XML::Simple;
 # mod to convert from/to other output
 use XML::Dumper;
 use CGI::XML;


 they should cover the basic XML parsing and generation requierment you
 have.

 There are other XML modules out of XML:: which are designed to writing
 generic XML
 XML::Generator
 XML::Grove
 XML::Writer

 I haven't used them much recently but the modules documentation is
 great
 and provides plenty of examples.

 to get the doc for these modules, you can use for example:
 on unix
 man XML::Dumper
 or on any OS
 perldoc

 hope this helps.

 With Best Regards
 Bruno Georges

 Glencore International AG
 Tel. +41 41 709 3204
 Fax +41 41 709 3000


 |-+-
 | |   Carter Thompson   |
 | |   [EMAIL PROTECTED]   |
 | |   Sent by:  |
 | |   [EMAIL PROTECTED]|
 | |   veState.com   |
 | | |
 | | |
 | |   09.05.06 21:28|
 | | |
 |-+-
 -
 -|

 |
  |
   |To:  Perl Users perl-win32-
 [EMAIL PROTECTED]
 |
   |
 cc:
 |
   |Subject: XML Output to
 Web
  |

 |
  |
   |
 Distribute:
 |
   |Personal

RE: I need your opinion: perl vs php

2006-02-28 Thread Bruno Georges
Jaime,

Pardon me if this is out of the scope of your request , but having used
PHP, Perl , Java , C and Ruby for Web projects,
when dealing with heavy DB accesses, I would consider using Java.

Jboss[or Tomcat] comes to mind, it is also in line with your Opensource
strategy.

Security wise you can front it with apache and configure it to the level of
security your app requires [in addition to HTTPS,etc..].

Hopes this helps.

With Best Regards
Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


|-+-
| |   Chris   |
| |   [EMAIL PROTECTED]  |
| |   Sent by:  |
| |   [EMAIL PROTECTED]|
| |   veState.com   |
| | |
| | |
| |   27.02.06 16:43|
| | |
|-+-
  
--|
  | 
 |
  |To:  'Jaime Teng' [EMAIL PROTECTED], 
perl-win32-users@listserv.ActiveState.com 
   |
  |cc:  
 |
  |Subject: RE: I need your opinion: perl vs php
 |
  | 
 |
  |Distribute:  
 |
  |Personal?   |---|
 |
  || [ ] x |
 |
  ||---|
 |
  | 
 |
  
--|




I am in the process of planning a huge project.
It will be web based with heavy database accesses.

Since I am have more programming experience with Perl,
I prefer using it. However several people have suggested
using PHP + MySQL + Apache combo.

If you are given the choice, what will you choose?

a) MySQL + Perl + modPerl + Apache + Linux
or
b) MySQL + PHP + Apache + Linux

I hope you could give me some of the insights I dont know
about the two in terms of program efficiency as well as
maintainability.

regards,
Jaime

---


One of the biggest points of concern is security. When a script is written
correctly in perl, it's fairly bulletproof. I personally would not use PHP
for anything that could cause legal problems or loss of revenue if/when
it's
hacked.

- Chris


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




LEGAL DISCLAIMER. The contents of this e-mail and any attachments are strictly
confidential and they may not be used or disclosed by someone who is not a
named recipient.
If you have received this email in error please notify the sender by replying
to this email inserting the word misdirected as the message and delete this
e-mail from your system.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Hello! Help me please!

2006-01-05 Thread Bruno Georges
Hi Try changing your code to something formatted this way:
FROM:
if(!(m~^http://~))
{
  $url='http://127.0.0.1/'.$_ ;
  $content=getContent($url);
  printEOF;
  content of this $url is:
  $content
  EOF
}

to:
if(!(m~^http://~))
{
  $url='http://127.0.0.1/'.$_ ;
  $content=getContent($url);
print EOF;
content of this $url is:
$content
EOF
}

I tried it works for me.

Hope this helps.


Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


|-+-
| |   gao perlone [EMAIL PROTECTED]|
| |   Sent by:  |
| |   [EMAIL PROTECTED]|
| |   veState.com   |
| | |
| | |
| |   05.01.06 13:13|
| | |
|-+-
  
--|
  | 
 |
  |To:  Perl-Win32-Users@listserv.ActiveState.com   
 |
  |cc:  
 |
  |Subject: Hello! Help me please!  
 |
  | 
 |
  |Distribute:  
 |
  |Personal?   |---|
 |
  || [ ] x |
 |
  ||---|
 |
  | 
 |
  
--|




I compile the fellowing perl program and meet a problem:

use HTTP::Request;
use LWP::UserAgent;

$content=getContent('http://127.0.0.1/index.htm');
@html=split(/\n/,$content);
for(@html)
{
  do
  {
$2 and push(@link,$2);
  }while m
{
  \s*A\s+HRE\s*=\s*(['''])(.*?)\l\s*
}gsix;
  print All links in this page:\n;
  for(@link)
  {
print $_,\n;
  }
  print Visit all links in this page: \n;
  for(@link)
  {
if(!(m~^http://~))
{
  $url='http://127.0.0.1/'.$_ ;
  $content=getContent($url);
  printEOF;
  content of this $url is:
  $content
  EOF
}
if((m~^http://127.0.0.1~)or(m~^http://localhost~))
{
  $conten=getContent($_);
  printEOF;
  content of this $url is:
  $content
  EOF
}
  }
}


sub getContent

{
my $url=shift;
my $ua=new LWP::UserAgent();
my $request=new HTTP::Request('GET',$url);
my $response=$ua-request($request);
my $content=$response-content;
return $content;
}

When I compile it the compiler show me:

Can't find string terminator EOF anywhere before EOF at robot.pl line
84.##(red as I marked).##


Please tell how to..?
thanks a lot!___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




LEGAL DISCLAIMER. The contents of this e-mail and any attachments are strictly
confidential and they may not be used or disclosed by someone who is not a
named recipient.
If you have received this email in error please notify the sender by replying
to this email inserting the word misdirected as the message and delete this
e-mail from your system.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Hello! Help me please!

2006-01-05 Thread Bruno Georges
Gao

In a nutshell you have to wrtie the closing print string: EOF
at the beginning of the line, without spaces nor tabs.


Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


|-+-
| |   gao perlone [EMAIL PROTECTED]|
| |   Sent by:  |
| |   [EMAIL PROTECTED]|
| |   veState.com   |
| | |
| | |
| |   05.01.06 13:13|
| | |
|-+-
  
--|
  | 
 |
  |To:  Perl-Win32-Users@listserv.ActiveState.com   
 |
  |cc:  
 |
  |Subject: Hello! Help me please!  
 |
  | 
 |
  |Distribute:  
 |
  |Personal?   |---|
 |
  || [ ] x |
 |
  ||---|
 |
  | 
 |
  
--|




I compile the fellowing perl program and meet a problem:

use HTTP::Request;
use LWP::UserAgent;

$content=getContent('http://127.0.0.1/index.htm');
@html=split(/\n/,$content);
for(@html)
{
  do
  {
$2 and push(@link,$2);
  }while m
{
  \s*A\s+HRE\s*=\s*(['''])(.*?)\l\s*
}gsix;
  print All links in this page:\n;
  for(@link)
  {
print $_,\n;
  }
  print Visit all links in this page: \n;
  for(@link)
  {
if(!(m~^http://~))
{
  $url='http://127.0.0.1/'.$_ ;
  $content=getContent($url);
  printEOF;
  content of this $url is:
  $content
  EOF
}
if((m~^http://127.0.0.1~)or(m~^http://localhost~))
{
  $conten=getContent($_);
  printEOF;
  content of this $url is:
  $content
  EOF
}
  }
}


sub getContent

{
my $url=shift;
my $ua=new LWP::UserAgent();
my $request=new HTTP::Request('GET',$url);
my $response=$ua-request($request);
my $content=$response-content;
return $content;
}

When I compile it the compiler show me:

Can't find string terminator EOF anywhere before EOF at robot.pl line
84.##(red as I marked).##


Please tell how to..?
thanks a lot!___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




LEGAL DISCLAIMER. The contents of this e-mail and any attachments are strictly
confidential and they may not be used or disclosed by someone who is not a
named recipient.
If you have received this email in error please notify the sender by replying
to this email inserting the word misdirected as the message and delete this
e-mail from your system.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: How do configure the Apache server

2005-03-22 Thread Bruno Georges
Hi
First make sure that perl interpreter is in your path so apache can call
it.

The default httpd.conf directives for cgi-bin and .pl suffice to run .pl
and .cgi scripts

check this:
http://httpd.apache.org/docs-2.0/howto/cgi.html


If you use VirtualHosting you can apply a different level of granularity ,
check the apache doc
http://httpd.apache.org/docs-2.0/vhosts/

Try your apache with the default pl and cgi:
http://localhost/cgi-bin/printenv.pl

hope this helps

Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


|-+-
| |   A.Mohan [EMAIL PROTECTED]   |
| |   Sent by:  |
| |   [EMAIL PROTECTED]|
| |   veState.com   |
| | |
| | |
| |   22.03.05 13:27|
| | |
|-+-
  
-|
  | 
|
  |To:  perl-win32-users@listserv.ActiveState.com   
|
  |cc:  
|
  |Subject: How do configure the Apache server  
|
  | 
|
  |Distribute:  
|
  |Personal?   |---|
|
  || [ ] x |
|
  ||---|
|
  | 
|
  
-|




Dear ,
 How do i configure Apache server , that
can able to identify .pl and .cgi file as scripts ,
im using Active state Perl and Windows 2000

Thanks
Mohan




Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs








*  
*  LEGAL DISCLAIMER
*  This message contains confidential information for
*  the exclusive use of the person mentioned above.
*

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: How to 'touch' in Windows

2005-03-10 Thread Bruno Georges
Have a look at: ExtUtils::Command
Check ActieState doc.

perl -MExtUtils::Command -e touch

Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


|-+-
| |   Maxmelbin Neson (RBIN/EDM3) |
| |   [EMAIL PROTECTED]|
| |   Sent by:  |
| |   [EMAIL PROTECTED]|
| |   veState.com   |
| | |
| | |
| |   10.03.05 13:43|
| | |
|-+-
  
|
  | 
   |
  |To:  perl-win32-users@listserv.ActiveState.com 
   |
  |cc:  
   |
  |Subject: How to 'touch' in Windows   
   |
  | 
   |
  |Distribute:  
   |
  |Personal?   |---|
   |
  || [ ] x |
   |
  ||---|
   |
  | 
   |
  
|




Hi,
 If I need to create a blank file in Unix I do touch file name


How do I do it in Windows ??/


Regards
Maxmelbin Neson
-

Robert Bosch India Limited
Engineering Services - DS - Methods and Tools (RBIN/EDM3)
123 Industrial Layout  -  Hosur Road -  Bangalore 560 095  -  INDIA
Telephone: +91 80 5119-4532  Fax: +91 80 2508-1404
[EMAIL PROTECTED]
www.bosch.com


Reputation is what men and women think of us; character is what God and
angels know of us.


-Thomas Paine


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs








*  
*  LEGAL DISCLAIMER
*  This message contains confidential information for
*  the exclusive use of the person mentioned above.
*

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: How to call a perl code in Windows from Unix

2005-02-28 Thread Bruno Georges
Hi

One possible solution is to wrap the functions in Script B [on windows]
with SOAP and expose it has a service via apache.
You can then access them from Script A has a SOAP client.
Also SOAP supports some level of error handling in its protocol.  the SOAP
message can be parsed like any other XML document. To determine whether an
error occurs, the calling client can simply look for this fault element and
read its contents to determine the exact error. 

There are other alternatives if you require more performance, however this
soltion has the benefit of crossing DMZs|firewalls  over HTTP/S which
usually seats between unix and windows worlds.

Perl has a nice SOAP implementation: SOAPLite

http://cookbook.soaplite.com/

Hope this helps.

Bruno Georges

Glencore International AG
Tel. +41 41 709 3204
Fax +41 41 709 3000


|-+-
| |   Maxmelbin Neson (RBIN/EDM3) |
| |   [EMAIL PROTECTED]|
| |   Sent by:  |
| |   [EMAIL PROTECTED]|
| |   veState.com   |
| | |
| | |
| |   28.02.05 09:46|
| | |
|-+-
  
---|
  | 
  |
  |To:  [EMAIL PROTECTED],   |
  |perl-win32-users@listserv.ActiveState.com  
  |
  |cc:  
  |
  |Subject: How to call a perl code in Windows from Unix
  |
  | 
  |
  |Distribute:  
  |
  |Personal?   |---|
  |
  || [ ] x |
  |
  ||---|
  |
  | 
  |
  
---|







Hi ,


Here is the situation 


I need to run Script A in Unix , It will generate few parameters that
should be passed to Script B . The Script A will call Script B ..


Script B will be on a Windows Server . Its input parameter is the data
passed by Script A  IT SHOULD RUN IN WINDOWS and not in a shell on Unix 


After Script B completes execution , it should return Success / Failure or
any other information back to Script A 


Is this possible , if so cld u please give me some ideas ..


Thanks and Regards
Maxmelbin Neson ___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs







*  
*  LEGAL DISCLAIMER
*  This message contains confidential information for
*  the exclusive use of the person mentioned above.
*

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs