That's pretty simple, but first of all I've got a few questions. Is the location of the text file on the same or a different server than your script? if it is on the same server you should just be able to "open" it...otherwise you'll need to use LWP::Simple and use "get".
Assuming that the file is on the same server you should be able to do something like this...(this is a CGI app...so instead of using CGI you'll just be able to use $ARGV[0] (that will contain the first argument passed to the script)
Code:
#!/usr/bin/perl
use strict; use warnings;
use CGI;
my $cgi = CGI->new;
open(FILE, "data.txt") || die("Could not open file!");
my @contents=<FILE>;
close(FILE);
my $argv = $cgi->param('argv');
print "Content-type:text/plain\n\n";
foreach my $content (@contents){
if($content =~ m/^$argv=(.+)\sMB/){
print "$1\n";
}
}
That should do what you need.