Hello finddata,
I execute your code and I get:
$ perl test.pl Could not open file 'sample.txt': No such file or directory at test_2. +pl line 74.
We need sample of your file.
Update: I think your mistake is extra backslash forward slash "/"on your regex.
Something like that:
s/\.config$/r
Similar question: (perl s/this/that/r ==> “Bareword found where operator expected”)
Update2: Copied from the question above:
As ruakh wrote, /r is new in perl 5.14. However you can do this in previous versions of perl:
(my $foo = $bar) =~ s/this/that/;
Update3: As haukex suggested I think the Perl Version that you are running is the problem.
In reply to Re: The following error occurs for below code.Help me to solve this?
by thanos1983
in thread How to write the following code with comamnd line arguments using perl?
by finddata
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |