I have one file file.xml. and I am trying to modify the text of tag h if it's attribute value is cde. file saur file1 mand I have written a code as: use XML::Twig; use Data::Dumper; my $xml=$ARGV[0]; my $tag_name=$ARGV[1]; my $att_name=$ARGV[2]; my $att_value=$ARGV[3]; my $tag_text=$ARGV[4]; my $twig = XML::Twig->new(twig_roots => {$tag_name => \&select_change}, ); $twig->parsefile_inplace($xml); $twig->flush; sub select_change { my($twig,$tag_name)=@_; if ($tag_name->att('$att_name') =~ "$att_value") { $tag_name->set_text('$tag_text'); } } Now I am giving command line as perl -w twigparse.pl file.xml href attr cde sriram Now it is not running but if I give values to all command line variables in program then it runs.Please correcr me.I am stuck in this code...Help me........