So I'm going through the Almighty Camel and reading the Gory Details on REs and I come across this little wonder:
# put commas in the right places in an integer
1 while s/(\d)(\d\d\d)(?!\d)/$1,$2/;
Which would take something like '3333333431234321234' and convert it nicely to 3,333,333,431,234,321,234. How does this work? I comprehend the RE itself and that the while forces looping when the condition is true but what does that '1' do?
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar";
$nysus = $PM . $MCF;