I suspect parsing ls -l will prove to be Interesting. If you know you will be running on *ix, try 'wc -c' or 'du -b', and know that you will still have problems on some systems.
If you know you will require perl, a little perl script will probably be the most sane. H