#!/usr/bin/perl

if (@ARGV != 1) {
	print "usage ./catrev.pl file1";
	print "@ARGV";
	exit;
}

else {

	$file1 = pop(@ARGV);
	
	open(FILE1,$file1);
	
@array1 = <FILE1>;

foreach (@array1) {
	$each = reverse($_);
	print "$each\n"

}

print "what would you like your file name to be?\n";
$filename = <STDIN>;
chomp ($filename);

if (($filename == "") || ($filename == "undef")) {
	print "enter some data!";
	exit;
}

else {
	sub hellofile {
print "$_[0] is the file to be written";

open (FILE, '> $_[0]') or die "cant create file";

close(FILE);
}

hellofile($filename);

}

} 

