#!/usr/bin/perl -w

$old = << 'END';
//Tred:Custom-Attribute:#{custom1}<? join '_', map { "\${$_}" } grep { $this->{$_} =~ /^./ && $this->{$_} !~ /^no-/ }
//Tred:Custom-AttributeCont:                                        qw 'afun parallel paren arabfa arabspec arabclause' ?>
END

$new = << 'END';
//Tred:Custom-Attribute:<?
//Tred:Custom-AttributeCont:                                join '#{custom1}_', ( $this->{afun} eq '???' && $this->{afunaux} ne '' ?
//Tred:Custom-AttributeCont:                                '#{custom3}${afunaux}' : '#{custom1}${afun}' ), ( ( join '_', map {
//Tred:Custom-AttributeCont:                                '${' . $_ . '}' } grep { $this->{$_} =~ /^./ && $this->{$_} !~ /^no-/ }
//Tred:Custom-AttributeCont:                                qw 'parallel paren arabfa arabspec arabclause' ) || () )
//Tred:Custom-AttributeCont:                            ?>
END

$/ = undef;

while (<>) {

    s/\Q$old/$new/;

    print;
}
