As stated here in Call a bash script from a perl script by Igor Chubin, one way to retrieve the result of a bash script from within a perl script is by:
$result = `/bin/bash /path/to/script`;
Now, my result is actually a series of files, because this script runs a simple find command. The result on the console looks like:
/path/to/file.extension
/path/to/file2.extension
I want to take the result, remove white spaces, and concatenate file names seperated with a comma. So that my $result
looks like:
/path/to/file.extension,/path/to/file2.extension
What is the most efficient way to do this? Note that this is taking place within a perl script.