Help for this page

Select Code to Download


  1. or download this
    my $DSL = <<'DSL';
    :default ::= action => ::first
    ...
    WS ~ [\s]+
    
    DSL
    
  2. or download this
    karl@pazuzu:~/src/perl/debug/sexp-tiny$ bin/sexp.pl examples/fossil.da
    +t                                                                
    {  fields => {
    ...
                },
      type   => "fossil",
    }
    
  3. or download this
    karl@pazuzu:~/src/perl/debug/sexp-tiny$ echo '(acme (x 1))' | bin/sexp
    +.pl 
    bin/sexp.pl expected (key value...)
    
  4. or download this
    karl@pazuzu:~/src/perl/debug/sexp-tiny$ echo '(acme (x "1"))' | bin/se
    +xp.pl 
    { fields => { x => 1 }, type => "acme" }
    
  5. or download this
    #!/usr/bin/env perl
    
    ...
    
    my $norm = normalize( $$ast_ref, '$ast' );
    dd $norm;
    
  6. or download this
    karl@pazuzu:~/src/perl/sexp-tiny$ leftovers/ex02.pl 
    "(acme (pi \"3.14\")(nose \"cuke\"))"
    ...
    [numify] $ast[1][1]: "3.14" -> 3.14
    [unwrap] $ast[2][1]: Sexp::Tiny::String -> plain perl string "cuke"
    ["acme", ["pi", 3.14], ["nose", "cuke"]]