Skip to content

Instantly share code, notes, and snippets.

@yongbin
Created November 4, 2012 03:14
Show Gist options
  • Select an option

  • Save yongbin/4009964 to your computer and use it in GitHub Desktop.

Select an option

Save yongbin/4009964 to your computer and use it in GitHub Desktop.
simple.pl
# http://twitter.com/ditto572/status/264921423112458240
#
# perl -MBytes::Random::Secure=random_bytes_base64 -E 'print random_bytes_base64(32) for ( 0 .. 120000)' > list
# perl -MBytes::Random::Secure=random_bytes_base64 -E 'print random_bytes_base64(32) for ( 0 .. 50000)' > list2
use strict;
use warnings;
my %h;
{
open my $fh, '<', 'list1' or die;
$h{$_}++ while (<$fh>);
close($fh);
}
{
open my $fh, '<', 'list2' or die;
while (<$fh>) {
print unless exists $h{$_};
}
close($fh);
}
@yongbin
Copy link
Author

yongbin commented Nov 4, 2012

real 0m0.610s
user 0m0.246s
sys 0m0.113s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment