ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Utilities/PathMod.pm
Revision: 1.2.4.1
Committed: Wed Jan 24 17:25:53 2007 UTC (18 years, 3 months ago) by sashby
Content type: text/plain
Branch: v103_with_xml
CVS Tags: forV1_1_0, v103_xml_071106, V110p2, V110p1
Changes since 1.2: +1 -1 lines
Log Message:
Add support for tool timestamps dir to track tool updates. From Shahzad.

File Contents

# Content
1 BEGIN
2 {
3 die "Utilities::PathMod: I AM used...","\n";
4 };
5
6 #
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 }