I would suggest to use wantarray. Perhaps:
You could also ask the author to support this feature. Another option would be to overwrite Data::Section::Simple::get_data_section() with the implementation of my_get_data_section(), but that trick is probably quite dirty from a software engineering point of view...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 );
In reply to Re: (scalar or array context|new|decorated) function for Data::Section::Simple?
by Perlbotics
in thread (scalar or array context|new|decorated) function for Data::Section::Simple?
by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |