my $text2 = "rue' version='4' changeset='6456424' lat='36.7256674' lon='-4.4539391' />"; my ($latval) = $text2 =~ m/lat='(\d+\.\d+)/; print $latval;