NAME
SADI::Utils - what does not fit elsewhere
SYNOPSIS
# load the Utils module
use SADI::Utils;
# find a file located somewhere in @INC
my $file = SADI::Utils->find_file ('resource.file');
# get file from url
$file = SADI::Utils->getHttpRequestByURL('http://sadiframework.org');
# remove leading/trailing whitespace from a string
print SADI::Utils->trim(' http://sadiframework.org ');
DESCRIPTION
General purpose utilities.
AUTHORS
Edward Kawas (edward.kawas [at] gmail [dot] com)
Martin Senger (martin.senger [at] gmail [dot] com)
SUBROUTINES
find_file
Try to locate a file whose name is created from the $default_start
and all elements of @names
. If it does not exist, try to replace the $default_start
by elements of @INC (one by one). If neither of them points to an existing file, go back and return the $default_start
and all elements of @names
(even - as we know now - such file does not exist).
There are two or more arguments: $default_start
and @names
.
getHttpRequestByURL
returns a scalar of text obtained from the url or dies if there was no success
empty_rdf
returns a string of RDF that represents a syntactically correct RDF file
trim
trims whitespace from the begining and end of a string