in reply to Load external application to variable

What do you mean by "loading an application into a variable name"? You probably don't mean:
my $application = "nmap"; my @args = qw !--stylesheet nmap.xsl!; while (1) { system $application, @arg and die; }

Replies are listed 'Best First'.
Re^2: Load external application to variable
by r1n0 (Beadle) on Nov 04, 2008 at 19:52 UTC
    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
      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?

      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. ;-)