A
Adam
Hi All,
Apologies if this is laughably simple, but it's been a long time since
I've used Perl, and I seem to suffer from Homer Simpson's problem:
every time I learn something new, it pushes old stuff out.
I'm trying to extract a number from a line of text returned by a
license-checking command. I open a pipe to the command, and read
through each line that is returned. When I find the text "Maximum..."
or "Current..." I want to extract and store the number in that line. I
tried using something like this to start with:
$lic_usage{$lic_type}{$max} = /\d+/ if (/Maximum/);
$lic_usage{$lic_type}{$cur} = /\d+/ if (/Current/);
Of course, this only stores a 1 ('True') when it finds the string, and
I want it to record the actual digits.
Help!
Cheers - Adam...
Apologies if this is laughably simple, but it's been a long time since
I've used Perl, and I seem to suffer from Homer Simpson's problem:
every time I learn something new, it pushes old stuff out.
I'm trying to extract a number from a line of text returned by a
license-checking command. I open a pipe to the command, and read
through each line that is returned. When I find the text "Maximum..."
or "Current..." I want to extract and store the number in that line. I
tried using something like this to start with:
$lic_usage{$lic_type}{$max} = /\d+/ if (/Maximum/);
$lic_usage{$lic_type}{$cur} = /\d+/ if (/Current/);
Of course, this only stores a 1 ('True') when it finds the string, and
I want it to record the actual digits.
Help!
Cheers - Adam...