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

  • fb94af3
  • /
  • 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:fb94af3f664955d4e3331038c67d07e9a1435bc5
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