1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-07 17:05:43 -04:00
perlbuut/plugins/.svn/text-base/quote.pm.svn-base
2009-12-05 00:02:04 -05:00

14 lines
No EOL
504 B
Text

use Bot::BB3::MacroQuote ();
sub {
my( $said ) = @_;
$said->{body} =~ /\A\s*(\w+)\s?(.*)\z/s # note: only one space after the quoting mode so we can quote strings starting with space
or return;
my($mode, $str) = ($1, $2);
print Bot::BB3::MacroQuote::quote($mode, $str);
}
__DATA__
Escape a string to prepare for interpolation in an eval program code. Syntax is quote m string, with one space after quoting mode m which can be: z (no-op), c (c-like hex escapes), d (with delimiters), e, f, h.