sub format_lines($)
{
my $refonlines = shift;
my @lines = @{$refonlines};
my $tmppath = "-";
foreach (@lines)
{
next if ($_ =~ /^\s+/);
if ($_ =~ /(^\w+(\/\w*)*):/)
{
$tmppath = $1 if defined $1;
next;
}
print "$tmppath/$_";
}
}
sub main()
{
my @lines = ();
while (<>)
{
push (@lines, $_);
}
format_lines(\@lines);
}
main();