Sorry if this is a really dumb question but the documentation I've found on this subject is a bit sketchy and or beyond my experience. I want to replicate the UNIX (spit) df -k command so that I can monitor the utilisation of certain disc slices. After a bit of investigation I settled on the Filesys::DiskFree module. The problem is I can't get anything out of this script. I would have expected the following code to return a list of disc slices on the supplied disc name -

#!/usr/bin/perl -w # use Filesys::DiskFree; # $disc = '/dev/vx/dsk/var' ; new Filesys::DiskFree ; $handle->avail($disc) ;

I get the error message - Can't call method "avail" on an undefined value. Am I being particularily stupid here? Where do the returned values (if any - and there should be about 12) go to? I'm not very familiar with modules/methods so I won't be offended if this request is treated with disdain as long as my understanding of it improves.

Cheers,the ever so humble Ronnie Cruickshank

20040304 Edit by Corion: Added code tags around code

20040305 Edit by castaway: Changed title from 'Filesys::DiskFree'


In reply to Problems using Filesys::DiskFree by Ronnie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.