http://www.perlmonks.org?node_id=644832


in reply to EasterRock: your custom ascii art maker

Very clear and simple!

Nice job!

You should add this to round it up...What if the text file is shorter than what you need to fill the image with? (just fill the rest with '=' or whatever you prefer)======

===============================================================

sub getLine { $_textBuffer =~ m/^(.{$_rockWidth})(.*)$/; $_textBuffer = $2; my $rtn = $1; $_textBuffer.= '=' x ($_rockWidth - length($_textBuffer)) if (leng +th($_textBuffer) < $_rockWidth); ## JUST IN CASE... return $rtn; }