Yes, I am using perl where I could just be using the shell. In this case, I am using perl because it is a little less processor intense (fewer processes forked), and a lot clearer from a readability point of view.
The application is a wrapper around a tape stacker. I want to read in six tapes from a stacker, in sequence, using the command `mtx`. I'm reading its output, here:
Drive: tape 3 loaded
I can then figure out which tape is in the drive and which ones need to be done. Anyhow, the code that I have created to parse that information is here:
# status in this case is the output of mtx, above...
my @fields = split m[\n|\s+], $status, 13;
my $loaded = pop @fields;
my %drives = @fields;
This is pretty cool, but I dont get a feeling of satisfaction from it. What would be a more concise yet still clear way to do this?
Laziness, Impatience, Hubris, and Generosity.