in reply to Re: surprised to find cannot assign s/../../ to a variable
in thread surprised to find cannot assign s/../../ to a variable
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: surprised to find cannot assign s/../../ to a variable
by Danny (Chaplain) on Jul 05, 2024 at 13:31 UTC | |
by hippo (Archbishop) on Jul 05, 2024 at 13:40 UTC | |
by vincentaxhe (Scribe) on Jul 05, 2024 at 15:27 UTC | |
by hippo (Archbishop) on Jul 05, 2024 at 15:45 UTC | |
|
Re^3: surprised to find cannot assign s/../../ to a variable
by LanX (Saint) on Jul 06, 2024 at 13:04 UTC |