$file = `ls location/of/file/the/cgi/outputs`; if ($file eq "the expected file location") { `scp $file user@server:location`; }