ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Utilities/PathMod.pm
Revision: 1.6
Committed: Fri Jan 14 17:36:43 2011 UTC (14 years, 4 months ago) by muzaffar
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +0 -0 lines
State: FILE REMOVED
Log Message:
merged SCRAM_V2 branch in to head

File Contents

# User Rev Content
1 sashby 1.2 BEGIN
2     {
3 sashby 1.3 die "Utilities::PathMod: I AM used...","\n";
4 sashby 1.2 };
5    
6 williamc 1.1 #
7     # PathMod.pm
8     #
9     # Originally Written by Christopher Williams
10     #
11     # Description
12     #
13     # Interface
14     # ---------
15     # new() : A new PathMod object
16     # Searchpath(path, filename) : return the first occurance of filename in the
17     # path
18    
19     package Utilities::PathMod;
20     require 5.001;
21    
22     sub new {
23     my $class=shift;
24     $self={};
25     bless $self, $class;
26     return $self;
27     }
28    
29     sub SearchPath {
30     my $self=shift;
31     my $path=shift;
32     my $filename=shift;
33    
34     my @dirs;
35     my $dir;
36     my $file="";
37    
38     @dirs=split /:/, $path;
39     foreach $dir ( @dirs ) {
40     if ( -e $dir."/".$filename ) {
41     $file=$dir."/".$filename;
42     last;
43     }
44     }
45     return $file;
46     }