16 |
|
|
17 |
=head1 VERSION |
=head1 VERSION |
18 |
|
|
19 |
Version 0.16 |
Version 0.17 |
20 |
|
|
21 |
=cut |
=cut |
22 |
|
|
23 |
our $VERSION = '0.16'; |
our $VERSION = '0.17'; |
24 |
|
|
25 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
26 |
|
|
469 |
|
|
470 |
sub seek { |
sub seek { |
471 |
my $self = shift; |
my $self = shift; |
472 |
my $pos = shift || return; |
my $pos = shift; |
473 |
|
|
474 |
my $log = $self->_get_logger(); |
my $log = $self->_get_logger(); |
475 |
|
|
476 |
|
$log->confess("called without pos") unless defined($pos); |
477 |
|
|
478 |
if ($pos < 1) { |
if ($pos < 1) { |
479 |
$log->warn("seek before first record"); |
$log->warn("seek before first record"); |
480 |
$pos = 1; |
$pos = 1; |
568 |
|
|
569 |
sub _get_regex { |
sub _get_regex { |
570 |
my ($sf,$from,$to) = @_; |
my ($sf,$from,$to) = @_; |
571 |
|
if ($from =~ m/^regex:(.+)$/) { |
572 |
|
$from = $1; |
573 |
|
} else { |
574 |
|
$from = '\Q' . $from . '\E'; |
575 |
|
} |
576 |
if ($sf =~ /^\^/) { |
if ($sf =~ /^\^/) { |
577 |
return |
return |
578 |
's/\Q'. $sf .'\E([^\^]*?)\Q'. $from .'\E([^\^]*?)/'. $sf .'$1'. $to .'$2/'; |
's/\Q'. $sf .'\E([^\^]*?)'. $from .'([^\^]*?)/'. $sf .'$1'. $to .'$2/'; |
579 |
} else { |
} else { |
580 |
return |
return |
581 |
's/\Q'. $from .'\E/'. $to .'/g'; |
's/'. $from .'/'. $to .'/g'; |
582 |
} |
} |
583 |
} |
} |
584 |
|
|