Re: Replace pattern with a variable num of spaces

2009-06-18 Thread John W. Krahn
Steve Bertrand wrote: John W. Krahn wrote: Steve Bertrand wrote: +sub is_word ($) { +return unless defined $_[0] && $_[0] ne ''; +return if $_[0] =~ /[\w\s]+/; +return 1; +} The other is_* functions in that module use anchors with their regular expressions so you probably should

Re: Replace pattern with a variable num of spaces

2009-06-18 Thread Steve Bertrand
John W. Krahn wrote: > Steve Bertrand wrote: >> I wasted about two hours of my coding time trying to come up with a >> special JAPH, but I just haven't been able to make map() do what I think >> it should do ;) > > What did you think it should do? What did you want it to do? Originally, I was t

Re: Replace pattern with a variable num of spaces

2009-06-17 Thread John W. Krahn
Steve Bertrand wrote: John W. Krahn wrote: Steve Bertrand wrote: [ snip ] In the third line of the following code, I want the replacement pattern to be (whitespace * $_[1]). I'll deal with the undef issue after I figure out how to use {$num} on essentially nothing. I haven't been able to make

Re: Replace pattern with a variable num of spaces

2009-06-17 Thread Steve Bertrand
John W. Krahn wrote: > Steve Bertrand wrote: [ snip ] >> In the third line of the following code, I want the replacement pattern >> to be (whitespace * $_[1]). I'll deal with the undef issue after I >> figure out how to use {$num} on essentially nothing. I haven't been able >> to make it work with

Re: Replace pattern with a variable num of spaces

2009-06-17 Thread John W. Krahn
Steve Bertrand wrote: I'm attempting to write a patch for a module that I feel I can use within one of my own modules, and I've run into something that I can't solve (I can't come up with the proper query in Google). Perhaps code will help here. First, I know 'word' does not include whitespace,

Replace pattern with a variable num of spaces

2009-06-17 Thread Steve Bertrand
I'm attempting to write a patch for a module that I feel I can use within one of my own modules, and I've run into something that I can't solve (I can't come up with the proper query in Google). Perhaps code will help here. First, I know 'word' does not include whitespace, and I know that one shou