in reply to Executing unix command in perl and getting the output

you need another backtick at the end.From this:
my $number = `ls -l $name | wc -l | sed 's/^ *//'';
to this:
my $number = `ls -l $name | wc -l | sed 's/^ *//'`;

-enlil