my $default_clientspec=`p4 info`; my $cspec = " "; #Getting the default cspec from perforce my @specs = split /\n/, $default_clientspec; foreach my $spec (@specs) { (my $param, my $val) = split /: /, $spec; if ($param =~ /Client\sname/xms) { #chomp $val; $cspec="$val\n";#only adding a new line character prints the value in $cspec,why? #print "$cspec"; } } $cspec=lc($cspec); my $option_c=lc($options{c}); if (lc $cspec ne lc $options{c})#even though these two are equal,I see the program entering the loop,I tried so many things ,not sure why? { print "$cspec"; print "$option_c"; print "ERROR:Please change your default cspec to $options{c}\n"; exit; }