Skip to content

Instantly share code, notes, and snippets.

@secwang
Created January 19, 2017 11:03
Show Gist options
  • Select an option

  • Save secwang/9a0ab7020eca7f8fc67f3c7c321be2d9 to your computer and use it in GitHub Desktop.

Select an option

Save secwang/9a0ab7020eca7f8fc67f3c7c321be2d9 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
my $filename = 'a.txt';
open(my $fh, '<:encoding(UTF-8)', $filename)
or die "Could not open file '$filename' $!";
while (my $row = <$fh>) {
chomp $row;
if ($row =~ /data-sku="(.+?)"/) {
print"$1\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment