I am usiing the following code to store the output of an external command in a variable. But when I print the error, I get nothing.
$error1 = `hadoop fs -copyFromLocal $src_dir $tgt_dir`;
print "$error1\n"; # --> prints nothing
The output of the command in ` ` is:
copyFromLocal: Cannot create file/user/file5._COPYING_. Name node is in safe mode.
Is there anything wrong in storing the output?