## die() if we can't open the file open(F, "prof.xml") or die("ack: $!"); ## join together all the lines into a single string my $xml = join '', ; # see. also C ## assign $data to the capture in the regex ## also note the use of the 's' modifier (see. man perlre) my($data) = $xml =~ m{(.*)}s;