From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

NAME

OWL::Utils - what does not fit elsewhere

SYNOPSIS

# load the Utils module
# find a file located somewhere in @INC
my $file = OWL::Utils->find_file ('resource.file');
# get file from url
$file = OWL::Utils->getHttpRequestByURL('http://sadiframework.org');
# remove leading/trailing whitespace from a string
print OWL::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