As gellyfish correctly states, substr() is being used as an lvalue here, i.e. something you can assign to. In this case, you are replacing five characters (the third argument) of $DATE, starting at position two (the second argument, and counting from 0) with the concatenation $YEAR.$MONTH. Hence the output you observe.
CU
Robartes-
In reply to Re: What is substring working on here.
by robartes
in thread What is substring working on here.
by Scarborough
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |