#!perl use strict; use warnings; my $data = 'some random data to test this'; while (my ($line) = $data =~ m/^(.*)$/gm) { print "<0>" . $line ."\n"; }