Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $size_in_mb = (-s $fh) / (1024 * 1024);
- use Number::Bytes::Human qw(format_bytes);
- my $size = format_bytes(-s $file); # 4.5M
- sub size_in_mb {
- my $size_in_bytes = shift;
- return $size_in_bytes / (1024 * 1024);
- }
- my $size_in_mb = (-s $fh) / (1024 * 1024);
Add Comment
Please, Sign In to add comment