in reply to Suggestions to make this code more Perlish

In addition to the Regex suggestion - I'd suggest avoiding the @lines altogether.

Instead of "push @lines, $line (Storing it), why don't you call convert_to_ttf($line) at that point - this way, you can avoid the store .. and .. process .

Similarly, instead of storing @converted lines, then printing them, do that at the same place - so your code looks like:

open my $fh ... etc while (<>) { $line .= $_; if (is_complete_line($line)) { print $fh convert_to_ttf ($line); $line = ''; } } close $fh;

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992

Replies are listed 'Best First'.
Re^2: Suggestions to make this code more Perlish
by ricardo_sdl (Novice) on Mar 29, 2014 at 19:55 UTC

    Thanks. I updated the code.