#!/usr/bin/perl -w use strict; my $a = "Foo"; my $bar = "bar"; $a =~ s/(.*)/$1$bar/; print $a;