(function($) { code })(jQuery) not working?

(function($) { code })(jQuery) not working?

(function($) { /* some code that uses $ */ })(jQuery)

seems to not work in jQuery 1.4.2. Nothing inside happens. I got it down to a simple alert('hello world'); and still nothing.

Is this just me or have I missed something.

Here is where it's documented and no changes from 1.4.2 have been posted on this page: http://docs.jquery.com/Using_jQuery_with_Other_Libraries