Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • d023d25
  • /
  • with_fallback.pm
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:014f3551564af92d4770f12d4122624582ae5555
directory badge Iframe embedding
swh:1:dir:d023d25067bca108f7518d426b8ca8dd036e9932
with_fallback.pm
#! /usr/bin/perl

package with_fallback;

sub import {
    use File::Basename;
    use File::Spec::Functions;
    foreach (@_) {
	eval "require $_";
	if ($@) {
	    unshift @INC, catdir(dirname(__FILE__), "..", "external", "perl");
	    my $transfer = "transfer::$_";
	    eval "require $transfer";
	    shift @INC;
	    warn $@ if $@;
	}
    }
}
1;

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top