#!/usr/bin/perl -- use strict; use warnings; my $str="himanshu.txt^@"; if($str =~ /(\w+)/) { $str = "$1.$2"; } print "$str\n" __END__ Use of uninitialized value in concatenation (.) or string at - line 6. himanshu.