/usr/share/texmf/scripts/latex-make/figdepth.pl is in latex-make 2.1.16-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
my(%profondeurs);
my(@Fld);
my($arg);
foreach $arg (@ARGV) {
    # while (length($arg=$ARGV[0]) && shift) {
    $profondeurs{$arg}=1 if $arg =~ /^[0-9]+$/;
}
my($affiche) = 1;
my($comment)="";
my($line);
while (defined($line=<STDIN>)) {
    chomp $line;	# strip record separator
    if($line=~/^\#/) {
       $comment.=$line."\n";
       next;
    }
    @Fld = split(' ', $line, 9999);
    if ($line=~/^[ \t]/) {
	if ($affiche == 1) {
	    print $line, "\n";
	}
    } else {
	if (!$Fld[0] || ($Fld[0] ne 1 && $Fld[0] ne 2 && $Fld[0] ne 3 &&
	    $Fld[0] ne 4 && $Fld[0] ne 5)) {
	    print $comment;
	    print $line, "\n";
	    $affiche = 1;
	} elsif ($Fld[0] == 4) {
	    show($Fld[3], $line);
	} else {
	    show($Fld[6], $line);
	}
	$comment="";
    }
}
sub show {
    my($prof) = shift;
    my($ligne) = shift;
    if (defined($profondeurs{$prof})) {
	print $comment;
	print $ligne, "\n";
	$affiche = 1;
    } else {
	$affiche = 0;
    }
}
 |