Mojo::Home where is the spew method?

61 views Asked by At

Is the method silently gone? This produce an error, I have no clue why.

#!/usr/bin/env perl
use Mojo::Home;
my $f = Mojo::Home->new->path('test.txt');
$f->spew('test');

Can't locate object method "spew" via package "Mojo::File" at ...

It should be working: https://docs.mojolicious.org/Mojo/File#spew

2

There are 2 answers

0
Struppi On

Ok, the answer is the Version. I used yesterday 9.33 and there were no such method. If you upgrade to 9.35 it is.

It's not nice with this small upgrade to add a new function without any comment in the Docs. additionaly with the old function you may get now a warning.

0
ikegami On

->spew was added in 9.34 as an alias for ->spurt, at which time the name ->spurt became deprecated.

So, either

  • Upgrade to 9.34 or newer.
  • Use ->spurt instead of ->spew.