Re: compute depth of word in line

2018-03-10 Thread hw
"John W. Krahn" writes: > On Sat, 2018-03-10 at 00:14 +0100, hw wrote: >> >> Not really, the words I get from the ReadLine functions are not >> organized in an array. >> >> I´ve come up with this function to compute the "depth" of a word: >> >> >> sub get_depth { >>   my $string = shift; >>

Re: compute depth of word in line

2018-03-10 Thread John W. Krahn
On Sat, 2018-03-10 at 00:14 +0100, hw wrote: > > Not really, the words I get from the ReadLine functions are not > organized in an array. > > I´ve come up with this function to compute the "depth" of a word: > > > sub get_depth { >   my $string = shift; > >   $string =~ s/\s/ /g; >   $string =

Re: compute depth of word in line

2018-03-09 Thread hw
Jostein Berntsen writes: > On 25.02.18,18:32, hw wrote: >> Hi, >> >> what is the best way to find out the depth of the last word within a >> line? "Depth of a word" means "how many other words occur before the >> last one?". >> >> >> The background is that I want to write a CLI. The CLI shal

Re: compute depth of word in line

2018-02-26 Thread Jostein Berntsen
On 25.02.18,18:32, hw wrote: > Hi, > > what is the best way to find out the depth of the last word within a > line? "Depth of a word" means "how many other words occur before the > last one?". > > > The background is that I want to write a CLI. The CLI shall know a > number of commands like 's