Koha::Util
    use Koha::Util::Navigation;
    my $cgi = CGI->new;
    my $referer = Koha::Util::Navigation::local_referer($cgi);
Utility class
    my $referer = Koha::Util::Navigation::local_referer( $cgi, { fallback => '/', remove_language => 1, staff => 1 });
    If the referer is a local URI, return local path.
    Otherwise return fallback.
    Optional parameters fallback, remove_language and staff. If you do not
    pass staff, opac is assumed.
    Marcel de Rooy, Rijksmuseum Amsterdam, The Netherlands
    Koha development team