my $upstream="a/b"; if ($upstream =~ /(.*)/(.*)/) { #如果分支是:a/b形式的,则把分支改成b $upstream=$2; print($upstream," "); }