Based upon SO answer "my ($export = $doc) =~ s{.odt}{.pdf};" why does this Perl script produce a compile error?
$ cat so.pl
#!/usr/bin/perl
my $doc ="x.odt";
my ($export = $doc) =~ s{\.odt}{.pdf};
$ ./so.pl
Can't declare scalar assignment in "my" at ./so.pl line 3, near ") =~"
Execution of ./so.pl aborted due to compilation errors.