Perl binding for
Perl PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Net::CronIO - Perl binding for


version 0.01


use 5.014;
use Net::CronIO;

my $cron = Net::CronIO->new(
    api_username => 'example',
    api_password => 'sekrit',

my $newjob = $cron->create_cron(
    name => 'Daily clean up job',
    url => '',
    schedule => '46 0 * * *',

my $jobs = $cron->get_all_crons();

foreach my $job ( $jobs ) {
    if ( $job->{'url'} =~ / ) {
          id => $job->{'id'},
          url => $job->{'url'} =~ s/deadhost\.com/example\.com/r,

say "deleted" if ( $cron->delete_cron( id => $jobs->[0]->{'id'} ) );

This is a Perl binding for the service. Cron is a Unix service which executes jobs on a periodic basis. The service contacts URLs using the same time period specification.

At the moment, the only way to generate a username and password for the service is by making a call on the create_user() method. Email verification is required before the credentials are valid.



You must supply an api_username for every method except create_user(). This can be done at object construction time, or later by calling the api_username() method.


You must supply an api_password for every method except create_user(). This can be done at object construction time, or later by calling the api_username() method.



This method requires the following parameters: email, username, password. This call will register a username/password with the service. Human intervention (in the form of an email verification) is required before your username/password are activated.

Once these credentials are active, you must provide them to this binding to execute other methods.

The return value is a string message provided by the API service (which evaluates to a true value in Perl.) This method dies on errors.


This method returns an arrayref containing hashes of all cron jobs for your username.

Hashes will contain the following keys:

  • id

This is an internal ID used by the service to identify a specific cron job. It is a required parameter for most of the other methods.

  • name

This is the name you assigned to a specific job.

  • url

The URL to contact at the given schedule specification.

  • schedule

This is a standard Unix cron style specification. See cron on Wikipedia for a verbose description of this format.

It is possible this call will return a reference to an empty list.


This method creates a new job. Required parameters are name, url, schedule.

The return value is a hash of id, plus the three params you provided.


This method retrieves a specific job by its id. id is a required parameter for this method. The return value is a hash as described above.


This method changes values with jobs which already have ids. id is a required parameter. Optional parameters are any or all of name, url, and/or schedule.


This method removes a job from the service. id is a required parameter. On success, this method returns a true value. It dies on errors.


To execute the full test suite, you must set CRONIO_API_USERNAME and CRONIO_API_PASSWORD environment variables with valid credentials.


Mark Allen


This software is copyright (c) 2012 by Mark Allen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.