#! perl -slw use strict; my @array; while(my $firstLine = ) { chomp $firstLine; push @array, $firstLine . ':'. ; } print for @array; __DATA__ >text 4 'As the low pressure moves in, the winds should slacken towards the end of the day. Will be a smaller day than Tuesday, but the odd clean wave should be found at some spots.' >text 8 'Unsure as to what the winds will do more today as it'll depend a lot on the track of the low pressure.' >text 9 'It'll be near calm and mellow conditions, although there's a chance of perhaps the odd kneehigh set wave for the North coast.'