I think you already understand the tools, so I will just point you in the right direction. You want to
open the file and read each line from it. Do this thusly:
use strict; # ALWAYS!
my $filename = 'devices.txt'; # Hardcode the filename.
# you could get the filename off the
# command line using shift, but be
# aware of the consequences of your
# actions.
open FILEHANDLE, $filename or die "Failed to open '$filename', $!";
while( <FILEHANDLE> ) # Read the file one line at a time.
{
chomp;
m/\d{10}/ or warn "Unknown arg '$_', skipping\n" and next;
# Process the device numbered $_
}
close FILEHANDLE;
Code is untested, but that is okay. It is meant to point you in the right direction, not solve everything... thats what they pay you to do.