sub get_file_contents { my ($self,$args) = @_; my $contents; my $file = $args->{file_name}; 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 $contents; }