#!/usr/bin/perl -w use strict; my $text, $ques, $ans; open(IN, "<$ARGV[0]")||die"Couldn't open $ARGV[0]: $!\n"; while(){ $text = &do_one_thing($_); ($ques, $ans) = &do_another_thing($text); print $ques." :: ".$ans."\n"; } close(IN); sub $do_one_thing{ my $line=uc($_); $line =~ s/this/that/g; return($line); } sub $do_another_thing{ my $another_line, $one, $two; $another_line = $_; ($one, $two) = $another_line =~ /(.[^\*]*)\*(.*)/; return($one, $two); }