It looks fine to me.

$e will only return anything if there was some sort of error. $c means that the file was skipped, and since a 0 was returned, it wasn't skipped. what you'll want to add is:
if($fs->suspicious) { # do something. }
What i'm guessing is that the file you're scanning has no viruses, thus nothing will really "show up" (and the previous bit of code will be skipped as well). You'll only have to worry when $fs->suspicious returns true (meaning a virus was found).

Update: Quick test:

use File::Scan; $fs = File::Scan->new(extension => 'bad', move => 'infected'); $fs->scan('a.pl'); #scan this file, it has no viruses =) print 'er: ', $fs->error, "\n"; print 'sk: ', $fs->skipped, "\n"; print 'su: ', $fs->suspicious, "\n"; __output__ er: sk: 0 su: 0
As you can see: no errors, it was scanned, and it wasn't suspicious. all is well.

--
Rock is dead. Long live paper and scissors!

In reply to Re: how to use file::scan by LTjake
in thread how to use file::scan by tsu

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.