Skip to content

Instantly share code, notes, and snippets.

@notbenh
Created August 9, 2011 21:29
Show Gist options
  • Save notbenh/1135256 to your computer and use it in GitHub Desktop.
Save notbenh/1135256 to your computer and use it in GitHub Desktop.
example yaml that I'm trying to extract tags from
#!/usr/bin/perl
use strict;
use warnings;
use Test::More qw{no_plan};
use YAML;
my $yaml=q{- Dependency injection : __ ... in perl
- IoC :
- !!slide/detail Lets get this out of the way first
- Control = rm -rf dir
- Inverse = rm -ri dir
- IoC = code asks for help
- DI? : !!perl/q >
Dependency injection (DI) is an OO in technique that indicates to a part of a program which other parts it can use.
# in short DI is a lable from OO land, to refer to a practice of being able to shove in something from the outside.
};
ok my $data = Load($yaml);
is ref($data->[2]->{'DI?'}), 'q', q{Nope failed to get at tag?};
__END__
ok 1
not ok 2 - Nope failed to get at tag?
# Failed test 'Nope failed to get at tag?'
# at test.t line 19.
# got: ''
# expected: 'q'
1..2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment