PERL求助
DATE:
[group1]
aaa
bbb
ccc
[group2]
aaa
eee
ccc
[group3]
[group4]
aaa
ccc
perl 的正则 或 其他方法 匹配每组内容,怎么做
[解决办法]
#!/usr/bin/env perluse strict;use warnings;while (<DATA>) { if (/^(\w)(\1+)$/) { print; }}__DATA__aaabbbcccabc
[解决办法]
http://search.cpan.org/~schwigon/Config-INI-Serializer-0.001/lib/Config/INI/Serializer.pm
[解决办法]
use Config::Std; # Load named config file into specified hash... read_config 'demo2.cfg' => my %config; # Extract the value of a key/value pair from a specified section... $config_value = $config{Section_label}{key}; # Change (or create) the value of a key/value pair... $config{Other_section_label}{other_key} = $new_val; # Update the config file from which this hash was loaded... write_config %config; # Write the config information to another file as well... write_config %config, $other_file_name;