I have this script that I use when I need to check perl's data type size in whatever machine I sit on (see below).
As you can see, it uses Config to report integers and double.
Does anybody know how to ask about single precision? Hint: it is not singlesize or floatsize.
Thank you,
Nr1culprit
The script:
#!/usr/bin/perl use strict; use warnings; use Config; print 'short ', $Config{shortsize}, "\n"; print 'int ', $Config{intsize}, "\n"; print 'long ', $Config{longsize}, "\n"; print 'longlong ', $Config{longlongsize}, "\n"; print 'doublesize ', $Config{doublesize}, "\n"; print 'byte order ', $Config{byteorder}, "\n"; exit;
Update:I got it to work just fine with pc88mxer suggestion.
Thank you.
Nr1culprit
In case you are interested, my little script now looks like this:
#!/usr/bin/perl use strict; use warnings; use Config; print 'short ', $Config{shortsize}, "\n"; print 'int ', $Config{intsize}, "\n"; print 'long ', $Config{longsize}, "\n"; print 'longlong ', $Config{longlongsize}, "\n"; print 'f via pack ', length(pack("f", 1.1)), "\n"; print 'doublesize ', $Config{doublesize}, "\n"; print 'byte order ', $Config{byteorder}, "\n"; exit;
Previous content restored and update tag added by GrandFather
In reply to Perl and data types (use Config;) by Nr1culprit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |