in reply to opening all files in a directory

Get a list of the names of the files in the directory with opendir and readdir (or use glob), and then put the filename in a variable. Skeleton code:

my $directory = "/path/to/files"; opendir DIR, $directory or die "can't open $directory: $!\n"; while (my $file = readdir DIR) { next unless -f "$directory/$file"; open FILE, "$directory/$file" or warn "Can't open $file: $!\n", ne +xt; # do stuff to FILE close FILE; } closedir DIR;
perl -e 'print "How sweet does a rose smell? "; chomp $n = <STDIN>; $r +ose = "smells sweet to degree $n"; *other_name = *rose; print "$other +_name\n"'