in reply to Variables with spaces and changing file extensions

Make sure to start your script with strictures:
use strict; use warnings; use File::Find::Rule;
For file names with spaces, wrap them with quotes. For example:
my $itunes = '"/Volumes/Media/iTunes/iTunes Media/Automatically Add to + iTunes/"';
As for your $list, I would eliminate that and call File::Find::Rule in list context like:
my(@files) = File::Find::Rule
Here's how I would do it:
#!/usr/bin/perl use strict; use warnings; use File::Find::Rule; my $handbrake = '/usr/local/bin/HandBrakeCLI'; my $preset = 'AppleTV'; my $itunes = '"/Volumes/Media/iTunes/iTunes Media/Automatically Add to + iTunes/"'; my $tvtag = '/usr/local/bin/tvtag-sickbeard.pl'; my(@files) = File::Find::Rule ->file() ->name( qr/\.(mkv|avi)$/ ) ->in( @ARGV ); @files = join("\n", @files, ''); print "\nFound the following files to convert:\n\n@files\n"; foreach my $file(@files) { print $file . "\n"; system "$handbrake -i '{$file}' -o '$file.m4v' --preset=$preset"; }