You have too old a perl, try
#!/usr/bin/perl # https://perlmonks.org/?node_id=1220510 use strict; use warnings; while( <DATA> ) { s/(^| )(?!\d)/$&0/g; print; } __DATA__ 1 2 2 5 4 4 4 4 4 3 4 4 1 1 5 6 4
In reply to Re^3: substitute space to 0
by tybalt89
in thread substitute space to 0
by yueli711
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |