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
In reply to Re: How to substitute a degree sign
by davorg
in thread How to substitute a degree sign
by olecs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |