#!/usr/local/bin/perl open(FILES, "p4 -s files //...|") || die "open(FILES...)"; my $sts = 0; while () { if (/^error: /) { print; $sts = 1; next; } elsif (/^exit: /) { } elsif (/^info: (\/\/.*)#\d+ - \w+ (default ){0,1}change (\d+ ){0,1}\([\w+]+\)$/) { &do_path($1); } else { die "assert: unparsed info line:\n$_"; } } exit $sts; my %d; my $N = 0; sub do_path { my ($p) = @_; $p =~ s/\/[^\/]+$//; if ($p eq "/") { return; } if (defined($d{$p})) { return; } $d{$p} = 1; &do_path($p); print "$p\n"; }