perl -Mstrict -wle 'my $b = "test"; $_=q{a $b c};s/\$([A-Za-z0-9_]+)/$main::{$1}/eg; print' Use of uninitialized value in substitution iterator at -e line 1. a c