sub get_file_contents { my ($self,$args) = @_; my $contents; my $file; if (ref($args) eq 'HASH') { $file = $args->{file_path}; } else { $file = $args; } if (!$file) { ($file) = $self->fancy_magic_file_find($args); } if (!$file || !-e $file) { return "ERROR: Invalid file passsed to 'get_file_contents'"; } open(FILE,"$file") or $self->error_to_log("ERROR: "); $contents = do {local $/;}; close FILE; $self->error_to_log("retrieved $file") if $contents; return wantarray ? ($contents,$file) : $contents; }