Thank you, stevieb.
>>> You might be inclined to show the regex, a bit of
surrounding code, and a sample of your data, as there may be more efficient/cleaner ways to do this instead of using one long regex.
Thanks. Here's my demonstrator program, which works properly (though perhaps not efficiently):
#!/usr/bin/perl
use strict;
my $string = join ( "\n", <DATA> ); #slurp it all into a string wit
+h newlines
my( $configuration, $memory, $serial_number ) =
( $string =~ /System Configuration:\s+([\w\s]*?)\n.*Memory size:\s+
+(\d+).*Chassis Serial Number\W+(\w+)/s );
print(
"System Configuration: '$configuration'\n",
"Memory Size: '$memory'\n",
"Serial Number: '$serial_number'\n\n",
);
__DATA__
============================ FW Version ============================
la
la
la
System Configuration: Oracle Corporation sun4v SPARC Enterprise T5220
la
la
Memory size: 65408 Megabytes
Version
------------------------------------------------------------
Sun System Firmware 7.4.7 2014/01/14 18:48
====================== System PROM revisions =======================
Version
------------------------------------------------------------
OBP 4.33.6.e 2014/01/14 15:19
Chassis Serial Number
---------------------
FDL10792DE
la
la
OUTPUT
System Configuration: 'Oracle Corporation sun4v SPARCE nterprise T5220
+'
Memory Size: '65408'
Serial Number: 'FDL10792DE'