in reply to Usage of Shift function in PERL
If that code is supposed to be a sample of actual working code, rather than a "spot the error" exercise, then you might want to think about submitting a bug report to Wiley. In addition to the main goof which has already been pointed out (the assumption that shift assigns a value to $_), I think it is poor practice to use $a and $b as run-of-the-mill temporary variables, since they have a special meaning to the sort function.
I don't think Perl instruction books should get beginners in the habit of using those variable names, because that can cause very perplexing time-wasting errors later on in scripts which use sort.