Bin Laden 1990 Cambridge University Press, Cambridge UK, 1st edition 1 terrorism whatever Terrorism </ref> <ref> <provnc> <aulist> <author> Sydney </aulist> <year>1990 <source> Cambridge University Press, Cambridge UK, 1st edition <id>1 <keywords> <key>nothing <key>whatever </keywords> </provnc> <title> Terrorism </ref> ##</code><code>## #!/usr/bin/perl ##use CGI ':standard'; ## Store the data here my %data; @keywords = (); ##Get the string to search $search=param('search'); print "Content-type:text/html\n\n"; #Content Header print <<End_of_head; <html> <head><title>Display Results End_of_head open (FH, " ) { if (/\\s*(\D*)$search/i ) { get_data(); print_data(); cleararray(); } } print < End_of_Doc sub get_data { while( ) { $data{author} = $1 if /\\s*(\D*)/i; $data{year} = $1 if /\\s*(\d{4})/i; $data{source} = $1 if /\\s*(\D*)/i; $data{id} = $1 if /\\s*(\d+)/i; push(@keywords, $1) if /\\s*(\w+)/i; ## store keys in an array $data{title} = $1 if /\\s*(\D*)/i; return if /\<\/ref\>/; } } sub print_data{ print <