I think this may be the first bug I've found in libyaml:

> ysh -MYAML::XS
Welcome to the YAML Test Shell. Type ':help' for more information.

ysh > --- "                                                                    
yaml> --                                                                       
yaml> "                                                                        
yaml> ...                                                                      
$VAR1 = ' -- ';
ysh > --- "                                                                    
yaml> ---                                                                      
yaml> "                                                                        
yaml> ...                                                                      
YAML Load Failed:
  YAML::XS::Load Error: The problem:
 
      found unexpected document indicator
 
  was found at document: 1, line: 2, column: 1
  while scanning a quoted scalar at line: 1, column: 5
ysh >                                                                          

The parser assumes a line containing '---' starts a new document, even if it is in a quoted string.

Cheers, Ingy