to print the values you are interested in. lines 48/49 do the same as the equivalent code in C or java, only replace 'my' by 'int' and omit the '$'-s. there are not that many comments in this script, but the comment may answer some of your questions.
print
this is a perl script, you can just add a line
49a print "dev=$dev_size, ext=$extent_size, extents=$extents\n";
to print the values you are interested in. lines 48/49 do the same as the equivalent code in C or java, only replace 'my' by 'int' and omit the '$'-s. there are not that many comments in this script, but the comment may answer some of your questions.