Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Turning a questionable string into a numberby bradcathey (Prior) |
on Jun 29, 2017 at 17:43 UTC ( [id://1193851]=perlquestion: print w/replies, xml ) | Need Help?? |
bradcathey has asked for the wisdom of the Perl Monks concerning the following question: I'm reading in a tab delimited text file exported from Excel. The 12th "position" contains a simple 3 or 4 digit number. For some reason that number is coming in as a string, or something I'm not familiar with, and unusable as a number. This is from Dumper:
My database query was returning zip so I tested for the veracity of the uniq_id in line 78. The error is:
I did a hex dump and the number looks fine: 1130 = 31 31 33 30 Here's the code:
Thoughts on how to handle this?
—Brad "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Back to
Seekers of Perl Wisdom
|
|