Skip to content

Instantly share code, notes, and snippets.

@tokuhirom
Created December 18, 2008 04:29
Show Gist options
  • Save tokuhirom/37374 to your computer and use it in GitHub Desktop.
Save tokuhirom/37374 to your computer and use it in GitHub Desktop.
sub strip_nl {
my $code = shift;
my $inner = do {
local $_MT = '';
local $_MT_T = '';
my @args = Devel::Caller::Perl::called_args(0);
$code->(@args);
$_MT;
};
$inner =~ s/^\s+//smg;
$inner =~ s/[\r\n]//g;
$_MT .= $inner;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment