Sync with Fritz

Sorry for the monster pull request ... will use branches now.
use /usr/bin/env perl