Perl question

well hello.... again...

Book: Learning Perl 2nd Edition
page 130
section (Globbing)

while ($nextname = </etc/host*>) {
$nextname =~ s#.*/##; #remove part befor last slash
print "one of the files is $nextname\n";
}

ok teh line im haveing an issue with is the "$nextname =~ s#.*/##;"

what i get from this is ()=my thoughts:
$nextname(filename) =~ (change formats) s(search)#(?).*/(any charicture to the last /)## (im lost)

I dont know what those dang "#" is for. nor do i understand why they used a format select.

can someone help break it down for me.

ok after not looking at it for a while i see the light.

s#.*/## is like saying

s/.*\///

where i was getting messed up is i thought in order to specify a new delimiter you had to use the "m" qualifer at the beginning of the regex.

apparely this is no longer the case. so long as all the following delimiters in that expression match teh first delimiter all is good.

Yeah. That's about it.

Sometimes it is real handy to substitute a hash for a stroke in some RegExp statements. Makes them easier to read and on the eye.

I think you can use any character for a delimeter but I have only used '/' and '#' myself.