Keep It Simple, Stupid | |
PerlMonks |
Re: Re: Question of variable interpolation in regexby l2kashe (Deacon) |
on Nov 15, 2002 at 19:27 UTC ( [id://213243]=note: print w/replies, xml ) | Need Help?? |
Ok I saw a couple of things.. 1) In your code you incremented your value even though the first line doesnt match "/\./". So you always start at 2 instead of 1. 2) you were using sprintf for your output when perl already had what you wanted to do built in via the nifty 'x' operator... I also changed the var names, just cause I could :) So here is what I came up with Is this what you were looking for? The same number of spaces that were previously '.'s on the line? Happy Hackin :) /* And the Creator, against his better judgement, wrote man.c */
In Section
Seekers of Perl Wisdom
|
|