#!/usr/bin/perl -w
#
use warnings;

# first we'll need to prompt the user for file names
chomp($user = `whoami`);
print "Supply the files you'd like to use.\n";
print "(hit enter after each, ctrl-d when finished):\n";
chomp(my @sfiles = <STDIN>);
my $num_of_files = @sfiles;

# grab length and number of channels
foreach (0..$#sfiles) {
	system "sfinfo $sfiles[$_] > tmpfile";
	$dur = substr(`cat tmpfile | grep length`, -9, 5);
	push(@length, $dur);
	# clean up
	system "rm -f tmpfile";
	}
foreach (0..$#length) {
	print $length[$_];
	print "\n";
	}

__END__
