+ sub { !$_[0]{DD} && !$_[0]{CQ} } );
+ write_permode($dir_prefix,
+ '&$+', '&$-', "\n",
+ 'dollar doubling',
+ sub {
+ my ($e) = @_;
+ return 0 if $e->{CQ};
+ return $e->{DD} || !grep {
+ # If there are two entries with the same In,
+ # use only the one from the `while dollar
+ # doubling' section. So entries there override
+ # entries in the rest o the file.
+ $_ ne $e && $_->{In} eq $e->{In}
+ } @exp;
+ },
+ sub {
+ $_=$_[0];
+ s/\$/\$\$/g unless $_[1]{DD};
+ $_;
+ } );