Hi All ,
I have a small query. I have written a perl script that takes input from a configuration file.
The configuration file is like
MACHINE NAME = X
CONFIG = Y
I need to read this file and enter these values in a hash , as in ...
hash{'MACHINE NAME'}=X
I have seen a regular expression in one of the scripts , to identify the A=B pattern
It is :
if (($name,$value)= /^\s*([^=\s]+)\s*=\s*(.*?)\s*$/ ){
Just need to understand , how does this expression , preserves the value in $name and $ value variables
I understand some part though ...
/^\s* -> for starting whitespaces
([^=\s]+) --> ?? whats this ??
\s* -> white spaces before '='
=\s* -> white spaces after '='
(.*?) -> $value
\s* --> =\s* -> white spaces after $value
$/
Thanks