Pinhole glasses have a series of pinhole sized perforations instead of using a corrective lens. Each perforation allows a very narrow beam of light to enter the eye which reduces the size of the circle of confusion on the retina and increases depth of field.
Pinhole glasses are used to exercise your eyes because they can allow you to focus without your glasses. Using them for about 15 minutes a day can start to improve vision wihin about a fortnight. They can also be used as sunglasses but they shoud NOT be used whilst driving or operating machinery.