in reply to Perl OO and dereferincing help

The first thing to note is that you could make your life much easier by utilizing shift() or pop() in your remove_card() method, which basically just reimplements that behavior.

Secondly, it looks like somewhere num() is getting called with a string as a param. Try adding a print statement inside the method, or better, a check like $_[1] =~ /\d+/.

Finally, it looks like remove_cards() calls cards() and supplies an array, not a reference to an array as cards() seems to expect. Update: Tadman rightly calls the former a list, not an array.

Hope that's helpful.