---
name: "Cal::DAV"
section: "3pm"
platform: "linux"
package: "libcal-dav-perl"
version: "0.6-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Cal::DAV"
---

# Cal::DAV(3pm)

a CalDAV client

## NAME

Cal::DAV - a CalDAV client

## SYNOPSIS

```
    my $cal = Cal::DAV->new( user => $user, pass => $pass, url => $url);
    # the ics data will be fetched automatically if it's there
    # ... or you can parse some ics
    $cal->parse(filename => $data);
    # cal now has all the methods of Data::ICal
    # you can now monkey around with the object
    # saves the updated calendar
    $cal->save;
    # deletes the calendar
    $cal->delete;
    # lock the file on the server
    $cal->lock;
    # unlock the file on the server
    $cal->unlock
    # steal the lock
    $cal->steal_lock;
    # also
    $cal->forcefully_unlock_all
    # and
    $cal->lockdiscovery
    # resyncs it with the server
    $cal->get;
    # Get the underlying HTTP::DAV object
    my $dav = $cal->dav;
```

## DESCRIPTION

`"Cal::DAV"` is actually a very thin wrapper round `"HTTP::DAV"` and  `"Data::ICal"` but it may gain more functionality later and, in the mean  time, serves as something that

## TESTING

In order to test you need to define three environment variables: `"CAL_DAV_USER"`, `"CAL_DAV_PASS"` and `"CAL_DAV_URL_BASE"` which  points to a DAV collection that the user supplied has write  permissions for.

It should be noted that, at the moment, I'm having problems finding a CalDAV server that allows me to create files and so I can't run all  the tests.

## METHODS

### new \<arg\[s\]\>

Must have at least `"user"`, `"pass"` and `"url"` args where  `"url"` is the url of a remote, DAV accessible `".ics"` file.

Can optionally take an `"auto_commit"` option. See `"auto_commit()"` method below.

### parse \<arg\[s\]\>

Make a new calendar object using same arguments as `"Data::ICal"`'s `"new()"` or `"parse()"` methods.

Does not auto save for you.

Returns 1 on success and 0 on failure.

### save \[url\]

Save the calendar back to the server (or optionally to another path).

Returns 1 on success and 0 on failure.

### delete \[url\]

Delete the file on the server or optionally another url.

Returns 1 on success and 0 on failure.

### get \[url\]

Refetch the file from the sever to sync it -

Alternatively fetch an alternative url.

These will lose any local changes.

### lock

Same options as `"HTTP::DAV"`'s `"unlock"`.

### unlock

Same options as `"HTTP::DAV"`'s `"unlock"`.

### steal\_lock

Same options as `"HTTP::DAV"`'s `"steal_lock"`.

### lockdiscovery

Same options as `"HTTP::DAV::Response"`'s `"lockdiscovery"`.

### forcefully\_unlock\_all

Same options as `"HTTP::DAV::Response"`'s `"forcefully_unlock_all"`.

### dav \[HTTP::DAV\]

Get the underlying `"HTTP::DAV"` object or, alterntively, replace it with  a a new one.

### cal

Get the underlying cal object

### auto\_commit \[boolean\]

Whether to auto save on desctruction or not.

Defaults to 0.

### message

Same as `"HTTP::DAV"`'s `"message"` function.

### errors

Same as `"HTTP::DAV"`'s `"errors"` function.

## AUTHOR

Simon Wistow \<simon@thegestalt.org\>

## COPYRIGHT

Copyright 2007, Simon Wistow

Released under the same terms as Perl itself.

## SEE ALSO

HTTP::DAV

Data::ICal

http://tools.ietf.org/html/rfc4791
