use strict; use warnings; my $weather = do "weather.txt"; print $_->{xml_api_reply}->{weather}->{forecast_information}->{city}->{-data},$/ for @$weather;