View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
涂汉明 > DataFax-StudyDB-0.11 > DataFax::StudyDB



Annotate this POD

View/Report Bugs
Module Version: 0.11   Source  


DataFax::StudyDB - DataFax DFstudies.db parser


  use DataFax::StudyDB;

  my $db = DataFax::StudyDB->new('datafax_dir'=>'/opt/datafax', 
  # or
  my $db = new DataFax::StudyDB 'datafax_dir'=>'/opt/datafax', 


This class locates DataFax DFstudies.db, parse it and load it to a relational database such as Oracle.

new (datafax_dir=>'/opt/datafax',datafax_host=>'my_svr')

Input variables:

  datafax_dir  - full path to where DataFax system is installled 
                 If not specified, it will try to get it from
  datafax_host - DataFax server name or IP address
                 If not specified, it will try to get it from
                 $ENV{DATAFAX_HOST} or `hostname` on UNIX system.

Variables used or routines called:


How to use:

  my $db = DataFax::StudyDB->new('datafax_dir'=>'/opt/datafax', 
Return: an empty or initialized class object.

This method constructs a Perl object and capture any parameters if specified. It creates and defaults the following variables:

  datafax_dir  = $ENV{DATAFAX_DIR}
  datafax_host = $ENV{DATAFAX_HOST} | `hostname` 
  unix_os      = 'linux|solaris'

Export Tag: all

The :all tag includes the all the methods in this module.

  use DataFax::StudyDB qw(:all);

It includes the following sub-routines:

readDFstudies($q, $ar)

Input variables:

  $ifn - input file name 
  $ar  - a parameter array ref
    source_dir   - source directory
    datafax_dir  - DataFax directory
    datafax_host - DataFax server name/IP address
    real_time    - whether to ge real time data

Variables used or routines called:

    get_dfparam - get parameters 

How to use:

  my $s = new DataFax::StudyDB;
  my $ifn = '/opt/datafax/lib/DFstudies.db'; 
  my $pr = { real_time=>1,datafax_host=>'df_svr',
             datafax_usr=>'datafax', datafax_pwd=>'secret'}; 
  my ($c, $d) = $s->readDFstudies{$ifn);
  my ($c, $d) = $s->readDFstudies{"", $pr);

Return: ($c,$d) where $c is an array ref while $d is hash ref.

  $c->[$i][$j] - array ref where 
       $i is row number and 
       $j is column number; 
       $i=0 - the first row contains the column names in the 
              following order
  $d->{$sn}{$itm} hash ref where
       $sn is three-digit study number padding with leading zeros
       $itm is column names as listed in $c->[0]. 

This method reads DFstudies and parse the file into two arrays.


SEE ALSO (some of docs that I check often) ^

Oracle::Loader, Oracle::Trigger, CGI::Getopt, File::Xcopy, DataFax, CGI::AppBuilder, etc.


Copyright (c) 2005 Hanming Tu. All rights reserved.

This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see

syntax highlighting: