I DONT KNOW ABT MENTOR AMPLE.
BUT U CAN DO FILE MANIPULATION AS SHOWN IN THE PERL PROGRAM BELOW.
THIS IS ACTUALLY FOR WRITING INTO A FILE. TRY IF IT WORKS
#!/usr/bin/perl -w
#purpose
#writes to a file
use Getopt::Long
#Set up the command line to accept a filename
my $ret = GetOptions (" i | input:s ", " o | output:s ");
my $input = $opt_i || die "Usage: $O -i Input filename -o Output filename\n";
my $output = $opt_o || die "Usage: $O -i Input filename -o Output filename\n";
#opent the input file
open (INPUT,"$input") || die "Could not open file $input: $!\n";
#open the output file
open (OUTPUT,">$output") || die "Could not open file $output: $!\n";
#start reading from the input file
while (<INPUT>)
{
chop;
#write to the output filename
print OUTPUT "Line $. = <$_>\n";
}
#close the files
close (INPUT);
close (OUTPUT);