package neb::Misc; # miscelaneous stuff. use strict; use utf8; use warnings; use English; use Carp; use Data::Dumper; use Exporter; our @ISA = qw'Exporter'; our @EXPORT_OK = qw'find_file'; our %EXPORT_TAGS = ('all' => [qw'find_file']); sub find_file { my $F = shift; my $p = shift || $ENV{'NEB_PATH'}; my @path = split(":", $p||"."); foreach my $dir (@path) { return "$dir/$F" if -f "$dir/$F"; } return $F; } 1;