Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: problem spellchecker

by Anonymous Monk
on Nov 30, 2012 at 12:08 UTC ( #1006466=note: print w/replies, xml ) Need Help??


in reply to Re: problem spellchecker
in thread problem spellchecker

The problem is that is an exercice and I can't use subroutines or modules.

That sounds unbelievable -- sure modules, if part of the exercise is reinventing this particular wheel, but subroutines? the fundamental unit of reusable code? I'd ask for my money back.

Replies are listed 'Best First'.
Re^3: problem spellchecker
by Anonymous Monk on Dec 01, 2012 at 13:05 UTC

    LoL however.. I got it in this way. I think the problem was the first foreach loop..

    else { $line2 =~ s/$word/$correct[$user]/; $word = $error; @words = grep { $_ ne $error } @words; }

    I made a substitution in line, then I copied $word in another scalar, $error, and then I created again the @words array without $error !

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006466]
help
Chatterbox?
[tye]: no, thankfully (at least my version of Perl) has a different error for that.
[tye]: could be an unclosed m//, qr//, s///, or even q// (etc.) from earlier

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2016-12-07 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (131 votes). Check out past polls.