Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    
    my $section2 = get_section( $inifile_contents, 'AnotherSection' );
    print "This is the contents of AnotherSection -------\n$section2\n";
    
  2. 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
    
  3. 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;