Hewlett-Packard announced Wednesday that it is slashing 27,000 jobs in a widely expected maneuver aimed at slimming down the struggling tech giant.