summaryrefslogtreecommitdiff
path: root/portal/tools/pwn/2pick
blob: ff8d8efc6a863e730a49003c92e5ac79b321a2ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env perl

use strict;
use warnings;

use Tie::File;

die "Usage: $0 newfile usedfile" unless (-f $ARGV[0] && -f $ARGV[1]);
tie my @new, "Tie::File", $ARGV[0], recsep => "\n\n";
if (@new) {
    my $rec= shift @new;
    print "$rec\n\n";
    tie my @old, "Tie::File", $ARGV[1], recsep => "\n\n";
    push @old, $rec;
    untie @old;
}
untie @new;