print "Enter the name of the file: "; my $base_dir = <>; chomp($base_dir);open( my $DATA, "<" , $base_dir) or die "Can't open file '$base_dir': $!"; while ( <$DATA> )