Olivier Wirz wrote: > Hello, > > What is the best way to convert a numeric cobol format S9(09)V9(04) in a > more readable way.
How would we know? This is a Perl list. To some people here, the string above may be meaningful. To most, it is line noise. Try: I am working with formats in COBOL. COBOL expreses numerical values in a format where [fill in some blanks here if you want quality help] I would like my output to have a more natural form where [fill in some more blanks here] > > > For example: > > 000001000000} will be -1000.0000 > 000001000000{ will be 1000.0000 Gazing way deep in my crystal ball, I'm going to intuit that those left and right braces are a COBOL signed value indicators. The problem is that you haven't said this. > > > It works with substr and =~, but may be there is a module or another better > way. Search CPAN using COBOL as a keyword, maybe. It will do little good to move code out of COBOL, though, if you carry COBOL thinking with you. Presuming that you know what the significance of place value operators, etc. are for COBOL, you could: Read the COBOL output as strings, interpreting each string to its numerical value by the sysntactic rules you are familiar with. Output the numbers in Perl, since Perl's default output format is generally the natural expression of any numerical value. Practice thinking in full concepts, expressed in full words. You will get more long-term mileage out of this step than any code solution could possibly provide. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>