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

hi i am new to perl i want to know how to access the request parameter for eg. there is a get request like this http://90.0.0.110/demo.pl?imagefile=burger_van.jpg how to access the imagefile parameter from perl

Replies are listed 'Best First'.
Re: request object
by davorg (Chancellor) on May 03, 2002 at 07:26 UTC
    use CGI ':standard'; my $imagefile = param('imagefile');
Re: request object
by rajenrshah (Initiate) on May 03, 2002 at 09:18 UTC
    hi this is the code of perl file have a look at it & help me
    #!/usr/bin/perl use CGI':standard'; use Image::IPTCInfo; chdir('demo_images'); $imagefile = param( 'imagefile' ); my @files = ($imagefile); 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); print "\n------------------------------\n\n"; # Demo XML export, with and without extra stuff print "xml follows:\n\n"; print $info->ExportXML('photo'); print "\nxml with extra stuff follows:\n\n"; print $info->ExportXML('photo-with-extra', \%extra); print "\n------------------------------\n\n"; # Demo SQL export, with and without extra stuff print "sql follows:\n\n"; print $info->ExportSQL('photos', \%mappings); print "\n\nsql with extra stuff follows:\n\n"; print $info->ExportSQL('morephotos', \%mappings, \%extra); print "\n\n------------------------------\n\n"; } print "all done!\n\n"; exit;
    pls tell me the changes i have to make in it Rajen Shah rajenrshah@rediffmail.com