X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=yarrg%2FCommodsWeb.pm;h=d09331d4c54e40ae91861d3abbf080187caba06a;hp=3e3b59e1e64ae2ca08dde0db823befa5c71943db;hb=4c157b676894d03718be0395900162acea4f1ff3;hpb=a9583fa8a29e889f435ee4d6cf3dc6a5979a6bd5 diff --git a/yarrg/CommodsWeb.pm b/yarrg/CommodsWeb.pm index 3e3b59e..d09331d 100644 --- a/yarrg/CommodsWeb.pm +++ b/yarrg/CommodsWeb.pm @@ -35,12 +35,16 @@ use POSIX; use Commods; use CommodsDatabase; +our $self_url; +our $base_url; + BEGIN { use Exporter (); our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); $VERSION = 1.00; @ISA = qw(Exporter); - @EXPORT = qw(); + @EXPORT = qw($dbh &db_setocean &db_connect &db_doall + &ocean_list); %EXPORT_TAGS = ( ); @EXPORT_OK = qw(); @@ -53,4 +57,22 @@ for my $dir (@INC) { } } +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;