kalyanbhave has asked for the wisdom of the Perl Monks concerning the following question:

Hi Everyone, Can anyone please help me in the below error.. I am trying to send an email automatically but seeing the below error..
"C:\Perl64\bin>disk.pl Can't locate Filesys/DiskSpace.pm in @INC (@INC contains: C:/strawb e/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib .) at C: isk.pl line 4. BEGIN failed--compilation aborted at C:\Perl64\bin\disk.pl line 4."
Below is the code I am using:
#!/usr/bin/perl use strict; use warnings; use Filesys::DiskSpace; # file system /home or /dev/sda5 my $dir = "H:"; # get data for /home fs my ($fs_type, $fs_desc, $used, $avail, $fused, $favail) = df $dir; # calculate free space in % my $df_free = (($avail) / ($avail+$used)) * 100.0; # display message my $out = sprintf("Disk space on $dir == %0.2f\n",$df_free); print $out;.

Replies are listed 'Best First'.
Re: not able to send an email automaticaly
by roboticus (Chancellor) on Sep 05, 2012 at 13:26 UTC

    kalyanbhave:

    Install Filesys::DiskSpace, and try it again. Note: you should wrap your code in code tags, like:

    <c>

    Your code goes here...

    </c>

    This way, people can read your code and be more inclined to give a meaningful response.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re: not able to send an email automaticaly
by Corion (Patriarch) on Sep 05, 2012 at 13:26 UTC

    Is Filesys::DiskSpace installed on your system?

    What is the output of

    c:\strawberry\perl\bin\perl.exe -MFilesys::DiskSpace -e1

    Why did you title your question "not able to send an email automaticaly" if your program has nothing to do with sending mail?

      Hello, I have an script which should send an automatic email regarding disk space..
Re: not able to send an email automaticaly
by aitap (Curate) on Sep 06, 2012 at 15:45 UTC
    Well, did you install the module? Assuming that you use Strawberry Perl, try cpan Filesys::DiskSpace.pm. See cpan for more info.
    Sorry if my advice was wrong.