I have this Perl script:
#!/usr/bin/perl
$var = `ls -l $ddd` ;
print $var, "
";
And ddd is a shell variable
$ echo "$ddd"
arraytest.pl
When I execute the Perl script I get a listing of all files in the directory instead of just one file, whose file name is contained in shell variable $ddd.
Whats happening here ? Note that I am escaping $ddd in backticks in the Perl script.
See Question&Answers more detail:os