now I have to write thismy $namematch = defined $options{r} ? qr($options{r}) : qr{s/\.[^.]+$/ +/r}; my @name = $file =~ $namematch;
there will be many cases I donot want write substitudion code dead in the script.my $namematch = qr($options{r}); my @name = defined $options{r} ? $file =~ $namematch : $file =~ s/(\.[ +^.]+)+$//r;
In reply to Re^2: surprised to find cannot assign s/../../ to a variable
by vincentaxhe
in thread surprised to find cannot assign s/../../ to a variable
by vincentaxhe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |