Fetching -F is surprisingly obnoxious

jjore on 2006-08-14T23:50:49

It is surprisingly obnoxious to fetch the value passed in to perl's -F command line parameter. Icky. Also possible is just reading from the interpreter variable PL_minus_f but that takes XS. The following is the plain perl version.

use B 'main_root';
use List::Util 'reduce';
sub _minus_f {
    my $minus_f;
    eval {
        my $op = reduce { $a->$b } main_root, split ' ', <<'OPTREE';
          first
          sibling
          sibling
             first
             sibling
                first
                   first
                   sibling
                      first
                      sibling
                         first
                            first
                            sibling
                               first
OPTREE

        $minus_f = $op->precomp;
    };

    return $minus_f;
}