in reply to seperating blocks of file content in an array
Not sure if this is what you really want, but it is what you asked for. Making it read from an external file is left as AEFTR.
#! perl -slw use strict; my @array; while(my $firstLine = <DATA>) { chomp $firstLine; push @array, $firstLine . ':'. <DATA>; } print for @array; __DATA__ >text 4 'As the low pressure moves in, the winds should slacken towards the en +d of the day. Will be a smaller day than Tuesday, but the odd clean w +ave 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 o +f perhaps the odd kneehigh set wave for the North coast.'
However, if you gave us a clearer idea of how you are going to use your "array", and if you posted some code to show what problems you are having, it would probably be possible to suggest a better solution.
Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.
|
|---|