in reply to How to use Substr to bulk substitutions?
#!/usr/bin/perl use strict; use warnings; my $string = 'This is string'; my $capture1 = $string, 6, 2, "is stretched"; # This will substitute a +s expected my $capture2 = $string, 9, 6, 'STRING'; # Now here original string wil +l be updated and positions I have already are of no use. __END__ Useless use of a constant (6) in void context at C:\test.pl line 6. Useless use of a constant (2) in void context at C:\test.pl line 6. Useless use of a constant ("is stretched") in void context at C:\test. +pl line 6. Useless use of a constant (9) in void context at C:\test.pl line 7. Useless use of a constant (6) in void context at C:test.pl line 7. Useless use of a constant ("STRING") in void context at C:\test.pl lin +e 7. Process completed successfully
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to use Substr to bulk substitutions?
by phoenix007 (Sexton) on May 17, 2019 at 04:42 UTC | |
by Marshall (Canon) on May 17, 2019 at 06:57 UTC |