Does this mean ‘food, for example, cake’ or ‘food that is similar to cake’?
The ambiguity can be solved by using ‘like’ to introduce a comparison and ‘such as’ to introduce an example. This usage of ‘like’ is perfectly acceptable in many contexts as long as the difference in meaning is recognised.
However, it should be avoided in formal writing; there are more appropriate, and clearer, alternatives.
- The Penguin Writer’s Manual, Martin Manser & Stephen Curtis