- or download this
use strict;
use warnings;
...
my $section2 = get_section( $inifile_contents, 'AnotherSection' );
print "This is the contents of AnotherSection -------\n$section2\n";
- or download this
This is the contents of MySection -------
; This is a comment line for MySection
...
This is the contents of AnotherSection -------
; another comment
asfld=69
- or download this
# Remove up to three trailing comment lines
$s =~ s/^;.*\Z//m; chomp $s;
$s =~ s/^;.*\Z//m; chomp $s;
$s =~ s/^;.*\Z//m; chomp $s;