title: Use variables for template
body: <p>I do not know how to name even what I want to do, I know it's weird.</p>
  
  <p>I have a script and an external configuration file for this script. I want the user to be able to choose the variables themselves in an accessible form. Its something like template.</p>
  
  <h3>Script:</h3>
  
  <pre><code>#!/usr/bin/perl -w
  use strict;
  
  my ($from, $to);
  our $period;
  
  require file.conf
  
  $from = '2017-01-01';
  $to   = '2017-04-12';
  
  print $period;
  
  open my $fh, '&gt;&gt;', 'file.txt' or die "Cannot open!";
  print $fh join ("\n", $period));
  close $fh;
  </code></pre>
  
  <h3>file.conf</h3>
  
  <pre><code>$period = "$from \- $to";
  1;
  </code></pre>
  
  <h3>Expected output:</h3>
  
  <pre><code>2017-01-01 - 2017-04-12
  </code></pre>
  
  <p>This same output should be in file.txt. This solution is not working, on define $period has undefinied variables $from and $to. I want use this line in different line of code.</p>
  
  <p>Is such an output in some way possible? I emphasize that the idea is to make the solution the most aesthetic and most simple for the user who has no idea what a subroutine, hash or even array is.</p>