Merge branch 'master' into next
[sliver-openvswitch.git] / tests / uuidfilt.pl
1 #! /usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 our %uuids;
7 our $n_uuids = 0;
8 sub lookup_uuid {
9     my ($uuid) = @_;
10     if (!exists($uuids{$uuid})) {
11         $uuids{$uuid} = $n_uuids++;
12     }
13     return "<$uuids{$uuid}>";
14 }
15
16 my $u = '[0-9a-fA-F]';
17 my $uuid_re = "${u}{8}-${u}{4}-${u}{4}-${u}{4}-${u}{12}";
18 while (<>) {
19     s/($uuid_re)/lookup_uuid($1)/eg;
20     print $_;
21 }