FORCAST my $forcast = bless {lines => [split /\n/, $data]}; $forcast->ExtractData (); print $forcast->{date}; sub ExtractData { my $self = shift; chomp @{$self->{lines}}; $self->WMOHeader (); #... } sub WMOHeader { my $self = shift; my @header = splice @{$self->{lines}}, 0, 6; # Flush trailing empty lines shift @{$self->{lines}} while @{$self->{lines}} and $self->{lines}[0] =~ /^\s*$/; $self->{WMODoc} = $header[1]; $self->{NWSDoc} = $header[2]; $self->{advisory} = $header[3]; $self->{id} = $header[4]; $self->{date} = $header[5]; } sub News { my $self = shift; #... } #...