Hi,
I think i posted my help on a different place but here goes again. I would like the following javascript code converted to perl code. I like the way this javascript works and i want that same thing for perl. So if anybody can help me with that i would appreciate it. Here is the code:
function cleanCAPS(str) {
capsallowed = 3; // Lowercase if more than ## CAPS in a row
do {
eval("re = /([A-Z] {" + (capsallowed+1) + ",})/g;");
myArray = str.match(re);
if (myArray) {
eval("re = /" + myArray[0] + "/;");
str = str.replace(re, ""+myArray[0].toLowerCase());
}
} while (myArray);
return str;
}
Thanks in advance!
I think i posted my help on a different place but here goes again. I would like the following javascript code converted to perl code. I like the way this javascript works and i want that same thing for perl. So if anybody can help me with that i would appreciate it. Here is the code:
function cleanCAPS(str) {
capsallowed = 3; // Lowercase if more than ## CAPS in a row
do {
eval("re = /([A-Z] {" + (capsallowed+1) + ",})/g;");
myArray = str.match(re);
if (myArray) {
eval("re = /" + myArray[0] + "/;");
str = str.replace(re, ""+myArray[0].toLowerCase());
}
} while (myArray);
return str;
}
Thanks in advance!