Created
December 3, 2019 21:53
-
-
Save skrater/d7f5a73948fac1978bcd8faa0b68dc91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
my $filename = $ARGV[0]; | |
my $line = $ARGV[1]; | |
open my $fh, '<', $filename or die "Can't open file $!"; | |
my $file_content = do { local $/; <$fh> }; | |
my $regex = qr/$line.*?(?=AUTO_INCREMENT=([0-9]+))/sp; | |
if ( $file_content =~ /$regex/ ) { | |
print $1; | |
} | |
print 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment