#!/usr/local/bin/perl use warnings; use strict; my $working_file = 'interlin-working.pl'; my $golfy_file = 'interlin.pl'; my $test_script = 'tpr04.pl'; # Read source file, keeping shebang line separate open IN, "<$working_file"; my $header = ; local $/ = undef; my $text = ; close IN; # Remove comment lines, newlines, space at beginning of lines $text =~ s/\n\s*(\#[^\n]*)?//g; # Convert \n and \t to literal newline, tab $text =~ s/\\n/\n/g; $text =~ s/\\t/\t/g; # Write the golfified program and run it through the golf test script open OUT, ">$golfy_file"; print OUT $header, $text; close OUT; system("perl $test_script");