A technique to fill semiconductors inside a microstructured optical fiber is developed. The structural, electrical and optical properties are investigated. All-optical modulation of light and an in-fiber field effect transistor are demonstrated using this device