Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Why are my hyphens in number strings stored as dots?

by oko1 (Deacon)
on Feb 14, 2012 at 03:07 UTC ( #953592=note: print w/ replies, xml ) Need Help??


in reply to Why are my hyphens in number strings stored as dots?

I'll agree with GrandFather, and add one: how about you show us the data, too - maybe by running it through 'hexdump -C' or some equivalent?

#!/usr/bin/perl -w use strict; my $s1 = "1\xe2\x80\x932\xe2\x80\x933"; my $s2 = "1-2-3"; print "$s1: not $s2, but a brilliant imitation!\n" unless $s1 eq $s2;

Output:

1𣇽: not 1-2-3, but a brilliant imitation!

Depending on your character set, those n-dashes could well end up looking like dots, etc.

-- 
I hate storms, but calms undermine my spirits.
 -- Bernard Moitessier, "The Long Way"


Comment on Re: Why are my hyphens in number strings stored as dots?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://953592]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-10-02 05:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (49 votes), past polls