Ghostdog sounds right to me. You can tell Perl on the command line where to get the file with names saved in it. Here's a variant on the same idea:
Code:
#!/usr/bin/perl
use warnings;
use strict;
die "Usage: specify file with ids on command line.\n" unless @ARGV;
while (<>) {
chomp;
print "One id is [$_].\n";
## Substitute whatever you really want to do
## with the ids here instead of the two lines
## above.
}
If you have a file (say id_file) with ids in it, one per line. You could run this script and get something like the following output:
Code:
./process_ids id_file
One id is [sarpedon].
One id is [telemachus].
One id is [odysseus].
One id is [penelope].
You can also hardcode the filename into the script as Ghostdog did. I like this way, because then you can change it as needed more quickly. If the id file changes name, or if you have multiple id files, you just enter the new name or the multiple names on the command line. Perl will automatically process through whatever files you enter on the command line in order, one after the other.