Hello Monks,
I'm a total noob to perl and programing in general, and would appreciate any help to achieve what i want, and all i want is just a simple script that can be applied to any file and does two things.
first, find a matched number and replace it with a calculated value.
second, is to find a matched string and add the number of occurrence to it.
Ah, so fondly I remember when I became a PerlMonks member, And in my innocence never posted purely to be an XP Whore. Happily your code I’d borrow, and back again I’d be tomorrow Though some examples left me harrowed, harrowed and synapses sore, for my ignorance was abundant and my knowledge of the language poor, But now I’m just an XP Whore.
and to be replaced with:Ah, so fondly I remember when I became a PerlMonks member, And in my innocence never posted purely to be an XP (1) Whore. Happily your code I’d borrow, and back again I’d be tomorrow Though some examples left me harrowed, harrowed and synapses sore, for my ignorance was abundant and my knowledge of the language poor, But now I’m just an XP (2) Whore.
i did some search and that's what i found but i'm stuck and can't go any further.$^I = '.bak'; while (<>) { s/Z=(\d+),/ what do i do here? /g; s/\bXP\b/ what do i do here? /g; print }
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |