You can use Mac::OSVersion under the same terms as Perl itself.