in reply to •Re: Elegant way to parse an optional prefix with default?
in thread Elegant way to parse an optional prefix with default?
So I do need to put something on the first line to test for success failure, at least. (or update the regex to make $1 success but blank)
My ugly one line is:
as I couldn't get it to work with my ($sigil)= ... in list context to return matches. I guess that doesn't work with replacements as opposed to matches.my $sigil= ($name =~ s/^([$@%&<*])//) ? $1 : '&';
—John
|
|---|