Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
package Foo; use strict; use overload '>>' => 'right_shift'; sub new {bless {}, __PACKAGE__} sub right_shift { print "OK!\n"} 1;
this generates the following output:#!/usr/bin/perl -w use strict; use Foo; my $foo = Foo->new; "test" >> $foo;
perl: ActivePerl 5.8.6.811 os: windows xp proUseless use of right bitshift (>>) in void context at foo.pl line 5. OK!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: overloading ">>" generates warning?
by Joost (Canon) on Aug 07, 2005 at 18:46 UTC | |
|
Re: overloading ">>" generates warning?
by tlm (Prior) on Aug 07, 2005 at 21:26 UTC | |
by Anonymous Monk on Aug 08, 2005 at 12:02 UTC | |
by tlm (Prior) on Aug 08, 2005 at 12:07 UTC | |
by Anonymous Monk on Aug 08, 2005 at 12:24 UTC |