You need to elaborate on "fail to redirect" and "my code is failing". Do you not get an output file? Is the output file empty?
@files = <STDIN>;
You don't show how you are running your code, but that line might be causing your code to appear to hang until you enter Ctrl-C, or some such. Also, you keep clobbering your output "data" file for each input file. Maybe you want something more like:
use warnings;
use strict;
for my $file (@ARGV) {
print "Preforming sha1 on $file\n";
system( "sha1sum $file >> data" );
}
Run it like:
code.pl file1 file2 file3