package My::Package; use strict; use warnings; ...other module stuff... sub read_slurp { # "worst-case-scenario" way of splitting up the # file into its separate lines foreach ( split /(?:\015{1,2}\012|\015|\012)/, shift ) { # Skip comments if ( /^(?:\#|\!|$)/ ) { next; } ###################################### # Parse the Filetype info ###################################### if ( /^FILETYPE=(.*)\s*$/ ) { $self->{'FILETYPE'} = "$1"; next; } ... LOAD THE APPROPRIATE MODULE ... ... AND CONTINUE PARSING ...