"my" variable $outfile masks earlier declaration in same scope at ./volcano/volcano_parsing_2 line 14.

syntax error at ./volcano/volcano_parsing_2 line 14, near "open " #### #!/usr/bin/perl -w use strict; use warnings; use XML::FeedPP; use HTML::TreeBuilder::XPath; # input my $source = 'http://www.volcano.si.edu/news/WeeklyVolcanoRSS.xml'; # output my $markers_dir = "/Users/coblem/xplanet/markers"; my $outfile = "$markers_dir/volcano"; my $labelfile = "$markers_dir/label.txt" open my $fh,">",$outfile or die "$!"; open my $label, ">", $labelfile or die "$!"; # initialize report_header(); my $volcano_color = "Chocolate"; label_header($markers_dir); close $label; # process my $feed = XML::FeedPP->new( $source ); foreach my $volcano( $feed->get_item() ) { my $title = $volcano->get('title'); my $name = substr($title, 0, index($title, '(', 0)-1); my $locn = $volcano->get('georss:point'); print $fh <