Revision: | 1.2 |
Committed: | Wed Aug 10 17:27:32 2005 UTC (19 years, 9 months ago) by sashby |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | V1_0_3-p4, V1_0_3-p3, V1_0_3-p2, before110xmlBRmerge, V1_0_4p1, V1_0_3-p1, V1_0_3, V1_0_2, V1_0_2_p1 |
Branch point for: | v103_with_xml, v103_branch |
Changes since 1.1: | +5 -0 lines |
Log Message: | Starting to add POD documentation. |
# | Content |
---|---|
1 | BEGIN |
2 | { |
3 | print "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 | } |