Perl allows you to use any character without spaces as a line separator. See Quotations and query-like operators.
Breketingovye symbols are used in pairs, such as <...>, [...], (...)and {...}, while the single quotes prevent the interpolation. Otherwise, the functionality is identical to the default separator functionality.
In this case
$filename =~ s[^.+/][]
coincides with
$filename =~ s/^.+\///
but much more readable
|,
$filename =~ s|^.+/||