File: Eval.pm

package info (click to toggle)
libdevel-ebug-perl 0.53-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 360 kB
  • sloc: perl: 2,056; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 510 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package Devel::ebug::Plugin::Eval;
use strict;
use warnings;
use base qw(Exporter);
our @EXPORT = qw(eval yaml);

# eval
sub eval {
  my($self, $eval) = @_;
  my $response = $self->talk({
    command => "eval",
    eval    => $eval,
  });
  return wantarray ? ( $response->{eval}, $response->{exception} ) :
                     $response->{eval};
}

# yaml
sub yaml {
  my($self, $yaml) = @_;
  my $response = $self->talk({
    command => "yaml",
    yaml    => $yaml,
  });
  return $response->{yaml};
}

1;