Created
June 5, 2013 03:01
-
-
Save rjattrill/5711324 to your computer and use it in GitHub Desktop.
Read a data structure in __DATA__ back into a variable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use v5.10; | |
use Data::Dump qw(dump); | |
my $var; | |
while (<DATA>) { | |
$var .= $_; | |
} | |
my $hr = eval $var; | |
say "hr: " . dump $hr; | |
__DATA__ | |
[ | |
{ | |
key => 'value' | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment