gorilla1
11-15-2002, 09:21 PM
When I run the code below from a telnet session and from within the same directory as this perl script and as the file junk.txt, I get the message "directory or file not found". What am I missing?
#!/usr/bin/perl
$new_file = "junk1.txt";
$old_file = "junk.txt";
renameStuff();
sub renameStuff {
rename($old_name,$new_name) or "Error renaming file ($old_name)\n";
exit();
}
#!/usr/bin/perl
$new_file = "junk1.txt";
$old_file = "junk.txt";
renameStuff();
sub renameStuff {
rename($old_name,$new_name) or "Error renaming file ($old_name)\n";
exit();
}