I'm trying to write what I though was fairly simple Boolean Logic. I
can't seem to hit the right syntax for more than two conditions in the
same "if" clause.
My plan is to check:
1) Is there is a 100 field?
2) Is the fixed field FIC=1?
3) Is the fixed field Audn= j?
If all of the above are true then write 099 J
I've diddled around with lots of variations on:
my $field_008 = $r->field('008');
my $field_100 = $r->field('100');
my $fic=substr($field_008->data(),33,1 );
my $juvie=substr($field_008->data(),22,1 );
if ($field_100 && (($fic == '1') and ($juvie == 'j'))) {
## find the tag before 100.
my $before;
foreach ($r->fields()) {
$before = $_;
last if $_->tag() > 99;
}
## create the 099 field.
my $new = MARC::Field->new('099','','',a=>'J');
## insert our 099 field after the $before.
$r->insert_fields_before($before,$new);
}
The first two conditions seem to be evaluated OK, but no amount of
persuasion seems to make the program evaluate the third. What am I
doing wrong??
Thanks in advance for anyone who can see what's probably obvious.
JJ
**Views expressed by the author do not necessarily represent those of
the Queens Library.**
Jane Jacobs
Asst. Coord., Catalog Division
Queens Borough Public Library
89-11 Merrick Blvd.
Jamaica, NY 11432
tel.: (718) 990-0804
e-mail: [EMAIL PROTECTED]
FAX. (718) 990-8566