X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.main.git;a=blobdiff_plain;f=yarrg%2FCommodsWeb.pm;h=d09331d4c54e40ae91861d3abbf080187caba06a;hp=377d97b1c5c8e9794df7917e1bfb0cb3a6680a66;hb=4c157b676894d03718be0395900162acea4f1ff3;hpb=7031695ce7767c196f2ef0f279bf4e3c7931c211 diff --git a/yarrg/CommodsWeb.pm b/yarrg/CommodsWeb.pm index 377d97b..d09331d 100644 --- a/yarrg/CommodsWeb.pm +++ b/yarrg/CommodsWeb.pm @@ -44,7 +44,7 @@ BEGIN { $VERSION = 1.00; @ISA = qw(Exporter); @EXPORT = qw($dbh &db_setocean &db_connect &db_doall - $self_url $base_url); + &ocean_list); %EXPORT_TAGS = ( ); @EXPORT_OK = qw(); @@ -57,7 +57,22 @@ for my $dir (@INC) { } } -$self_url= 'http://'.$ENV{'SERVER_NAME'}.$ENV{'SCRIPT_NAME'}.$ENV{'PATH_INFO'}; -$base_url= $self_url; $base_url =~ s,/[^/]+,,; +my @ocean_list; + +sub ocean_list () { + if (!@ocean_list) { + my $fn= "$db_datadir/master-info.txt"; + my $f= new IO::File $fn or die $!; + my @r; + while (<$f>) { + next unless m/^ocean\s+(\S.*\S)\s*$/; + push @r, $1; + } + $f->error and die $!; + close $fn; + @ocean_list= @r; + } + return @ocean_list; +} 1;