praveenchappa has asked for the wisdom of the Perl Monks concerning the following question:
hi my snippet is working fine in perl 5.14 and above but throwing an error in perl 5.10, may be the syntax is not supproted,help me in rewriting it
if( $string=$string=~ s/\Q$oldstring\E/$newstring/gsr )//error here { .... ... ....... }
error info
Bareword found where operator expected at removestring.pl line 48, near "s/\Q$oldstring\E/$newstring/gsr"
syntax error at removestring.pl line 48, near "s/\Q$oldstring\E/$newstring/gsr"
syntax error at removestring.pl line 61, near "}"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem with perl 5
by Eily (Monsignor) on Mar 09, 2015 at 08:47 UTC | |
by praveenchappa (Acolyte) on Mar 09, 2015 at 08:55 UTC | |
by praveenchappa (Acolyte) on Mar 09, 2015 at 08:52 UTC | |
by Anonymous Monk on Mar 09, 2015 at 09:03 UTC | |
by Anonymous Monk on Mar 09, 2015 at 09:41 UTC | |
by Anonymous Monk on Mar 09, 2015 at 09:50 UTC | |
|
Re: problem with perl 5
by Tux (Canon) on Mar 09, 2015 at 14:47 UTC | |
|
Re: regex works in 5.14 but not in 5.10
by Anonymous Monk on Mar 09, 2015 at 22:37 UTC | |
by Anonymous Monk on Mar 09, 2015 at 23:00 UTC |