0973382cc1bfc1cbe8f200a03a862a5e218fcb18
[libguestfs.git] / perl / examples / guestfs-perl.pod
1 =encoding utf8
2
3 =head1 NAME
4
5 guestfs-perl - How to use libguestfs from Perl
6
7 =head1 SYNOPSIS
8
9  use Sys::Guestfs;
10  
11  my $h = Sys::Guestfs->new ();
12  $h->add_drive_opts ('guest.img', format => 'raw');
13  $h->launch ();
14  $h->mount_options ('', '/dev/sda1', '/');
15  $h->touch ('/hello');
16  $h->sync ();
17
18 =head1 DESCRIPTION
19
20 This manual page documents how to call libguestfs from the Perl
21 programming language.  This page just documents the differences from
22 the C API and gives some examples.  If you are not familiar with using
23 libguestfs, you also need to read L<guestfs(3)>.  To read the
24 full Perl API, see L<Sys::Guestfs(3)>.
25
26 =head2 ERRORS
27
28 Errors from libguestfs functions turn into calls to
29 C<croak> (see L<Carp(3)>).
30
31 =head1 EXAMPLE 1: CREATE A DISK IMAGE
32
33 @EXAMPLE1@
34
35 =head1 EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE
36
37 @EXAMPLE2@
38
39 =head1 SEE ALSO
40
41 L<Sys::Guestfs(3)>,
42 L<guestfs(3)>,
43 L<guestfs-examples(3)>,
44 L<guestfs-java(3)>,
45 L<guestfs-ocaml(3)>,
46 L<guestfs-python(3)>,
47 L<guestfs-recipes(1)>,
48 L<guestfs-ruby(3)>,
49 L<http://libguestfs.org/>.
50
51 =head1 AUTHORS
52
53 Richard W.M. Jones (C<rjones at redhat dot com>)
54
55 =head1 COPYRIGHT
56
57 Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>
58
59 The examples in this manual page may be freely copied, modified and
60 distributed without any restrictions.
61
62 This library is free software; you can redistribute it and/or
63 modify it under the terms of the GNU Lesser General Public
64 License as published by the Free Software Foundation; either
65 version 2 of the License, or (at your option) any later version.
66
67 This library is distributed in the hope that it will be useful,
68 but WITHOUT ANY WARRANTY; without even the implied warranty of
69 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
70 Lesser General Public License for more details.
71
72 You should have received a copy of the GNU Lesser General Public
73 License along with this library; if not, write to the Free Software
74 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA