NAME

DDC::Utils - various utilities for DDC::Concordance bindings

SYNOPSIS

 ##========================================================================
 ## PRELIMINARIES
 
 use DDC::Utils;
 
 ##========================================================================
 ## escapes
 
 $sym = unescape($escaped_symbol);
 $sym = unescapeq($single_quoted_symbol);
 $escaped_str = escape($str);
 $sq_escaped_str = escapeq($str);
 

DESCRIPTION

Exports

DDC::Utils inherits from Exporter, and can export the following tags:

:escape

Exports the DDC-style escaping functions unescape, unescapeq, escape, and escapeq.

:all

Exports all available symbols (currently just :escape).

Nothing is exported by default.

Escapes

unescape
 $sym = unescape($escaped_symbol);

Un-escapes a DDC-style symbol string.

unescapeq
 $sym = unescapeq($single_quoted_symbol);

Un-escapes a DDC-style quoted symbol symbol string, trimming initial and final single quotes if present.

escape
 $escaped_str = escape($str);

Returns a DDC-safe escaped symbol string for $str; currently just wraps quotemeta().

escapeq
 $sq_escaped_str = escapeq($str);

Returns a quoted DDC-safe escaped symbol string for $str, including surrounding single quotes. Tries to heuristically identify strings which do not require escaping and returns these as bareword literals.

ACKNOWLEDGEMENTS

perl by Larry Wall.

AUTHOR

Bryan Jurish <moocow@cpan.org>

COPYRIGHT

Copyright (c) 2006-2016, Bryan Jurish. All rights reserved.

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.

SEE ALSO

perl(1)