Or using split with a 3rd argument of -1 to prevent it from dropping null elements and map to substitute the 'NULL's.
print join':', map{ $_ eq '' ? 'NULL' : $_} split ':', 'root:XXXXXXXXX +XXXX:12103::::::',-1; root:XXXXXXXXXXXXX:12103:NULL:NULL:NULL:NULL:NULL:NULL
In reply to Re: Perl subsititution oddities...
by BrowserUk
in thread Perl subsititution oddities...
by smellysocks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |