% perl -we '$foo = 1; 3 >> $foo' Useless use of right bitshift (>>) in void context at -e line 1. #### use strict; use warnings; package Foo; use overload '>>' => 'right_shift'; sub new {bless {}, __PACKAGE__} sub right_shift { print "OK!\n"} package main; my $foo = Foo->new; my $x = "test" >> $foo; __END__ OK! #### () = "test" >> $foo;