#!/usr/bin/perl -w

my $MOVIE             =    "Movie / Drama";

my %REPLACE=(
    
    "Movie"          				 => $MOVIE ,
	"movie"          				 => $MOVIE ,
 ) ; 

my $PRE  = '<category lang=\"en\">' ;
my $POST = '</category>'  ;

sub myfilter {
  my ($a) = @_;
  if ( exists $REPLACE{$a} ){
      return $REPLACE{$a} ;
  } 
  else {
      print STDERR "Warning: Unmanaged category: '$a'\n" ;
      return $a ;
  }
}

 while (<>) {
      my $line = $_ ;
      $line =~ s/($PRE)(.*)($POST)/"$1".myfilter("$2")."$3"/ge ;
      print $line ;
 } 
