in reply to How to substitute a degree sign
I'd concentrate on extracting the numbers, rather than removing the symbols.
#!/usr/bin/perl use strict; use warnings; $_ = "55°48'10.000"; my ($d, $m, $s) = /([\d\.]+)/g; my $degrees = $d + ($m/60) + ($s/3600); print $degrees, "\n";
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|