in reply to Certainly learning
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.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;
|
|---|