Register Repeats
- The registers can be used to record macros.
- To record a macro type
q{reg}, and type the keystrokes you wish to record and then type q. - To execute a macro type
@{reg}. - You can use the
{integer}@{reg} to execute it a number of times.
- For example:
qm/^sub<CR>4ly$/^{<CR>oprint "Entering <ESC>pa";<CR><ESC>q- Then typing
@m will cause:
sub hello
{
my ($x,$y) = @_;
print (($x+$y,"\n");
}
sub hello
{
print "Entering hello\n";
my ($x,$y) = @_;
print (($x+$y,"\n");
}- You can also type
1000@m and it will cause all the functions to be transformed.