Merge branch 'current/for_cpan_index' into current/dq
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class.pm
CommitLineData
ea2e61bf 1package DBIx::Class;
2
5d283305 3use strict;
4use warnings;
5
e0937fe2 6use DBIx::Class::_TempExtlib;
f4a8b21e 7
f9cc85ce 8our $VERSION;
9# Always remember to do all digits for the version even if they're 0
10# i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
11# brain damage and presumably various other packaging systems too
12
13# $VERSION declaration must stay up here, ahead of any other package
14# declarations, as to not confuse various modules attempting to determine
15# this ones version, whether that be s.c.o. or Module::Metadata, etc
2988a7b9 16$VERSION = '0.08901';
f9cc85ce 17
18$VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
19
37873f78 20use DBIx::Class::_Util;
d38cd95c 21use mro 'c3';
329d7385 22
2527233b 23use DBIx::Class::Optional::Dependencies;
24
db29433c 25use base qw/DBIx::Class::Componentised DBIx::Class::AccessorGroup/;
11736b4c 26use DBIx::Class::StartupCheck;
f9080e45 27use DBIx::Class::Exception;
3e110410 28
70c28808 29__PACKAGE__->mk_group_accessors(inherited => '_skip_namespace_frames');
9345b14c 30__PACKAGE__->_skip_namespace_frames('^DBIx::Class|^SQL::Abstract|^Try::Tiny|^Class::Accessor::Grouped|^Context::Preserve');
70c28808 31
ade0fe3b 32sub mk_classdata {
77d518d1 33 shift->mk_classaccessor(@_);
34}
35
36sub mk_classaccessor {
37 my $self = shift;
ade0fe3b 38 $self->mk_group_accessors('inherited', $_[0]);
77d518d1 39 $self->set_inherited(@_) if @_ > 1;
3e110410 40}
3c0068c1 41
7411204b 42sub component_base_class { 'DBIx::Class' }
227d4dee 43
f0750722 44sub MODIFY_CODE_ATTRIBUTES {
b5d2c57f 45 my ($class,$code,@attrs) = @_;
46 $class->mk_classdata('__attr_cache' => {})
47 unless $class->can('__attr_cache');
48 $class->__attr_cache->{$code} = [@attrs];
49 return ();
f0750722 50}
51
da95b45f 52sub _attr_cache {
b5d2c57f 53 my $self = shift;
54 my $cache = $self->can('__attr_cache') ? $self->__attr_cache : {};
9780718f 55
56 return {
57 %$cache,
58 %{ $self->maybe::next::method || {} },
20674fcd 59 };
da95b45f 60}
61
ea2e61bf 621;
34d52be2 63
97ad6fb8 64__END__
65
66=encoding UTF-8
67
75d07914 68=head1 NAME
34d52be2 69
7e4b2f59 70DBIx::Class - Extensible and flexible object <-> relational mapper.
34d52be2 71
06752a03 72=head1 WHERE TO START READING
3b1c2bbd 73
06752a03 74See L<DBIx::Class::Manual::DocMap> for an overview of the exhaustive documentation.
75To get the most out of DBIx::Class with the least confusion it is strongly
76recommended to read (at the very least) the
77L<Manuals|DBIx::Class::Manual::DocMap/Manuals> in the order presented there.
78
79=head1 HOW TO GET HELP
80
81Due to the complexity of its problem domain, DBIx::Class is a relatively
82complex framework. After you start using DBIx::Class questions will inevitably
83arise. If you are stuck with a problem or have doubts about a particular
84approach do not hesitate to contact the community with your questions. The
85list below is sorted by "fastest response time":
3b1c2bbd 86
a06e1181 87=over
3b1c2bbd 88
c6fdaf2a 89=item * IRC: irc.perl.org#dbix-class
90
91=for html
e1ddfc8a 92<a href="https://chat.mibbit.com/#dbix-class@irc.perl.org">(click for instant chatroom login)</a>
3b1c2bbd 93
a06e1181 94=item * Mailing list: L<http://lists.scsys.co.uk/mailman/listinfo/dbix-class>
3b1c2bbd 95
e1ddfc8a 96=item * RT Bug Tracker: L<https://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class>
86a23587 97
e1ddfc8a 98=item * Twitter: L<https://www.twitter.com/dbix_class>
86a23587 99
86a23587 100=item * Web Site: L<http://www.dbix-class.org/>
a06e1181 101
86a23587 102=back
103
34d52be2 104=head1 SYNOPSIS
105
113e8d16 106For the very impatient: L<DBIx::Class::Manual::QuickStart>
107
108This code in the next step can be generated automatically from an existing
109database, see L<dbicdump> from the distribution C<DBIx-Class-Schema-Loader>.
110
5b56d1ac 111=head2 Schema classes preparation
112
53aa53f3 113Create a schema class called F<MyApp/Schema.pm>:
34d52be2 114
03460bef 115 package MyApp::Schema;
a0638a7b 116 use base qw/DBIx::Class::Schema/;
34d52be2 117
f0bb26f3 118 __PACKAGE__->load_namespaces();
daec44b8 119
a0638a7b 120 1;
daec44b8 121
30e1753a 122Create a result class to represent artists, who have many CDs, in
53aa53f3 123F<MyApp/Schema/Result/Artist.pm>:
daec44b8 124
30e1753a 125See L<DBIx::Class::ResultSource> for docs on defining result classes.
126
03460bef 127 package MyApp::Schema::Result::Artist;
d88ecca6 128 use base qw/DBIx::Class::Core/;
daec44b8 129
a0638a7b 130 __PACKAGE__->table('artist');
131 __PACKAGE__->add_columns(qw/ artistid name /);
132 __PACKAGE__->set_primary_key('artistid');
326dacbf 133 __PACKAGE__->has_many(cds => 'MyApp::Schema::Result::CD', 'artistid');
daec44b8 134
a0638a7b 135 1;
daec44b8 136
30e1753a 137A result class to represent a CD, which belongs to an artist, in
53aa53f3 138F<MyApp/Schema/Result/CD.pm>:
39fe0e65 139
03460bef 140 package MyApp::Schema::Result::CD;
d88ecca6 141 use base qw/DBIx::Class::Core/;
39fe0e65 142
d88ecca6 143 __PACKAGE__->load_components(qw/InflateColumn::DateTime/);
a0638a7b 144 __PACKAGE__->table('cd');
bd077b47 145 __PACKAGE__->add_columns(qw/ cdid artistid title year /);
a0638a7b 146 __PACKAGE__->set_primary_key('cdid');
03460bef 147 __PACKAGE__->belongs_to(artist => 'MyApp::Schema::Result::Artist', 'artistid');
39fe0e65 148
a0638a7b 149 1;
39fe0e65 150
5b56d1ac 151=head2 API usage
152
a0638a7b 153Then you can use these classes in your application's code:
39fe0e65 154
a0638a7b 155 # Connect to your database.
03460bef 156 use MyApp::Schema;
157 my $schema = MyApp::Schema->connect($dbi_dsn, $user, $pass, \%dbi_params);
a0638a7b 158
159 # Query for all artists and put them in an array,
160 # or retrieve them as a result set object.
30e1753a 161 # $schema->resultset returns a DBIx::Class::ResultSet
2053ab2a 162 my @all_artists = $schema->resultset('Artist')->all;
163 my $all_artists_rs = $schema->resultset('Artist');
126042ee 164
30e1753a 165 # Output all artists names
4e8ffded 166 # $artist here is a DBIx::Class::Row, which has accessors
16ccb4fe 167 # for all its columns. Rows are also subclasses of your Result class.
85067746 168 foreach $artist (@all_artists) {
30e1753a 169 print $artist->name, "\n";
170 }
171
a0638a7b 172 # Create a result set to search for artists.
86beca1d 173 # This does not query the DB.
2053ab2a 174 my $johns_rs = $schema->resultset('Artist')->search(
6576ef54 175 # Build your WHERE using an SQL::Abstract structure:
2053ab2a 176 { name => { like => 'John%' } }
a0638a7b 177 );
39fe0e65 178
2053ab2a 179 # Execute a joined query to get the cds.
a0638a7b 180 my @all_john_cds = $johns_rs->search_related('cds')->all;
448c8424 181
f0bb26f3 182 # Fetch the next available row.
a0638a7b 183 my $first_john = $johns_rs->next;
448c8424 184
2053ab2a 185 # Specify ORDER BY on the query.
a0638a7b 186 my $first_john_cds_by_title_rs = $first_john->cds(
187 undef,
188 { order_by => 'title' }
189 );
448c8424 190
bd077b47 191 # Create a result set that will fetch the artist data
2053ab2a 192 # at the same time as it fetches CDs, using only one query.
884559b1 193 my $millennium_cds_rs = $schema->resultset('CD')->search(
a0638a7b 194 { year => 2000 },
195 { prefetch => 'artist' }
196 );
448c8424 197
880a1a0c 198 my $cd = $millennium_cds_rs->next; # SELECT ... FROM cds JOIN artists ...
bd077b47 199 my $cd_artist_name = $cd->artist->name; # Already has the data so no 2nd query
076652e8 200
fb13a49f 201 # new() makes a Result object but doesnt insert it into the DB.
264f1571 202 # create() is the same as new() then insert().
884559b1 203 my $new_cd = $schema->resultset('CD')->new({ title => 'Spoon' });
f183eccd 204 $new_cd->artist($cd->artist);
f183eccd 205 $new_cd->insert; # Auto-increment primary key filled in after INSERT
f183eccd 206 $new_cd->title('Fork');
207
884559b1 208 $schema->txn_do(sub { $new_cd->update }); # Runs the update in a transaction
f183eccd 209
bd077b47 210 # change the year of all the millennium CDs at once
211 $millennium_cds_rs->update({ year => 2002 });
f183eccd 212
213=head1 DESCRIPTION
214
215This is an SQL to OO mapper with an object API inspired by L<Class::DBI>
bd077b47 216(with a compatibility layer as a springboard for porting) and a resultset API
f183eccd 217that allows abstract encapsulation of database operations. It aims to make
218representing queries in your code as perl-ish as possible while still
a0638a7b 219providing access to as many of the capabilities of the database as possible,
f183eccd 220including retrieving related records from multiple tables in a single query,
53aa53f3 221C<JOIN>, C<LEFT JOIN>, C<COUNT>, C<DISTINCT>, C<GROUP BY>, C<ORDER BY> and
222C<HAVING> support.
f183eccd 223
224DBIx::Class can handle multi-column primary and foreign keys, complex
225queries and database-level paging, and does its best to only query the
75d07914 226database in order to return something you've directly asked for. If a
227resultset is used as an iterator it only fetches rows off the statement
228handle as requested in order to minimise memory usage. It has auto-increment
2053ab2a 229support for SQLite, MySQL, PostgreSQL, Oracle, SQL Server and DB2 and is
230known to be used in production on at least the first four, and is fork-
ec6415a9 231and thread-safe out of the box (although
9361b05d 232L<your DBD may not be|DBI/Threads and Thread Safety>).
f183eccd 233
dfccde48 234This project is still under rapid development, so large new features may be
53aa53f3 235marked B<experimental> - such APIs are still usable but may have edge bugs.
236Failing test cases are I<always> welcome and point releases are put out rapidly
dfccde48 237as bugs are found and fixed.
238
239We do our best to maintain full backwards compatibility for published
240APIs, since DBIx::Class is used in production in many organisations,
241and even backwards incompatible changes to non-published APIs will be fixed
242if they're reported and doing so doesn't cost the codebase anything.
243
264f1571 244The test suite is quite substantial, and several developer releases
245are generally made to CPAN before the branch for the next release is
246merged back to trunk for a major release.
f183eccd 247
6ed05cfd 248=head1 HOW TO CONTRIBUTE
249
250Contributions are always welcome, in all usable forms (we especially
251welcome documentation improvements). The delivery methods include git-
252or unified-diff formatted patches, GitHub pull requests, or plain bug
253reports either via RT or the Mailing list. Contributors are generally
254granted full access to the official repository after their first patch
255passes successful review.
256
257=for comment
258FIXME: Getty, frew and jnap need to get off their asses and finish the contrib section so we can link it here ;)
259
260This project is maintained in a git repository. The code and related tools are
261accessible at the following locations:
262
263=over
264
265=item * Official repo: L<git://git.shadowcat.co.uk/dbsrgits/DBIx-Class.git>
266
267=item * Official gitweb: L<http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class.git>
268
269=item * GitHub mirror: L<https://github.com/dbsrgits/DBIx-Class>
270
271=item * Authorized committers: L<ssh://dbsrgits@git.shadowcat.co.uk/DBIx-Class.git>
272
273=item * Travis-CI log: L<https://travis-ci.org/dbsrgits/dbix-class/builds>
274
275=for html
276&#x21AA; Stable branch CI status: <img src="https://secure.travis-ci.org/dbsrgits/dbix-class.png?branch=master"></img>
277
278=back
279
3942ab4d 280=head1 AUTHOR
34d52be2 281
266bdcc3 282mst: Matt S. Trout <mst@shadowcatsystems.co.uk>
34d52be2 283
dfccde48 284(I mostly consider myself "project founder" these days but the AUTHOR heading
285is traditional :)
286
3942ab4d 287=head1 CONTRIBUTORS
288
907ed671 289abraxxa: Alexander Hartmaier <abraxxa@cpan.org>
84e3c114 290
fd4b0742 291acca: Alexander Kuznetsov <acca@cpan.org>
292
6d84db2c 293aherzog: Adam Herzog <adam@herzogdesigns.com>
294
daeb1865 295Alexander Keusch <cpan@keusch.at>
296
c3de6b51 297alexrj: Alessandro Ranellucci <aar@cpan.org>
298
630ba6e5 299alnewkirk: Al Newkirk <we@ana.im>
300
6ebf5cbb 301amiri: Amiri Barksdale <amiri@metalabel.com>
302
b703fec7 303amoore: Andrew Moore <amoore@cpan.org>
304
913b4bae 305andrewalker: Andre Walker <andre@andrewalker.net>
306
266bdcc3 307andyg: Andy Grundman <andy@hybridized.org>
3942ab4d 308
266bdcc3 309ank: Andres Kievsky
3942ab4d 310
59ac6523 311arc: Aaron Crane <arc@cpan.org>
312
624764ae 313arcanez: Justin Hunter <justin.d.hunter@gmail.com>
314
ce4c07df 315ash: Ash Berlin <ash@cpan.org>
316
f8213ab0 317bert: Norbert Csongrádi <bert@cpan.org>
3d5bd2af 318
967a4c40 319blblack: Brandon L. Black <blblack@gmail.com>
3942ab4d 320
62eb8fe8 321bluefeet: Aran Deltac <bluefeet@cpan.org>
322
d6170b26 323bphillips: Brian Phillips <bphillips@cpan.org>
324
f856fe01 325boghead: Bryan Beeley <cpan@beeley.org>
326
23d9df41 327brd: Brad Davis <brd@FreeBSD.org>
328
bcb8f3ed 329bricas: Brian Cassidy <bricas@cpan.org>
330
3d7e3e05 331brunov: Bruno Vecchi <vecchi.b@gmail.com>
332
281719d2 333caelum: Rafael Kitover <rkitover@cpan.org>
334
f5f2af8f 335caldrin: Maik Hentsche <maik.hentsche@amd.com>
336
d3b0e369 337castaway: Jess Robinson
3942ab4d 338
266bdcc3 339claco: Christopher H. Laco
ccb9c9b1 340
266bdcc3 341clkao: CL Kao
3942ab4d 342
e21dfd6a 343da5id: David Jack Olrik <djo@cpan.org>
18360aed 344
11343b34 345dariusj: Darius Jokilehto <dariusjokilehto@yahoo.co.uk>
346
5f7ff3f0 347davewood: David Schmidt <davewood@gmx.at>
348
97ad6fb8 349daxim: Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 <daxim@cpan.org>
350
13de943d 351debolaz: Anders Nor Berle <berle@cpan.org>
352
d1f542db 353dew: Dan Thomas <dan@godders.org>
354
266bdcc3 355dkubb: Dan Kubb <dan.kubb-cpan@onautopilot.com>
ccb9c9b1 356
9382ad07 357dnm: Justin Wheeler <jwheeler@datademons.com>
358
0818c9a7 359dpetrov: Dimitar Petrov <mitakaa@gmail.com>
360
266bdcc3 361dwc: Daniel Westermann-Clark <danieltwc@cpan.org>
4685e006 362
5cffe785 363dyfrgi: Michael Leuchtenburg <michael@slashhome.org>
8fe164b9 364
7b71391b 365edenc: Eden Cardim <edencardim@gmail.com>
366
bfcecabc 367ether: Karen Etheridge <ether@cpan.org>
368
307f1265 369felliott: Fitz Elliott <fitz.elliott@gmail.com>
370
0ffada27 371freetime: Bill Moseley <moseley@hank.org>
372
ade0fe3b 373frew: Arthur Axel "fREW" Schmidt <frioux@gmail.com>
374
b4987ed0 375goraxe: Gordon Irving <goraxe@cpan.org>
376
d3b0e369 377gphat: Cory G Watson <gphat@cpan.org>
ad3d2d7c 378
61f031bf 379Grant Street Group L<http://www.grantstreet.com/>
380
e758ffe6 381groditi: Guillermo Roditi <groditi@cpan.org>
382
6dad89f5 383Haarg: Graham Knop <haarg@haarg.org>
384
157ce0cf 385hobbs: Andrew Rodland <arodland@cpan.org>
386
5d779578 387ilmari: Dagfinn Ilmari MannsE<aring>ker <ilmari@ilmari.org>
388
0ac0af6c 389initself: Mike Baas <mike@initselftech.com>
390
2bb4c37b 391ironcamel: Naveed Massjouni <naveedm9@gmail.com>
392
f165eda8 393jawnsy: Jonathan Yu <jawnsy@cpan.org>
394
bee21976 395jasonmay: Jason May <jason.a.may@gmail.com>
396
d3b0e369 397jesper: Jesper Krogh
5fb0c64c 398
4a743a00 399jgoulah: John Goulah <jgoulah@cpan.org>
400
102a2984 401jguenther: Justin Guenther <jguenther@cpan.org>
d7c4c15c 402
a14a46e2 403jhannah: Jay Hannah <jay@jays.net>
404
dffda3a2 405jmac: Jason McIntosh <jmac@appleseed-sc.com>
406
8b93a938 407jnapiorkowski: John Napiorkowski <jjn1056@yahoo.com>
408
11736b4c 409jon: Jon Schutz <jjschutz@cpan.org>
410
1aec4bac 411jshirley: J. Shirley <jshirley@gmail.com>
412
41519379 413kaare: Kaare Rasmussen
414
d3b0e369 415konobi: Scott McWhirter
535fc2ee 416
4e0a89e4 417littlesavage: Alexey Illarionov <littlesavage@orionet.ru>
418
4367679a 419lukes: Luke Saunders <luke.saunders@gmail.com>
420
709ea492 421marcus: Marcus Ramberg <mramberg@cpan.org>
422
114780ee 423mattlaw: Matt Lawrence
424
45bffdf0 425mattp: Matt Phillips <mattp@cpan.org>
426
58755bba 427michaelr: Michael Reddick <michael.reddick@gmail.com>
428
91d0c99f 429milki: Jonathan Chu <milki@rescomp.berkeley.edu>
430
b81d8515 431mithaldu: Christian Walde <walde.christian@gmail.com>
432
582fe49d 433mjemmeson: Michael Jemmeson <michael.jemmeson@gmail.com>
434
167e7634 435mstratman: Mark A. Stratman <stratman@gmail.com>
436
77e7e47d 437ned: Neil de Carteret
438
266bdcc3 439nigel: Nigel Metheringham <nigelm@cpan.org>
6565b410 440
d3b0e369 441ningu: David Kamholz <dkamholz@cpan.org>
442
66cf3a84 443Nniuq: Ron "Quinn" Straight" <quinnfazigu@gmail.org>
444
20b4c148 445norbi: Norbert Buchmuller <norbi@nix.hu>
446
48580715 447nuba: Nuba Princigalli <nuba@cpan.org>
448
d3b0e369 449Numa: Dan Sully <daniel@cpan.org>
450
dc571b76 451ovid: Curtis "Ovid" Poe <ovid@cpan.org>
452
6c30f9c3 453oyse: E<Oslash>ystein Torget <oystein.torget@dnv.com>
bf356c54 454
266bdcc3 455paulm: Paul Makepeace
4763f4b7 456
d3b0e369 457penguin: K J Cheetham
458
8cfef6f5 459perigrin: Chris Prather <chris@prather.org>
460
14899528 461peter: Peter Collingbourne <peter@pcc.me.uk>
caac1708 462
f8213ab0 463Peter Siklósi <einon@einon.hu>
464
6c30f9c3 465Peter Valdemar ME<oslash>rch <peter@morch.com>
466
266bdcc3 467phaylon: Robert Sedlacek <phaylon@dunkelheit.at>
a53b95f1 468
56fadd8f 469plu: Johannes Plunien <plu@cpan.org>
470
0c1a4a15 471Possum: Daniel LeWarne <possum@cpan.org>
472
d3b0e369 473quicksilver: Jules Bean
022e0893 474
4ed01b34 475rafl: Florian Ragwitz <rafl@debian.org>
476
0c1a4a15 477rainboxx: Matthias Dietrich <perl@rb.ly>
478
868a7b26 479rbo: Robert Bohne <rbo@cpan.org>
480
7ff0dace 481rbuels: Robert Buels <rmb32@cornell.edu>
482
0da8b7da 483rdj: Ryan D Johnson <ryan@innerfence.com>
484
66b1e361 485ribasushi: Peter Rabbitson <ribasushi@cpan.org>
d76e282a 486
b487918c 487rjbs: Ricardo Signes <rjbs@cpan.org>
488
6ffb5be5 489robkinyon: Rob Kinyon <rkinyon@cpan.org>
490
726c8f65 491Robert Olson <bob@rdolson.org>
492
a93441f2 493moltar: Roman Filippov <romanf@cpan.org>
e4c9f3f0 494
dc81dba3 495Sadrak: Felix Antonius Wilhelm Ostmann <sadrak@cpan.org>
496
d3b0e369 497sc_: Just Another Perl Hacker
ba606e58 498
266bdcc3 499scotty: Scotty Allen <scotty@scottyallen.com>
181a28f4 500
1c133e22 501semifor: Marc Mims <marc@questright.com>
502
16667b3a 503SineSwiper: Brendan Byrd <bbyrd@cpan.org>
504
20b4c148 505solomon: Jared Johnson <jaredj@nmgi.com>
506
88f937fb 507spb: Stephen Bennett <stephen@freenode.net>
508
59187a3b 509Squeeks <squeek@cpan.org>
510
637ca936 511sszabo: Stephan Szabo <sszabo@bigpanda.com>
512
a9e8284f 513talexb: Alex Beamish <talexb@gmail.com>
514
7bf0d0d6 515tamias: Ronald J Kimball <rjk@tamias.net>
f92a9d79 516
386c2272 517teejay : Aaron Trevena <teejay@cpan.org>
518
84e3c114 519Todd Lipcon
e063fe2c 520
6eb6264e 521Tom Hukins
522
2e4b6d78 523tonvoon: Ton Voon <tonvoon@cpan.org>
524
d15e3fc5 525triode: Pete Gamache <gamache@cpan.org>
526
d3b0e369 527typester: Daisuke Murase <typester@cpan.org>
c0e7b4e5 528
4740bdb7 529victori: Victor Igumnov <victori@cpan.org>
530
d3b0e369 531wdh: Will Hawes
4c248161 532
124162a0 533wesm: Wes Malone <wes@mitsi.com>
534
00c03ced 535willert: Sebastian Willert <willert@cpan.org>
536
66d2a14e 537wreis: Wallace Reis <wreis@cpan.org>
538
d7c37d66 539xenoterracide: Caleb Cushing <xenoterracide@gmail.com>
540
d52d4d6e 541yrlnry: Mark Jason Dominus <mjd@plover.com>
542
d3b0e369 543zamolxes: Bogdan Lucaciu <bogdan@wiz.ro>
78060df8 544
f9139687 545Zefram: Andrew Main <zefram@fysh.org>
546
b38e10bd 547=head1 COPYRIGHT
548
16be93fe 549Copyright (c) 2005 - 2011 the DBIx::Class L</AUTHOR> and L</CONTRIBUTORS>
b38e10bd 550as listed above.
551
96154ef7 552=head1 LICENSE
553
554This library is free software and may be distributed under the same terms
555as perl itself.