#!/usr/local/bin/perl use strict; use warnings; my ($rows, $cols) = (24, 80); my $text = q(I am $rows high and $cols long); $text =~ s/\$(\w+)/${$1}/g; print $text;