use strict; use warnings; print join '/', map {chomp;(split /=/)[-1]} ; __DATA__ a.b.c.d=10 a.b.e.f=9999 a.f.g.h=456