You need to replace $system with a placeholder - it could be the word 'system' - and then, just before you print the header, use s/// to replace the placeholder with the value you want, which will be defined at that time.
my $header = "\n\n======= system =======\n"; ... sub change_password { my $system = shift; $header =~ s/system/$system/; ...
In reply to Re^3: expect.pm header
by GotToBTru
in thread expect.pm header
by amagana
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |