Acrux-DBI

 view release on metacpan or  search on metacpan

lib/Acrux/DBI/Dump.pm  view on Meta::CPAN


=head1 ATTRIBUTES

This class implements the following attributes

=head2 dbi

    $dump = $dump->dbi($dbi);
    my $dbi = $dump->dbi;

The object these processing belong to

=head2 name

    my $name = $dump->name;
    $dump = $dump->name('foo');

Name for this dump, defaults to C<schema>

=head1 METHODS

lib/Acrux/DBI/Dump.pm  view on Meta::CPAN

sub from_string {
    my $self = shift;
    my $s = shift;
    return $self unless defined $s;
    my $pool = $self->{pool} = {};
    my $tag = TAG_DEFAULT;
    my $delimiter = DELIMITER;
    my $is_new = 1;
    my $buf = '';

    # String processing
    while (length($s)) {
        my $chunk;

        # get fragments (chunks) from string
        if ($s =~ /^$delimiter/x) { # any delimiter char(s)
            $is_new = 1;
            $chunk = $delimiter;
        } elsif ($s =~ /^delimiter\s+(\S+)\s*(?:\n|\z)/ip) { # set new delimiter
            $is_new = 1;
            $chunk = ${^MATCH};



( run in 0.242 second using v1.01-cache-2.11-cpan-8d75d55dd25 )