sub my_get_data_section { my $section = shift; my $data = Data::Section::Simple::get_data_section($section); # probably error handling here... return wantarray ? split("\n", $data) : $data; } my $line = my_get_data_section( $section ); my @lines = my_get_data_section( $section );