Created
April 27, 2017 01:17
-
-
Save genehack/25984830fe146dac6c4b95b0f2964a24 to your computer and use it in GitHub Desktop.
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
#! /usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use DDP; | |
use YAML::XS qw/ DumpFile LoadFile /; | |
my $file = './aoa.yaml'; | |
if ( -e $file ) { | |
my $data = LoadFile($file); | |
p $data; | |
} | |
else { | |
my $data = [ [ 1 .. 3 ], [ 4 .. 6 ] ]; | |
DumpFile($file, $data); | |
say "Look at $file..."; | |
} |
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
irving:~/Desktop | |
☹ [ 0 ] % ./foo.pl 18:16:14 | |
Look at ./aoa.yaml... | |
irving:~/Desktop | |
☺ % cat aoa.yaml 18:16:26 | |
--- | |
- - 1 | |
- 2 | |
- 3 | |
- - 4 | |
- 5 | |
- 6 | |
irving:~/Desktop | |
☺ % ./foo.pl 18:16:28 | |
\ [ | |
[0] [ | |
[0] 1, | |
[1] 2, | |
[2] 3 | |
], | |
[1] [ | |
[0] 4, | |
[1] 5, | |
[2] 6 | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment