in reply to Re: Load external application to variable
in thread Load external application to variable

I meant something along the lines of:

my $application = "nmap";
my $app_var = undef;

my $app_options = " -sT -p 80 $IP"; if ( -f $application ){
  open(APP, "<$application");
  binmode APP;
  while( <APP> ){
    $app_var .= $_;
    }
  }

while{1}{

  #Run application loaded into variable...
  eval { $app_var $app_options };
}

It probably makes much better sense to copy the application to ramdisk and just run it from there. Thanks!! I would like to hear anyones' ideas on the subject, though.

Thanks!

-R1n0
  • Comment on Re^2: Load external application to variable

Replies are listed 'Best First'.
Re^3: Load external application to variable
by chromatic (Archbishop) on Nov 05, 2008 at 02:06 UTC
    It probably makes much better sense to copy the application to ramdisk and just run it from there.

    Any decent operating system already has disk caches (and can use "unused" memory as a disk cache). Why add another layer of complexity trying to subvert that process?

Re^3: Load external application to variable
by JavaFan (Canon) on Nov 04, 2008 at 21:09 UTC
    Well, that would require either writing a kernel module that can run Perl code and do all this from kernel space, or writing a Perl extension that can run binaries.

    Neither seem practical to me; it's a lot of work and I cannot really see much gain.

    But if you pull it off, I'd be very surprised if OSCON rejects your talk proposal. ;-)