Replace extract_global_symbols script by a more expressive Perl version