use Inline 'SLang' => 'require("caldb");';

# Set up the CALDB query
my $infile = "/data/dburke2/data/Chandra/CIAO/code/perl-slang/evt2_3.fits";
my $cal = calCreateInfo($infile);
calSetExpression( $cal, "cti_corr.eq.yes" );
calSetData( $cal, "FEF_PHA" );

# See what's in the $cal structure
print "The contents of the $cal object are:\n";
calPrintInfo($cal);
print "\n";

# Now find the file matching the CALDB query
my $file = calFindFile( $cal )
  or die "Error: unable to find the FEF_PHA file\n";
print "The FEF_PHA file (with CTI_CORR=yes) is\n$file\n\n";