Strunk and White's The Elements of Style provides another kind of example, a misplaced modifier (another participle):
I saw the trailer peeking through the window.Presumably, the speaker means that he or she was peeking through the window, but the placement of "peeking through the window" makes it sound as though the trailer were peeking through the window.
Perhaps the most famous of the dangling modifiers is the dangling participle, as illustrated by the first example above. However, other modifiers' dangling can be just as much trouble. Consider, for instance, "As president of the kennel club, my poodle must be well groomed."
Modifiers sometimes are intended to describe the attitude or mood of the speaker, even when the speaker is not part of the sentence. Some such modifiers are standard and are not considered dangling modifiers—"speaking of [topic]," for example, is commonly used as a transition from one topic to a related one. However, in a sentence such as "fuming, she left the room," "fuming" can mean only one thing: it must modify "she."
In common speech, "hopefully", when used in this modern fashion, is known as a sentence adverb (cf. "admittedly", "mercifully", "oddly"). For example, most listeners will interpret "Hopefully, John got home last night" as meaning that the speaker hopes that John arrived home last night, not that John got home last night in a hopeful manner.
"Hopefully", used in this way, is thus reminiscent of the German "hoffentlich", which also means "it is to be hoped that...". Furthermore, it is because of their conciseness, avoiding the need to put into several words what can be said in one, that the use of sentence adverbs is establishing itself more and more in colloquial speech. Per Bernstein's Miss Thistlebottom's Hobgoblins:
No other word in English expresses that thought. In a single word we can say it is regrettable that (regrettably) or it is fortunate that (fortunately) or it is lucky that (luckily), and it would be comforting if there were such a word as hopably or, as suggested by Follett, hopingly, but there isn't. [...] In this instance nothing is to be lost—the word would not be destroyed in its primary meaning—and a useful, nay necessary term is to be gained.
What had been expressed in lengthy adverbial constructions, such as "it is regrettable that …" or "it is fortunate that …", had of course always been shortened to the adverbs "regrettably" or "fortunately". Bill Bryson says, "... those writers who scrupulously avoid 'hopefully' in such constructions do not hesitate to use at least a dozen other words—'apparently', 'presumably', 'happily', 'sadly', 'mercifully', 'thankfully', and so on—in precisely the same way". What has changed, however, in the controversy over "hopefully" being used for "he was hoping that ...", or "she was full of hope that ...", is that the original clause was transferred from the speaker, as a kind of shorthand to the subject itself, as though "it" had expressed the hope. ("Hopefully, the sun will be shining".) Although this still expressed the speaker's hope "that the sun will be shining" it may have caused a certain disorientation as to who was expressing what when it first appeared. As time passes, this controversy will fade as the usage becomes increasingly accepted, especially since such adverbs as "mercifully", "gratefully", and "thankfully" are similarly used.
Merriam-Webster gives a usage note on its entry for "hopefully" in which the editors point out that the disjunct sense of the word dates to the early 18th century and had been in widespread use since at least the 1930s. Objection to this sense of the word, they state, only became widespread in the 1960s. The editors maintain that this usage is "entirely standard".
One morning I shot an elephant in my pajamas. How he got into my pajamas I don't know.Though, logically, Captain Spaulding would have been wearing the pajamas, the line plays on the grammatical possibility that the elephant was wearing his pajamas, owing to its misplaced modifier.
A dangling modifier is one that does not actually modify the subject that it follows. The object it modifies is found in the sentence but it is not followed by the modifier.