You are looking at a very old, but free version of the course. If you are interesed the most recent version, check it out on the Perl Maven site.

11.36. Replace string in assembly code

Example 11-9. examples/regex/assembly_source.txt

mv A, R3
mv R2, B
mv R1, R3
mv B, R4
add A, R1
add B, R1
add R1, R2
add R3, R3
mv X, R2

Example 11-10. examples/regex/

use strict;
use warnings;

# assuming there are no R4 values then 4 substitutions will do

# or without any assumption and in one substitution:
my %map = (
    R1  => 'R2',
    R2  => 'R3',
    R3  => 'R1',


If you are interested in on-site trainings by the author, please contact me directly.