in reply to Using Split function.

Using File::Basename is of course better, But to show a regular expression that could handle this as well:

(my $filename_save= $file_path)=~ s#.*/##;

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e