Skip to content

Instantly share code, notes, and snippets.

@ology
Last active March 26, 2026 16:19
Show Gist options
  • Select an option

  • Save ology/7736168e05258e7b5fcd634454f568f0 to your computer and use it in GitHub Desktop.

Select an option

Save ology/7736168e05258e7b5fcd634454f568f0 to your computer and use it in GitHub Desktop.
IO::Async::Process exit code 256? Why?
#!/usr/bin/env perl
use v5.36;
use IO::Async::Loop ();
use IO::Async::Process ();
use IO::Async::Timer::Periodic ();
my $loop = IO::Async::Loop->new;
my $timer = IO::Async::Timer::Periodic->new(
interval => 1,
on_tick => sub {
say "You've had 1 second (" . time() . ')';
my $proc = IO::Async::Process->new(
code => sub { say 'Hello?' },
on_finish => sub {
my ( $self, $exitcode ) = @_;
print "Process finished with code $exitcode\n";
},
);
$loop->add($proc);
},
);
$loop->add($timer);
$timer->start;
$loop->run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment