$file = "/opt/local/bin/zap.exe"; $file =~ s|.*/||s; print $file; output: zap.exe