Question: I have a Laravel 5.1 install that I am upgrading. I meticulously followed the instructions available at <https://laravel.com/docs/5.3/upgrade#upgrade-5.2.0> for the upgrade, including removing **Illuminate\Foundation\Providers\ArtisanServiceProvider** and **Illuminate\Routing\ControllerServiceProvider** from the *config/app.php* file (I am stressing this point, as googling for this issue has suggested this in every response).

Despite this, I am still getting this error when I run composer *cache:clear*

```
[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Illuminate\Routing\ControllerServiceProvider' not found error 

```

and see this error in my browser:

```
FatalThrowableError in ProviderRepository.php line 146:
Class 'Illuminate\Routing\ControllerServiceProvider' not found

```

Thinking that perhaps references to these classes were being cached, I checked *bootstrap/cache/services.json* and removed the references from there as well and then ran composer dump-autoload but I am still getting this error.

I also made sure to copy over example *config/app.php* from Laravel 5.2 clean install example here: <https://raw.githubusercontent.com/ziyed/Laravel-5.2/master/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php>

I have read through the similar threads on StackOverflow and Laracast and tried tried to use the advice contained inside, but nothing seems to work.

Any help would be greatly appreciated. For reference, my dev setup is running on a local XAMPP stack under a Windows 10 OS. The other environments are remote, using a traditional LAMP stack with Amazon Linux 2. I was trying to do the upgrade locally.

Answer: 
You first have to split the line of stdin, then you can operate on each word using a `map` function. Without splitting, the stdin is only read line by line in the `for` loop.

```
#!/usr/bin/python
import sys

def capitalize(t):
    # Don't want to double print single character
    if len(t) is 1:
      return t.upper()
    else:
      return t[0].upper() + t[1:-1] + t[-1].upper()

for s in sys.stdin:
    splitLine = s.split()
    l = map(capitalize, splitLine)
    print(' '.join(l))

```

[Try it online!](https://tio.run/##XVBBTsMwELz7FYN6SCIgpeJWiRtHfoB6cOINWeTaxt4Ilc@HTQJUwhfPzM6OvZsuMsbwOM@7m/1U8r7jsE@rZvicYhaUSzHG0YDeJhbr@YtqaY4GenZ4jqESfNogkAgXp84TUmblhcObkn602fZCee3gAZ6CBoALDlsKkEmmHCDtlBLlulll8oX@G14fTr8e3Co9HO8PpxXp/ddthphRwGH5fFvEcdiCSvIsLxwIT9DCwn4e86qcbaqvQ95d3ZtlnaquULXvkUPtm8bMs4yEgcuoKyhw5BdogwOLxjnCx8RCsHBaMIu5s7pTBd8 "Python 3 – Try It Online")
You could just use the `capitalize` method for `str` which will do exactly what you need, and then uppercase the last letter individually, something like:

```
my_string = my_string.capitalize()
my_string = my_string[:-1] + my_string[-1].upper()

```