Popular culture portrays Roman soldiers primarily using their swords and shields as their main weapons. The pilum could be used as a javelin and is widely known today for that reason. However, you never see the pilum used as a spear wall or as phalanx for lack of a better term. Were they used in this manner in Roman history? I can’t imagine soldiers would be too keen to throw away a perfectly good spear without a second thought.
I can’t imagine soldiers would be too keen to throw away a perfectly good spear without a second thought.
If you're faced with enemy pikemen, the pilum-as-thrown-weapon lets you hit them before you get into range of the pike points. This is a Good Thing. Sticking pila into enemy shields and making them too cumbersome for use is also a Good Thing. Apart from those benefits, a heavy pilum is also a potentially useful armour-piercing weapon, and with the long iron shank might even be dangerous to an armoured enemy soldier after piercing his shield.
Pila were used as hand-to-hand weapons. For example, Arrian's Array against the Alans suggests the use of a pilum phalanx against cavalry:
Those standing in second, third an fourth rank of the formation must hold their spears ready for thrusting if possible, wounding the horses and killing the horsemen and put the rider out of action with the spear stuck in their heavy body armour and the iron point bent because of the softness. The following ranks should be of the javelineers.
It isn't completely absent from popular culture, either. Both Gladiator (2000) and Centurion (2010) have battle scenes where the Romans receive the enemy infantry charge with spears/pila in hand. (In both scenes, perhaps for safety, they are holding them with the points above the enemy heads, which wouldn't be effective, and their spears have little or no effect on the enemy charge.)
See my answer in https://www.reddit.com/r/AskHistorians/comments/ae3b17/if_spears_were_generally_better_than_swords_why/edo25zi/ for more details.