I noticed that using synthetic argument since did not work when
Net::Twitter is constructed with InflateObjects trait as follows:
my $nt = Net::Twitter->new(
traits => ['API::REST', 'OAuth', 'RateLimit',
'InflateObjects'],
consumer_key => "...",
consumer_secret => "...",
ssl => 1
) or croak "$0: Failed to create twitter API object.";
then:
my $statuses = $twitter->user_timeline({
id => '...',
since => DateTime->now });
This was returning 20 statuses, it should have returned 0.
The problem lies in this function:
Net::Twitter::Core::_contains_statuses
This line:
return unless ref $e eq 'HASH';
does not work when the 'InflateObjects' trait is in effect.
In this case, ref $e eq 'Class::MOP::Class::__ANON__::SERIAL::4'.
I changed it instead to:
return unless ref $e eq 'HASH' || reftype $e eq 'HASH';
That worked.
It could possibly be simplified further to:
return unless reftype $e eq 'HASH';
But I did not try that.