Such factors typically have a temporary effect on the level of prices but do not influence the rate of change of prices, that is, inflation. Importantly, if such shocks continue to hit the economy at regular intervals, as is the case with reduction in electricity and petroleum subsidies in Pakistan, then their effect filters into other prices and fuels inflationary expectations.
The last conceptual point that I want to highlight is that every economic policy decision entails a trade-off among desirable impact on key variables. We cannot have everything that we wish without paying a price. For example, we all understand that a rise in aggregate demand relative to the available productive capacity leads to inflation.