rajenrshah has asked for the wisdom of the Perl Monks concerning the following question:

hi there is a perl file which returns output in xml format i want to call this file from ASP & get the xml from perl & display it through asp

Replies are listed 'Best First'.
Re: how to call perl from asp
by Kanji (Parson) on May 03, 2002 at 09:54 UTC

    Have you considered using PerlScript in your ASP?

    <% @LANGUAGE = PerlScript %> <% # Embed your Perl right into your page ... use Image::IPTCInfo; chdir('demo_images'); # ... # ... or if it needs to live seperately, # capture it's output and redirect it to # the browser. # This might be redundant: does STDOUT in # ASP go to the browser anyway? open XML, "-|" or exec "/path/to/your/script.pl" or die "Can't exec script.pl: $!\n"; $Response->Write($_) while <XML>; %>

    If not, then ASPFAQ.com or one of the other ASP sites might be a better place to ask/look.

        --k.


      Hi, tried that, got the error "no such scripting language, as this is linux and an isp out of my control, I'm not sure what they need to load to make this work. Any suggestions?
Re: how to call perl from asp
by mce (Curate) on May 03, 2002 at 08:06 UTC
    Hi rajenrshah, There are dozens of ways, you can even use the Apache port of ASP to get support for the XML files.

    If you want to generate the XML files yourself, check out perl XML libraries.

    Yours
    ---------------------------
    Dr. Mark Ceulemans
    Senior Consultant
    IT Masters, Belgium

      hi this is the code of perl file have a look at it & tell me how to go
      #!/usr/bin/perl use Image::IPTCInfo; chdir('demo_images'); my @files = ('burger_van.jpg', 'dog.jpg'); foreach my $filename (@files) { # Create new IPTCInfo object for the file my $info = new Image::IPTCInfo($filename); # With this you can get a list of keywords... my $keywordsRef = $info->Keywords(); # ...and specific attributes print "file : $filename\n"; print "caption : " . $info->Attribute('caption/abstract') . "\n" +; foreach $keyword (@$keywordsRef) { print " keyword : $keyword\n"; } # Create some mappings and extra data for messing # with XML and SQL exports. my %mappings = ( 'caption/abstract' => 'caption', 'by-line' => 'byline', 'city' => 'city', 'province/state' => 'state'); my %extra = ('extra1' => 'value1', 'filename' => $filename); # Demo XML export, with and without extra stuff print $info->ExportXML('photo'); } exit;
      Rajen Shah rajenrshah@rediffmail.com