# this works as a bash include
#
# test FileHandle::InBuffer
# - reading via getline() and operator <>
# - basic functioning of ungets() and subsequent reading
#
perl -e '
    use lib shift();  # give include precedence to code directory, perl -I would not work!
    use FileHandle::InBuffer;
    $h=FileHandle::InBuffer->new($ARGV[0]);
    $s=<$h>;
    print $s;
    $h->ungets($s);
    $s=<$h>;
    print $s;
    $s=$h->getline();
    print $s;
  ' "$dircode" "$dirtest"/test_FHB_in1.txt
