The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DDG::Meta::Helper - Helper functions for easy access to important functions

VERSION

version 1017

SYNOPSIS

In your goodie, for example:

  return "text from random source: ".$text."!",
    html => "<div>text from random source: ".html_enc($text)."!</div>";

Or use JSON-like booleans:

  { option1 => true, option2 => false }

DESCRIPTION

This meta class installs some helper functions.

EXPORTS FUNCTIONS

html_enc

encodes entities to safely post random data on HTML output.

uri_esc

Encodes entities to safely use it in URLs for links in the Goodie, for example.

Warning: Do not forget that the return value from a spice will automatically get url encoded for the path. It is not required to url encode values there, this will just lead to double encoding!

Booleans (true/false)

Use booleans true and false to set options.

AUTHOR

DuckDuckGo <open@duckduckgo.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2013 by DuckDuckGo, Inc. https://duckduckgo.com/.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004