#!/usr/bin/perl use warnings; use strict; my $variable = 'xxx'; my $another_one = 'aaa'; my $content = do { local $/; }; print eval(qq("$content")); __DATA__ some text that may contain a $variable, or perhapse $another_one.