sh: +: not found

hello all,

In a perl script I am writing,

$dd =`expr $dd + 1`;

for adding $dd, but getting following error:

sh: +: not found

Please help!!

are you sure you have some integer value in $dd ?

alternatively, you can do the arithmetic calculation in perl itself ( if this only is the real problem) instead calling shell.

by the way, I am getting the correct o/p with the same command.

bash$ perl -e '$dd = 5;$dd = `expr $dd + 1`; print $dd;'  
6

Thanks anchal ... after chomping $dd, I got it correct...

chomp $dd;
my $dd = `expr ${dd} + 1`;