Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    Mac::SysProfile 0.05

    Download button

    No screenshots available
    Downloads: 607  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Daniel Muey | More programs
    Perl Artistic License / FREE
    February 12th, 2012, 18:49 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Mac::SysProfile description

    A Perl extension for OS X system_profiler

    Mac::SysProfile is a Perl extension for OS X system_profiler.

    SYNOPSIS

    use Mac::SysProfile;
    my $pro = Mac::SysProfile->new();
    print 'OS X Version ' . $pro->osx() . "n";
    print 'Darwin Version ' . $pro->darwin() . "n";

    OO interface to your Mac's system_profiler

    METHODS

    $pro->types()

    Returns an array ref of the datatypes available use for $pro->gettype()

    $pro->gettype()

    Returns a hashref of the given type's data.

    my $soft = $pro->gettype('SPSoftwareDataType');

    Once you call it for a type it returns the cached data on the next call unless the second argument is true.

    my $soft = $pro->gettype('SPSoftwareDataType',1);

    $pro->osx()


    Returns the system's OSX version. The first time it is called it finds it and stores it in the object for less overhead:

    if($pro->osx() eq '10.3.9') { # initially finds it
    print 'Do you want to upgrade from ' . $pro->osx() . "n"; # already processed so it returns the cached value (IE Fast)
    }
    print 'Your current version is: ' . $por->osx() . "n"; # already processed so it returns the cached value (IE Fast)
    You can make it reprocess and find it again fresh by giving it a true value:
    if($pro->osx() eq '10.3.9') { # initially finds it
    print 'Do you want to upgrade from ' . $pro->osx(1) . "n"; # finds it again from scratch instead of the cached value (IE slower)
    }
    print 'Your current version is: ' . $por->osx(1) . "n"; # finds it again from scratch instead of the cached value (IE slower)

    $pro->darwin()


    Same useage as $pro->osx() but returns the version of the system's Darwin.

    $pro->state_hashref()

    Returns a hashref of the entire object so far. Anything that has not been called it undef.

    $pro->xml()

    Returns an xml document of the type specified. An optional file handle or file to write the output to can be specified as the second argument. If you put it in a file that has a .spx extension then it will be an XML file which can be opened by System Profiler.app

    my $raw = $pro->xml('SPSoftwareDataType');
    $pro->xml('SPSoftwareDataType','./software.spx') or die "Could not create xml file: $!";
    $pro->xml('SPSoftwareDataType',*FH);


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    OS X system_profiler | system profiler | Perl module | Mac | OS X | system

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM