Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Subtracting Stringified Negative Numbers (Data::Dumber)

by monkfan (Curate)
on Jun 22, 2007 at 08:47 UTC ( #622747=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Subtracting Stringified Negative Numbers (Data::Dumber)
in thread Subtracting Stringified Negative Numbers

You are right, tye. Following your suggestion, and by doing this:

my $some_string = "0,-933"; $Data::Dumper::Useqq = 1; print Dumper ($some_string) ; my ($id1,$n1) = split(",",$some_string); #then do things with $n1 and $n2.
It gives:
$VAR1 = "0,\34-933";
So my questions are:
  • How can this \34 comes, in the first place? Can we avoid that?
    My development is always under Linux/Unix platform. And those variable values are read from a file.
  • How to remove this \34 character from $VAR?

Regards,
Edward


Comment on Re^3: Subtracting Stringified Negative Numbers (Data::Dumber)
Select or Download Code
Re^4: Subtracting Stringified Negative Numbers (Data::Dumber)
by BrowserUk (Pope) on Jun 22, 2007 at 16:43 UTC

    You're still posting snippets of what you think is going on, instead of snippets of real code. For example, your latest snippet simply doesn't do what you are suggesting it does:

    use Data::Dumper; $Data::Dumper::Useqq=1; my $some_string = "0,-933"; print Dumper $some_string; $VAR1 = "0,-933";
    So my questions are:
    • How can this \34 comes, in the first place? Can we avoid that?
    • My development is always under Linux/Unix platform. And those variable values are read from a file.
    • How to remove this \34 character from $VAR?

    The only conclusion we can draw from what you've posted so far is that the file you are reading these values from contains these \x1c (octal \34) characters.

    Try dumping the file using the od command:

    od -b \path\to\the\file # or od -tx1 \path\to\the\file

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-09-18 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (103 votes), past polls