in reply to Search and replace text

This reeks of being a homework assignment, so my assistance will be limited to two items:

1: To generate a 2 digit random number, you could use something like:

$x = int(rand(100));
You'll need the number, so hang onto it.

2: Read the Perl documentation. You could do something like this:

$y =~ s!^\d{2}!$x!;
where $x is your random value and $y the line you're changing.

The actual i/o and program logic will be left as an exercise.

emc

" When in doubt, use brute force." — Ken Thompson