I think split is your friend in this case. Perhaps something along the lines of my ($key,$operator,$value) = split /\s*(=>?)\s*/,$_,2; will set you in the right direction. The rest is just trimming leading and trailing whitespace.
Update: In the interests of TIMTOWDI, I do believe that one can modify your above regex to the following: /(\S.*?)\s*(\=\>?)\s*(.+?)\s*/ However, due to the amount of backtracking involved in the regex, along with the general ugliness of it, I'd personally use split in this case. In my mind, it also better captures the essence of what you're trying to do -- you've got these two things, and they'er seperated by something. You want to split them apart, so..
perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'
In reply to Re: A little config parsing.
by Chmrr
in thread A little config parsing.
by rendler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |