Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: first "project"

by zentara (Archbishop)
on Jun 01, 2004 at 13:22 UTC ( #358037=note: print w/ replies, xml ) Need Help??


in reply to first "project"

"1) does size matter?"

The size that matters, is the memory usage and cpu usage of the running process ID. The code size dosn't really matter, and as you keep working on your project, you will probably see where you can put redundant code into subroutines.

In a program that scans alot of files, I would be concerned with "speed". Not to disparage File::Scan, but it is awfully slow compared to a c program like clamav

Personally I would make a Tk frontend for running clamav, through backticks, or IPC::Open3

Looks nice though. :-)


I'm not really a human, but I play one on earth. flash japh


Comment on Re: first "project"
Re: Re: first "project"
by phenom (Chaplain) on Jun 01, 2004 at 22:35 UTC
    Thanks for the input! But actually, I did tweak this front-end to work with clamav, which is also on the website here. I don't work on it much, but it does work - although VERY slowly! If you can see any reason why it runs slow for me, let me know and I'll change it.
      "I don't work on it much, but it does work - although VERY slowly! If you can see any reason why it runs slow for me, let me know and I'll change it."

      Ok I see you are running a perl module interface to clamav

      use Mail::ClamAV qw/:all/;
      I'm talking about running the clamscan program itself directly:
      my $results = `clamscan $dir`;
      or something using Tk::Fileevent like:
      my $dir = "/var/spool/mail"; my $program = "/usr/local/bin/clamscan $dir"; open(SCAN, "$program 2>&1 |") or die "Can't open: $!"; $mw->fileevent(\*SCAN, 'readable', [\&fill_text_widget,$t]); MainLoop; sub fill_text_widget { my($widget) = @_; $_ = <SCAN>; $widget->insert('end', $_); $widget->yview('end'); }

      Its almost always faster to run properly designed c programs when doing alot of file access and reading, so let clamscan do it.


      I'm not really a human, but I play one on earth. flash japh
        Ok, I rewrote the clamscan version with your suggestion (see this). But it's still a little sluggish compared to the File::Scan version.

        I'd really like to switch to just doing the clamscan version, as it detects many more viruses.

        I'll try the Tk::Fileevent attempt soon. Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://358037]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2014-08-30 03:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls