in reply to Passing a $Scaler into a while loop...

First, that code won't compile. You have an unmatched right curly bracket.

Do you get any warnings? I get a couple "Use of uninitialized value" warnings. Hint: add a few print statements. I don't think the value of $_ is what you think it is.

I'm not sure why you need to declare $cut outside the scope of the loop. If there is a reason for doing it that way, it's not evident from the code you posted.

Finally, you split the line into @words, but you only test one word for vowels. You'll need to loop over each element of @words if you want to test every word on the line.

I hope this gives you a starting point. It sounds a bit like homework so I tried to err on the side of hints rather than handing you a solution outright.

Replies are listed 'Best First'.
Re^2: Passing a $Scaler into a while loop...
by chinamox (Scribe) on Oct 09, 2006 at 04:39 UTC

    Thank you for the very helpful reply. It is good to have someone tell where to look for the problem rather than just give you the answer.

    Sounding like homework is right for a reason...

    The issue is that I am taking corses online with a twelve hour time diffence so any help is often ten hours in comming. This is not good with a deadline and a day job!

      Oh. bobf was right (smelling like homework).

      Do us a favor. If you're looking for pointers for homework, let us know that. Heck, if you're looking for answers for homework, let us know that, too. You're less likely to get answers either way. I appreciate that you state you're looking for pointers and not answers. But let us know that up front.



      --chargrill
      s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)