#!/usr/bin/perl -w use strict; print "enter new file name: "; chomp(my $newname = <STDIN>); rename "../yourData.dat", $newname or die "rename failed: $!\n"; print "file moved successfully!\n";