with
view release on metacpan or search on metacpan
lib/with.pm view on Meta::CPAN
$msg =~ s/(called)\s+at.*/$1/s;
croak $msg;
}
croak "$name didn't exist and yet the call succeeded\n";
}
sub import {
return unless defined $_[1] and ref $_[1];
my $caller = (caller 0)[0];
my $id = refaddr $_[1];
$hints{$^H{with} = $id} = $_[1];
filter_add sub {
my ($status, $lastline);
my ($data, $count) = ('', 0);
while ($status = filter_read) {
return $status if $status < 0;
return $status unless defined $^H{with} && $^H{with} == $id;
if (/^__(?:DATA)__\r?$/ || /\b(?:use|no)\s+with\b/) {
$lastline = $_;
last;
}
( run in 0.220 second using v1.01-cache-2.11-cpan-05444aca049 )