However, licks are modular, so I take it lick by lick (sort of like how I consume a lollypop) and learn it a lick at a time. It's not just learning the melody, it's also training myself to subconsciously anticipate and prepare for my pick strokes.
I guess they call it chunking: http://en.wikipedia.org/wiki/Chunking_(psychology)
I find that even when I think I have a song thoroughly memorized, if I learn a new lick that fits into the song, I run the risk of unintentionally altering the song to incorporate elements of the new lick. It's OK though, I'm more concerned with learning how to flatpick than I am with faithfully reproducing a melody.