Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

import XML-Atom 0.06 from CPAN

git-cpan-module:   XML-Atom
git-cpan-version:  0.06
git-cpan-authorid: BTROTT
git-cpan-file:     authors/id/B/BT/BTROTT/XML-Atom-0.06.tar.gz
  • Loading branch information...
commit b0066378933b186a949e9c7f8d87f45beb894595 1 parent dc4ec8f
Benjamin Trott authored schwern committed
13 Changes
... ... @@ -1,7 +1,18 @@
1   -$Id: Changes,v 1.15 2004/01/05 16:17:41 btrott Exp $
  1 +$Id: Changes,v 1.16 2004/04/24 10:09:12 btrott Exp $
2 2
3 3 Revision history for XML::Atom
4 4
  5 +0.06 2004.04.14
  6 + - BACKWARDS INCOMPATIBILITY:
  7 + Fixed Nonce behavior in API. Nonce should be sent in base64-encoded
  8 + form in SOAP and REST requests, but decoded (raw) nonce should be used
  9 + when generating PasswordDigest.
  10 + - Feed->add_link and Entry->add_link now support the same hash
  11 + reference parameter style as used in 0.041 and below, in addition
  12 + to the XML::Atom::Link parameter.
  13 + - Fixed bug with Feed->link so that it no longer returns links that
  14 + are contained within <entry> elements within the <feed>.
  15 +
5 16 0.05 2004.01.05
6 17 - BACKWARDS INCOMPABILITY:
7 18 Removed XML::Atom::Entry::get_links and XML::Atom::Feed::get_links,
4 META.yml
... ... @@ -1,5 +1,5 @@
1 1 name: XML-Atom
2   -version: 0.05
  2 +version: 0.06
3 3 abstract: Atom API and Feed Support
4 4 author: Benjamin Trott <cpan@stupidfool.org>
5 5 license: perl
@@ -18,4 +18,4 @@ no_index:
18 18 directory:
19 19 - t
20 20 - inc
21   -generated_by: Module::Install version 0.29
  21 +generated_by: Module::Install version 0.33
465 inc/ExtUtils/AutoInstall.pm
... ... @@ -1,20 +1,19 @@
1 1 #line 1 "inc/ExtUtils/AutoInstall.pm - /Library/Perl/5.8.1/ExtUtils/AutoInstall.pm"
2 2 # $File: //member/autrijus/ExtUtils-AutoInstall/lib/ExtUtils/AutoInstall.pm $
3   -# $Revision: #7 $ $Change: 9082 $ $DateTime: 2003/11/29 19:45:05 $
  3 +# $Revision: #9 $ $Change: 9532 $ $DateTime: 2004/01/01 06:47:30 $ vim: expandtab shiftwidth=4
4 4
5 5 package ExtUtils::AutoInstall;
6   -$ExtUtils::AutoInstall::VERSION = '0.55';
  6 +$ExtUtils::AutoInstall::VERSION = '0.56';
7 7
8 8 use strict;
9   -
10   -use Cwd;
  9 +use Cwd ();
11 10 use ExtUtils::MakeMaker ();
12 11
13   -#line 284
  12 +#line 282
14 13
15 14 # special map on pre-defined feature sets
16 15 my %FeatureMap = (
17   - '' => 'Core Features', # XXX: deprecated
  16 + '' => 'Core Features', # XXX: deprecated
18 17 '-core' => 'Core Features',
19 18 );
20 19
@@ -32,33 +31,33 @@ sub missing_modules {
32 31
33 32 sub do_install {
34 33 __PACKAGE__->install(
35   - [ UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}],
36   - @Missing,
  34 + [ UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}],
  35 + @Missing,
37 36 );
38 37 }
39 38
40 39 # initialize various flags, and/or perform install
41 40 sub _init {
42 41 foreach my $arg (@ARGV, split(/[\s\t]+/, $ENV{PERL_EXTUTILS_AUTOINSTALL} || '')) {
43   - if ($arg =~ /^--config=(.*)$/) {
44   - $Config = [ split(',', $1) ];
45   - }
46   - elsif ($arg =~ /^--installdeps=(.*)$/) {
47   - __PACKAGE__->install($Config, @Missing = split(/,/, $1));
48   - exit 0;
49   - }
50   - elsif ($arg =~ /^--default(?:deps)?$/) {
51   - $AcceptDefault = 1;
52   - }
53   - elsif ($arg =~ /^--check(?:deps)?$/) {
54   - $CheckOnly = 1;
55   - }
56   - elsif ($arg =~ /^--skip(?:deps)?$/) {
57   - $SkipInstall = 1;
58   - }
59   - elsif ($arg =~ /^--test(?:only)?$/) {
60   - $TestOnly = 1;
61   - }
  42 + if ($arg =~ /^--config=(.*)$/) {
  43 + $Config = [ split(',', $1) ];
  44 + }
  45 + elsif ($arg =~ /^--installdeps=(.*)$/) {
  46 + __PACKAGE__->install($Config, @Missing = split(/,/, $1));
  47 + exit 0;
  48 + }
  49 + elsif ($arg =~ /^--default(?:deps)?$/) {
  50 + $AcceptDefault = 1;
  51 + }
  52 + elsif ($arg =~ /^--check(?:deps)?$/) {
  53 + $CheckOnly = 1;
  54 + }
  55 + elsif ($arg =~ /^--skip(?:deps)?$/) {
  56 + $SkipInstall = 1;
  57 + }
  58 + elsif ($arg =~ /^--test(?:only)?$/) {
  59 + $TestOnly = 1;
  60 + }
62 61 }
63 62 }
64 63
@@ -88,97 +87,97 @@ sub import {
88 87 $Config = [];
89 88
90 89 my $maxlen = length((sort { length($b) <=> length($a) }
91   - grep { /^[^\-]/ }
  90 + grep { /^[^\-]/ }
92 91 map { ref($_) ? keys %{ref($_) eq 'HASH' ? $_ : +{@{$_}}} : '' }
93   - map { +{@args}->{$_} }
94   - grep { /^[^\-]/ or /^-core$/i } keys %{+{@args}})[0]);
  92 + map { +{@args}->{$_} }
  93 + grep { /^[^\-]/ or /^-core$/i } keys %{+{@args}})[0]);
95 94
96 95 while (my ($feature, $modules) = splice(@args, 0, 2)) {
97   - my (@required, @tests, @skiptests);
98   - my $default = 1;
99   - my $conflict = 0;
100   -
101   - if ($feature =~ m/^-(\w+)$/) {
102   - my $option = lc($1);
103   -
104   - # check for a newer version of myself
105   - _update_to($modules, @_) and return if $option eq 'version';
106   -
107   - # sets CPAN configuration options
108   - $Config = $modules if $option eq 'config';
109   -
110   - # promote every features to core status
111   - $core_all = ($modules =~ /^all$/i) and next
112   - if $option eq 'core';
113   -
114   - next unless $option eq 'core';
115   - }
116   -
117   - print "[".($FeatureMap{lc($feature)} || $feature)."]\n";
118   -
119   - $modules = [ %{$modules} ] if UNIVERSAL::isa($modules, 'HASH');
120   -
121   - unshift @$modules, -default => &{shift(@$modules)}
122   - if (ref($modules->[0]) eq 'CODE'); # XXX: bugward combatability
123   -
124   - while (my ($mod, $arg) = splice(@$modules, 0, 2)) {
125   - if ($mod =~ m/^-(\w+)$/) {
126   - my $option = lc($1);
127   -
128   - $default = $arg if ($option eq 'default');
129   - $conflict = $arg if ($option eq 'conflict');
130   - @tests = @{$arg} if ($option eq 'tests');
131   - @skiptests = @{$arg} if ($option eq 'skiptests');
132   -
133   - next;
134   - }
135   -
136   - printf("- %-${maxlen}s ...", $mod);
137   -
138   - # XXX: check for conflicts and uninstalls(!) them.
139   - if (defined(my $cur = _version_check(_load($mod), $arg ||= 0))) {
140   - print "loaded. ($cur".($arg ? " >= $arg" : '').")\n";
141   - push @Existing, $mod => $arg;
142   - $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
143   - }
144   - else {
145   - print "missing." . ($arg ? " (would need $arg)" : '') . "\n";
146   - push @required, $mod => $arg;
147   - }
148   - }
149   -
150   - next unless @required;
151   -
152   - my $mandatory = (($feature eq '-core' or $core_all) and $default);
153   -
154   - if (!$SkipInstall and ($CheckOnly or _prompt(
155   - qq{==> Do you wish to install the }. (@required / 2).
156   - ($mandatory ? ' mandatory' : ' optional').
157   - qq{ module(s)?}, $default ? 'y' : 'n',
158   - ) =~ /^[Yy]/)) {
159   - push (@Missing, @required);
160   - $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
161   - }
162   -
163   - elsif (!$SkipInstall and $mandatory and _prompt(
164   - qq{==> The module(s) are mandatory! Really skip?}, 'n',
165   - ) =~ /^[Nn]/) {
166   - push (@Missing, @required);
167   - $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
168   - }
169   -
170   - else {
171   - $DisabledTests{$_} = 1 for map { glob($_) } @tests;
172   - }
  96 + my (@required, @tests, @skiptests);
  97 + my $default = 1;
  98 + my $conflict = 0;
  99 +
  100 + if ($feature =~ m/^-(\w+)$/) {
  101 + my $option = lc($1);
  102 +
  103 + # check for a newer version of myself
  104 + _update_to($modules, @_) and return if $option eq 'version';
  105 +
  106 + # sets CPAN configuration options
  107 + $Config = $modules if $option eq 'config';
  108 +
  109 + # promote every features to core status
  110 + $core_all = ($modules =~ /^all$/i) and next
  111 + if $option eq 'core';
  112 +
  113 + next unless $option eq 'core';
  114 + }
  115 +
  116 + print "[".($FeatureMap{lc($feature)} || $feature)."]\n";
  117 +
  118 + $modules = [ %{$modules} ] if UNIVERSAL::isa($modules, 'HASH');
  119 +
  120 + unshift @$modules, -default => &{shift(@$modules)}
  121 + if (ref($modules->[0]) eq 'CODE'); # XXX: bugward combatability
  122 +
  123 + while (my ($mod, $arg) = splice(@$modules, 0, 2)) {
  124 + if ($mod =~ m/^-(\w+)$/) {
  125 + my $option = lc($1);
  126 +
  127 + $default = $arg if ($option eq 'default');
  128 + $conflict = $arg if ($option eq 'conflict');
  129 + @tests = @{$arg} if ($option eq 'tests');
  130 + @skiptests = @{$arg} if ($option eq 'skiptests');
  131 +
  132 + next;
  133 + }
  134 +
  135 + printf("- %-${maxlen}s ...", $mod);
  136 +
  137 + # XXX: check for conflicts and uninstalls(!) them.
  138 + if (defined(my $cur = _version_check(_load($mod), $arg ||= 0))) {
  139 + print "loaded. ($cur".($arg ? " >= $arg" : '').")\n";
  140 + push @Existing, $mod => $arg;
  141 + $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
  142 + }
  143 + else {
  144 + print "missing." . ($arg ? " (would need $arg)" : '') . "\n";
  145 + push @required, $mod => $arg;
  146 + }
  147 + }
  148 +
  149 + next unless @required;
  150 +
  151 + my $mandatory = ($feature eq '-core' or $core_all);
  152 +
  153 + if (!$SkipInstall and ($CheckOnly or _prompt(
  154 + qq{==> Auto-install the }. (@required / 2).
  155 + ($mandatory ? ' mandatory' : ' optional').
  156 + qq{ module(s) from CPAN?}, $default ? 'y' : 'n',
  157 + ) =~ /^[Yy]/)) {
  158 + push (@Missing, @required);
  159 + $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
  160 + }
  161 +
  162 + elsif (!$SkipInstall and $default and $mandatory and _prompt(
  163 + qq{==> The module(s) are mandatory! Really skip?}, 'n',
  164 + ) =~ /^[Nn]/) {
  165 + push (@Missing, @required);
  166 + $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
  167 + }
  168 +
  169 + else {
  170 + $DisabledTests{$_} = 1 for map { glob($_) } @tests;
  171 + }
173 172 }
174 173
175 174 _check_lock(); # check for $UnderCPAN
176 175
177 176 if (@Missing and not ($CheckOnly or $UnderCPAN)) {
178   - require Config;
179   - print "*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
180   - # make an educated guess of whether we'll need root permission.
181   - print " (You may need to do that as the 'root' user.)\n" if eval '$>';
  177 + require Config;
  178 + print "*** Dependencies will be installed the next time you type '$Config::Config{make}'.\n";
  179 + # make an educated guess of whether we'll need root permission.
  180 + print " (You may need to do that as the 'root' user.)\n" if eval '$>';
182 181 }
183 182 print "*** $class configuration finished.\n";
184 183
@@ -198,15 +197,15 @@ sub _check_lock {
198 197 my $lock = MM->catfile($CPAN::Config->{cpan_home}, ".lock");
199 198
200 199 if (-f $lock and open(LOCK, $lock)
201   - and ($^O eq 'MSWin32' ? _under_cpan() : <LOCK> == getppid())
202   - and ($CPAN::Config->{prerequisites_policy} || '') ne 'ignore'
  200 + and ($^O eq 'MSWin32' ? _under_cpan() : <LOCK> == getppid())
  201 + and ($CPAN::Config->{prerequisites_policy} || '') ne 'ignore'
203 202 ) {
204   - print << '.';
  203 + print << '.';
205 204
206 205 *** Since we're running under CPAN, I'll just let it take care
207 206 of the dependency's installation later.
208 207 .
209   - $UnderCPAN = 1;
  208 + $UnderCPAN = 1;
210 209 }
211 210
212 211 close LOCK;
@@ -220,13 +219,13 @@ sub install {
220 219
221 220 my (@modules, @installed);
222 221 while (my ($pkg, $ver) = splice(@_, 0, 2)) {
223   - # grep out those already installed
224   - if (defined(_version_check(_load($pkg), $ver))) {
225   - push @installed, $pkg;
226   - }
227   - else {
228   - push @modules, $pkg, $ver;
229   - }
  222 + # grep out those already installed
  223 + if (defined(_version_check(_load($pkg), $ver))) {
  224 + push @installed, $pkg;
  225 + }
  226 + else {
  227 + push @modules, $pkg, $ver;
  228 + }
230 229 }
231 230
232 231 return @installed unless @modules; # nothing to do
@@ -239,33 +238,33 @@ sub install {
239 238 my %failed;
240 239 local *FAILED;
241 240 if ($args{do_once} and open(FAILED, '.#autoinstall.failed')) {
242   - while (<FAILED>) { chomp; $failed{$_}++ }
243   - close FAILED;
244   -
245   - my @newmod;
246   - while (my ($k, $v) = splice(@modules, 0, 2)) {
247   - push @newmod, ($k => $v) unless $failed{$k};
248   - }
249   - @modules = @newmod;
  241 + while (<FAILED>) { chomp; $failed{$_}++ }
  242 + close FAILED;
  243 +
  244 + my @newmod;
  245 + while (my ($k, $v) = splice(@modules, 0, 2)) {
  246 + push @newmod, ($k => $v) unless $failed{$k};
  247 + }
  248 + @modules = @newmod;
250 249 }
251 250
252 251 if (_has_cpanplus()) {
253   - _install_cpanplus(\@modules, \@config);
  252 + _install_cpanplus(\@modules, \@config);
254 253 }
255 254 else {
256   - _install_cpan(\@modules, \@config);
  255 + _install_cpan(\@modules, \@config);
257 256 }
258 257
259 258 print "*** $class installation finished.\n";
260 259
261 260 # see if we have successfully installed them
262 261 while (my ($pkg, $ver) = splice(@modules, 0, 2)) {
263   - if (defined(_version_check(_load($pkg), $ver))) {
264   - push @installed, $pkg;
265   - }
266   - elsif ($args{do_once} and open(FAILED, '>> .#autoinstall.failed')) {
267   - print FAILED "$pkg\n";
268   - }
  262 + if (defined(_version_check(_load($pkg), $ver))) {
  263 + push @installed, $pkg;
  264 + }
  265 + elsif ($args{do_once} and open(FAILED, '>> .#autoinstall.failed')) {
  266 + print FAILED "$pkg\n";
  267 + }
269 268 }
270 269
271 270 close FAILED if $args{do_once};
@@ -287,56 +286,56 @@ sub _install_cpanplus {
287 286 # if we're root, set UNINST=1 to avoid trouble unless user asked for it.
288 287 my $makeflags = $conf->get_conf('makeflags') || '';
289 288 if (UNIVERSAL::isa($makeflags, 'HASH')) {
290   - # 0.03+ uses a hashref here
291   - $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST};
  289 + # 0.03+ uses a hashref here
  290 + $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST};
292 291 }
293 292 else {
294   - # 0.02 and below uses a scalar
295   - $makeflags = join(' ', split(' ', $makeflags), 'UNINST=1')
296   - if ($makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' });
  293 + # 0.02 and below uses a scalar
  294 + $makeflags = join(' ', split(' ', $makeflags), 'UNINST=1')
  295 + if ($makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' });
297 296 }
298 297 $conf->set_conf(makeflags => $makeflags);
299 298
300 299 while (my ($key, $val) = splice(@config, 0, 2)) {
301   - eval { $conf->set_conf($key, $val) };
  300 + eval { $conf->set_conf($key, $val) };
302 301 }
303 302
304 303 my $modtree = $cp->module_tree;
305 304 while (my ($pkg, $ver) = splice(@modules, 0, 2)) {
306   - print "*** Installing $pkg...\n";
  305 + print "*** Installing $pkg...\n";
307 306
308   - MY::preinstall($pkg, $ver) or next if defined &MY::preinstall;
  307 + MY::preinstall($pkg, $ver) or next if defined &MY::preinstall;
309 308
310   - my $success;
311   - my $obj = $modtree->{$pkg};
  309 + my $success;
  310 + my $obj = $modtree->{$pkg};
312 311
313   - if ($obj and defined(_version_check($obj->{version}, $ver))) {
314   - my $pathname = $pkg; $pathname =~ s/::/\\W/;
  312 + if ($obj and defined(_version_check($obj->{version}, $ver))) {
  313 + my $pathname = $pkg; $pathname =~ s/::/\\W/;
315 314
316   - foreach my $inc (grep { m/$pathname.pm/i } keys(%INC)) {
317   - delete $INC{$inc};
318   - }
  315 + foreach my $inc (grep { m/$pathname.pm/i } keys(%INC)) {
  316 + delete $INC{$inc};
  317 + }
319 318
320   - my $rv = $cp->install( modules => [ $obj->{module} ]);
  319 + my $rv = $cp->install( modules => [ $obj->{module} ]);
321 320
322   - if ($rv and ($rv->{$obj->{module}} or $rv->{ok})) {
323   - print "*** $pkg successfully installed.\n";
324   - $success = 1;
325   - }
326   - else {
327   - print "*** $pkg installation cancelled.\n";
328   - $success = 0;
329   - }
  321 + if ($rv and ($rv->{$obj->{module}} or $rv->{ok})) {
  322 + print "*** $pkg successfully installed.\n";
  323 + $success = 1;
  324 + }
  325 + else {
  326 + print "*** $pkg installation cancelled.\n";
  327 + $success = 0;
  328 + }
330 329
331   - $installed += $success;
332   - }
333   - else {
334   - print << ".";
  330 + $installed += $success;
  331 + }
  332 + else {
  333 + print << ".";
335 334 *** Could not find a version $ver or above for $pkg; skipping.
336 335 .
337   - }
  336 + }
338 337
339   - MY::postinstall($pkg, $ver, $success) if defined &MY::postinstall;
  338 + MY::postinstall($pkg, $ver, $success) if defined &MY::postinstall;
340 339 }
341 340
342 341 return $installed;
@@ -355,53 +354,53 @@ sub _install_cpan {
355 354 # if we're root, set UNINST=1 to avoid trouble unless user asked for it.
356 355 my $makeflags = $CPAN::Config->{make_install_arg} || '';
357 356 $CPAN::Config->{make_install_arg} = join(' ', split(' ', $makeflags), 'UNINST=1')
358   - if ($makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' });
  357 + if ($makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' });
359 358
360 359 # don't show start-up info
361 360 $CPAN::Config->{inhibit_startup_message} = 1;
362 361
363 362 # set additional options
364 363 while (my ($opt, $arg) = splice(@config, 0, 2)) {
365   - ($args{$opt} = $arg, next)
366   - if $opt =~ /^force$/; # pseudo-option
367   - $CPAN::Config->{$opt} = $arg;
  364 + ($args{$opt} = $arg, next)
  365 + if $opt =~ /^force$/; # pseudo-option
  366 + $CPAN::Config->{$opt} = $arg;
368 367 }
369 368
370 369 while (my ($pkg, $ver) = splice(@modules, 0, 2)) {
371   - MY::preinstall($pkg, $ver) or next if defined &MY::preinstall;
  370 + MY::preinstall($pkg, $ver) or next if defined &MY::preinstall;
372 371
373   - print "*** Installing $pkg...\n";
  372 + print "*** Installing $pkg...\n";
374 373
375   - my $obj = CPAN::Shell->expand(Module => $pkg);
376   - my $success = 0;
  374 + my $obj = CPAN::Shell->expand(Module => $pkg);
  375 + my $success = 0;
377 376
378   - if ($obj and defined(_version_check($obj->cpan_version, $ver))) {
379   - my $pathname = $pkg; $pathname =~ s/::/\\W/;
  377 + if ($obj and defined(_version_check($obj->cpan_version, $ver))) {
  378 + my $pathname = $pkg; $pathname =~ s/::/\\W/;
380 379
381   - foreach my $inc (grep { m/$pathname.pm/i } keys(%INC)) {
382   - delete $INC{$inc};
383   - }
  380 + foreach my $inc (grep { m/$pathname.pm/i } keys(%INC)) {
  381 + delete $INC{$inc};
  382 + }
384 383
385   - $obj->force('install') if $args{force};
  384 + $obj->force('install') if $args{force};
386 385
387   - if ($obj->install eq 'YES') {
388   - print "*** $pkg successfully installed.\n";
389   - $success = 1;
390   - }
391   - else {
392   - print "*** $pkg installation failed.\n";
393   - $success = 0;
394   - }
  386 + if ($obj->install eq 'YES') {
  387 + print "*** $pkg successfully installed.\n";
  388 + $success = 1;
  389 + }
  390 + else {
  391 + print "*** $pkg installation failed.\n";
  392 + $success = 0;
  393 + }
395 394
396   - $installed += $success;
397   - }
398   - else {
399   - print << ".";
  395 + $installed += $success;
  396 + }
  397 + else {
  398 + print << ".";
400 399 *** Could not find a version $ver or above for $pkg; skipping.
401 400 .
402   - }
  401 + }
403 402
404   - MY::postinstall($pkg, $ver, $success) if defined &MY::postinstall;
  403 + MY::postinstall($pkg, $ver, $success) if defined &MY::postinstall;
405 404 }
406 405
407 406 return $installed;
@@ -409,10 +408,10 @@ sub _install_cpan {
409 408
410 409 sub _has_cpanplus {
411 410 return (
412   - $HasCPANPLUS = (
413   - $INC{'CPANPLUS/Config.pm'} or
414   - _load('CPANPLUS::Shell::Default')
415   - )
  411 + $HasCPANPLUS = (
  412 + $INC{'CPANPLUS/Config.pm'} or
  413 + _load('CPANPLUS::Shell::Default')
  414 + )
416 415 );
417 416 }
418 417
@@ -434,9 +433,9 @@ sub _update_to {
434 433 return if defined(_version_check(_load($class), $ver)); # no need to upgrade
435 434
436 435 if (_prompt(
437   - "==> A newer version of $class ($ver) is required. Install?", 'y'
  436 + "==> A newer version of $class ($ver) is required. Install?", 'y'
438 437 ) =~ /^[Nn]/) {
439   - die "*** Please install $class $ver manually.\n";
  438 + die "*** Please install $class $ver manually.\n";
440 439 }
441 440
442 441 print << ".";
@@ -445,7 +444,7 @@ sub _update_to {
445 444
446 445 # install ourselves
447 446 _load($class) and return $class->import(@_)
448   - if $class->install([], $class, $ver);
  447 + if $class->install([], $class, $ver);
449 448
450 449 print << '.'; exit 1;
451 450
@@ -458,11 +457,11 @@ sub _connected_to {
458 457 my $site = shift;
459 458
460 459 return (
461   - ( _load('Socket') and Socket::inet_aton($site) ) or _prompt(qq(
  460 + ( _load('Socket') and Socket::inet_aton($site) ) or _prompt(qq(
462 461 *** Your host cannot resolve the domain name '$site', which
463 462 probably means the Internet connections are unavailable.
464 463 ==> Should we try to install the required module(s) anyway?), 'n'
465   - ) =~ /^[Yy]/
  464 + ) =~ /^[Yy]/
466 465 );
467 466 }
468 467
@@ -482,18 +481,18 @@ sub _can_write {
482 481 if (eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(qq(
483 482 ==> Should we try to re-execute the autoinstall process with 'sudo'?), 'y'
484 483 ) =~ /^[Yy]/) {
485   - # try to bootstrap ourselves from sudo
486   - print << ".";
  484 + # try to bootstrap ourselves from sudo
  485 + print << ".";
487 486 *** Trying to re-execute the autoinstall process with 'sudo'...
488 487 .
489 488 my $missing = join(',', @Missing);
490 489 my $config = join(',',
491   - UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}
  490 + UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}
492 491 ) if $Config;
493 492
494   - return unless system('sudo', $^X, $0, "--config=$config", "--installdeps=$missing");
  493 + return unless system('sudo', $^X, $0, "--config=$config", "--installdeps=$missing");
495 494
496   - print << ".";
  495 + print << ".";
497 496 *** The 'sudo' command exited with error! Resuming...
498 497 .
499 498 }
@@ -524,17 +523,17 @@ sub _version_check {
524 523
525 524 # check for version numbers that are not in decimal format
526 525 if (ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./) {
527   - if ($version::VERSION or defined(_load('version'))) {
528   - # use version.pm if it is installed.
529   - return ((version->new($cur) >= version->new($min)) ? $cur : undef);
530   - }
531   - elsif ($Sort::Versions::VERSION or defined(_load('Sort::Versions'))) {
532   - # use Sort::Versions as the sorting algorithm for a.b.c versions
533   - return ((Sort::Versions::versioncmp($cur, $min) != -1) ? $cur : undef);
534   - }
535   -
536   - warn "Cannot reliably compare non-decimal formatted versions.\n".
537   - "Please install version.pm or Sort::Versions.\n";
  526 + if ($version::VERSION or defined(_load('version'))) {
  527 + # use version.pm if it is installed.
  528 + return ((version->new($cur) >= version->new($min)) ? $cur : undef);
  529 + }
  530 + elsif ($Sort::Versions::VERSION or defined(_load('Sort::Versions'))) {
  531 + # use Sort::Versions as the sorting algorithm for a.b.c versions
  532 + return ((Sort::Versions::versioncmp($cur, $min) != -1) ? $cur : undef);
  533 + }
  534 +
  535 + warn "Cannot reliably compare non-decimal formatted versions.\n".
  536 + "Please install version.pm or Sort::Versions.\n";
538 537 }
539 538
540 539 # plain comparison
@@ -549,30 +548,30 @@ sub _make_args {
549 548 my %args = @_;
550 549
551 550 $args{PREREQ_PM} = { %{$args{PREREQ_PM} || {} }, @Existing, @Missing }
552   - if $UnderCPAN or $TestOnly;
  551 + if $UnderCPAN or $TestOnly;
553 552
554 553 if ($args{EXE_FILES}) {
555   - require ExtUtils::Manifest;
556   - my $manifest = ExtUtils::Manifest::maniread('MANIFEST');
  554 + require ExtUtils::Manifest;
  555 + my $manifest = ExtUtils::Manifest::maniread('MANIFEST');
557 556
558   - $args{EXE_FILES} = [
559   - grep { exists $manifest->{$_} } @{$args{EXE_FILES}}
560   - ];
  557 + $args{EXE_FILES} = [
  558 + grep { exists $manifest->{$_} } @{$args{EXE_FILES}}
  559 + ];
561 560 }
562 561
563 562 $args{test}{TESTS} ||= 't/*.t';
564 563 $args{test}{TESTS} = join(' ', grep {
565   - !exists($DisabledTests{$_})
  564 + !exists($DisabledTests{$_})
566 565 } map { glob($_) } split(/\s+/, $args{test}{TESTS}));
567 566
568 567 my $missing = join(',', @Missing);
569 568 my $config = join(',',
570   - UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}
  569 + UNIVERSAL::isa($Config, 'HASH') ? %{$Config} : @{$Config}
571 570 ) if $Config;
572 571
573 572 $PostambleActions = (
574   - $missing ? "\$(PERL) $0 --config=$config --installdeps=$missing"
575   - : "\@\$(NOOP)"
  573 + $missing ? "\$(PERL) $0 --config=$config --installdeps=$missing"
  574 + : "\@\$(NOOP)"
576 575 );
577 576
578 577 return %args;
@@ -584,10 +583,10 @@ sub Write {
584 583 Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
585 584
586 585 if ($CheckOnly) {
587   - print << ".";
  586 + print << ".";
588 587 *** Makefile not written in check-only mode.
589 588 .
590   - return;
  589 + return;
591 590 }
592 591
593 592 my %args = _make_args(@_);
@@ -629,4 +628,4 @@ installdeps ::
629 628
630 629 __END__
631 630
632   -#line 930
  631 +#line 929
49 inc/Module/Install.pm
... ... @@ -1,28 +1,29 @@
1 1 #line 1 "inc/Module/Install.pm - /Library/Perl/5.8.1/Module/Install.pm"
2 2 # $File: //depot/cpan/Module-Install/lib/Module/Install.pm $ $Author: autrijus $
3   -# $Revision: #64 $ $Change: 1812 $ $DateTime: 2003/12/14 20:24:49 $ vim: expandtab shiftwidth=4
  3 +# $Revision: #67 $ $Change: 1885 $ $DateTime: 2004/03/11 05:55:27 $ vim: expandtab shiftwidth=4
4 4
5 5 package Module::Install;
6   -$VERSION = '0.29';
  6 +$VERSION = '0.33';
7 7
8   -die <<END unless defined $INC{'inc/Module/Install.pm'};
9   -Please invoke Module::Install with:
  8 +die << "." unless $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'};
  9 +Please invoke ${\__PACKAGE__} with:
10 10
11   - use inc::Module::Install;
  11 + use inc::${\__PACKAGE__};
12 12
13 13 not:
14 14
15   - use Module::Install;
  15 + use ${\__PACKAGE__};
16 16
17   -END
  17 +.
18 18
19 19 use strict 'vars';
  20 +use Cwd ();
20 21 use File::Find ();
21 22 use File::Path ();
22 23
23 24 @inc::Module::Install::ISA = 'Module::Install';
24 25
25   -#line 128
  26 +#line 129
26 27
27 28 sub import {
28 29 my $class = shift;
@@ -39,21 +40,33 @@ sub import {
39 40 }
40 41
41 42 *{caller(0) . "::AUTOLOAD"} = $self->autoload;
  43 +
  44 + # Unregister loader and worker packages so subdirs can use them again
  45 + delete $INC{"$self->{file}"};
  46 + delete $INC{"$self->{path}.pm"};
42 47 }
43 48
44   -#line 151
  49 +#line 156
45 50
46 51 sub autoload {
47 52 my $self = shift;
48 53 my $caller = caller;
49   - sub {
50   - ${"$caller\::AUTOLOAD"} =~ /([^:]+)$/ or die "Cannot autoload $caller";
  54 +
  55 + my $cwd = Cwd::cwd();
  56 + my $sym = "$caller\::AUTOLOAD";
  57 +
  58 + $sym->{$cwd} = sub {
  59 + my $pwd = Cwd::cwd();
  60 + if (my $code = $sym->{$pwd}) {
  61 + goto &$code unless $cwd eq $pwd; # delegate back to parent dirs
  62 + }
  63 + $$sym =~ /([^:]+)$/ or die "Cannot autoload $caller";
51 64 unshift @_, ($self, $1);
52 65 goto &{$self->can('call')} unless uc($1) eq $1;
53 66 };
54 67 }
55 68
56   -#line 168
  69 +#line 181
57 70
58 71 sub new {
59 72 my ($class, %args) = @_;
@@ -78,7 +91,7 @@ sub new {
78 91 bless(\%args, $class);
79 92 }
80 93
81   -#line 197
  94 +#line 210
82 95
83 96 sub call {
84 97 my $self = shift;
@@ -89,7 +102,7 @@ sub call {
89 102 goto &{$obj->can($method)};
90 103 }
91 104
92   -#line 212
  105 +#line 225
93 106
94 107 sub load {
95 108 my ($self, $method) = @_;
@@ -113,7 +126,7 @@ END
113 126 $obj;
114 127 }
115 128
116   -#line 242
  129 +#line 255
117 130
118 131 sub load_extensions {
119 132 my ($self, $path, $top_obj) = @_;
@@ -127,12 +140,12 @@ sub load_extensions {
127 140 next if $self->{pathnames}{$pkg};
128 141
129 142 eval { require $file; 1 } or (warn($@), next);
130   - $self->{pathnames}{$pkg} = $INC{$file};
  143 + $self->{pathnames}{$pkg} = delete $INC{$file};
131 144 push @{$self->{extensions}}, $pkg->new( _top => $top_obj );
132 145 }
133 146 }
134 147
135   -#line 266
  148 +#line 279
136 149
137 150 sub find_extensions {
138 151 my ($self, $path) = @_;
@@ -155,4 +168,4 @@ sub find_extensions {
155 168
156 169 __END__
157 170
158   -#line 567
  171 +#line 614
6 inc/Module/Install/AutoInstall.pm
... ... @@ -1,6 +1,6 @@
1 1 #line 1 "inc/Module/Install/AutoInstall.pm - /Library/Perl/5.8.1/Module/Install/AutoInstall.pm"
2 2 # $File: //depot/cpan/Module-Install/lib/Module/Install/AutoInstall.pm $ $Author: autrijus $
3   -# $Revision: #12 $ $Change: 1481 $ $DateTime: 2003/05/07 10:41:22 $ vim: expandtab shiftwidth=4
  3 +# $Revision: #13 $ $Change: 1846 $ $DateTime: 2003/12/31 22:57:12 $ vim: expandtab shiftwidth=4
4 4
5 5 package Module::Install::AutoInstall;
6 6 use Module::Install::Base; @ISA = qw(Module::Install::Base);
@@ -39,6 +39,10 @@ manually install $p $v from cpan.org first...\n"}}}
39 39 my @core = map @$_, map @$_, grep ref,
40 40 $self->build_requires, $self->requires;
41 41
  42 + while ( @core and @_ > 1 and $_[0] =~ /^-\w+$/ ) {
  43 + push @core, splice(@_, 0, 2);
  44 + }
  45 +
42 46 ExtUtils::AutoInstall->import(
43 47 (@core ? (-core => \@core) : ()), @_, $self->features
44 48 );
2  inc/Module/Install/Base.pm
... ... @@ -1,6 +1,6 @@
1 1 #line 1 "inc/Module/Install/Base.pm - /Library/Perl/5.8.1/Module/Install/Base.pm"
2 2 # $File: //depot/cpan/Module-Install/lib/Module/Install/Base.pm $ $Author: autrijus $
3   -# $Revision: #9 $ $Change: 1665 $ $DateTime: 2003/08/18 07:52:47 $ vim: expandtab shiftwidth=4
  3 +# $Revision: #10 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
4 4
5 5 package Module::Install::Base;
6 6
2  inc/Module/Install/Build.pm
@@ -63,4 +63,4 @@ sub ACTION_dist {
63 63
64 64 __END__
65 65
66   -#line 177
  66 +#line 178
23 inc/Module/Install/Can.pm
... ... @@ -1,20 +1,20 @@
1 1 #line 1 "inc/Module/Install/Can.pm - /Library/Perl/5.8.1/Module/Install/Can.pm"
2   -# $File: //depot/cpan/Module-Install/lib/Module/Install/Can.pm $ $Author: ingy $
3   -# $Revision: #5 $ $Change: 1377 $ $DateTime: 2003/03/20 15:11:54 $ vim: expandtab shiftwidth=4
  2 +# $File: //depot/cpan/Module-Install/lib/Module/Install/Can.pm $ $Author: autrijus $
  3 +# $Revision: #6 $ $Change: 1840 $ $DateTime: 2003/12/28 19:42:02 $ vim: expandtab shiftwidth=4
4 4
5 5 package Module::Install::Can;
6 6 use Module::Install::Base; @ISA = qw(Module::Install::Base);
7 7 $VERSION = '0.01';
  8 +
8 9 use strict;
  10 +use Config ();
  11 +use File::Spec ();
  12 +use ExtUtils::MakeMaker ();
9 13
10 14 # check if we can run some command
11 15 sub can_run {
12 16 my ($self, $cmd) = @_;
13 17
14   - require Config;
15   - require File::Spec;
16   - require ExtUtils::MakeMaker;
17   -
18 18 my $_cmd = $cmd;
19 19 return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
20 20
@@ -28,9 +28,14 @@ sub can_run {
28 28
29 29 sub can_cc {
30 30 my $self = shift;
31   - require Config;
32   - my $cc = $Config::Config{cc} or return;
33   - $self->can_run($cc);
  31 + my @chunks = split(/ /, $Config::Config{cc}) or return;
  32 +
  33 + # $Config{cc} may contain args; try to find out the program part
  34 + while (@chunks) {
  35 + return $self->can_run("@chunks") || (pop(@chunks), next);
  36 + }
  37 +
  38 + return;
34 39 }
35 40
36 41 1;
4 inc/Module/Install/Makefile.pm
... ... @@ -1,6 +1,6 @@
1 1 #line 1 "inc/Module/Install/Makefile.pm - /Library/Perl/5.8.1/Module/Install/Makefile.pm"
2 2 # $File: //depot/cpan/Module-Install/lib/Module/Install/Makefile.pm $ $Author: autrijus $
3   -# $Revision: #52 $ $Change: 1811 $ $DateTime: 2003/12/14 18:52:33 $ vim: expandtab shiftwidth=4
  3 +# $Revision: #53 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
4 4
5 5 package Module::Install::Makefile;
6 6 use Module::Install::Base; @ISA = qw(Module::Install::Base);
@@ -143,4 +143,4 @@ sub postamble {
143 143
144 144 __END__
145 145
146   -#line 275
  146 +#line 276
17 inc/Module/Install/Metadata.pm
... ... @@ -1,11 +1,11 @@
1 1 #line 1 "inc/Module/Install/Metadata.pm - /Library/Perl/5.8.1/Module/Install/Metadata.pm"
2 2 # $File: //depot/cpan/Module-Install/lib/Module/Install/Metadata.pm $ $Author: autrijus $
3   -# $Revision: #31 $ $Change: 1817 $ $DateTime: 2003/12/14 20:57:39 $ vim: expandtab shiftwidth=4
  3 +# $Revision: #32 $ $Change: 1885 $ $DateTime: 2004/03/11 05:55:27 $ vim: expandtab shiftwidth=4
4 4
5 5 package Module::Install::Metadata;
6 6 use Module::Install::Base; @ISA = qw(Module::Install::Base);
7 7
8   -$VERSION = '0.03';
  8 +$VERSION = '0.04';
9 9
10 10 use strict 'vars';
11 11 use vars qw($VERSION);
@@ -95,6 +95,12 @@ sub _dump {
95 95 $name;
96 96 } if $values{module_name};
97 97
  98 + if ($values{name} =~ /::/) {
  99 + my $name = $values{name};
  100 + $name =~ s/::/-/g;
  101 + die "Error in name(): '$values{name}' should be '$name'!\n";
  102 + }
  103 +
98 104 my $dump = '';
99 105 foreach my $key (@scalar_keys) {
100 106 $dump .= "$key: $values{$key}\n" if exists $values{$key};
@@ -155,7 +161,7 @@ sub write {
155 161 while (<FH>) {
156 162 last META_NOT_OURS if /^generated_by: Module::Install\b/;
157 163 }
158   - return $self;
  164 + return $self if -s FH;
159 165 }
160 166 }
161 167
@@ -175,7 +181,10 @@ sub version_from {
175 181 sub abstract_from {
176 182 my ($self, $abstract_from) = @_;
177 183 require ExtUtils::MM_Unix;
178   - $self->abstract(ExtUtils::MM_Unix->parse_abstract($abstract_from));
  184 + $self->abstract(
  185 + bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix')
  186 + ->parse_abstract($abstract_from)
  187 + );
179 188 }
180 189
181 190 1;
18 inc/Module/Install/WriteAll.pm
... ... @@ -1,13 +1,19 @@
1 1 #line 1 "inc/Module/Install/WriteAll.pm - /Library/Perl/5.8.1/Module/Install/WriteAll.pm"
2 2 # $File: //depot/cpan/Module-Install/lib/Module/Install/WriteAll.pm $ $Author: autrijus $
3   -# $Revision: #2 $ $Change: 1818 $ $DateTime: 2003/12/14 20:58:38 $ vim: expandtab shiftwidth=4
  3 +# $Revision: #3 $ $Change: 1885 $ $DateTime: 2004/03/11 05:55:27 $ vim: expandtab shiftwidth=4
4 4
5 5 package Module::Install::WriteAll;
6 6 use Module::Install::Base; @ISA = qw(Module::Install::Base);
7 7
8 8 sub WriteAll {
9 9 my $self = shift;
10   - my %args = (check_nmake => 1, meta => 1, sign => 0, @_);
  10 + my %args = (
  11 + meta => 1,
  12 + sign => 0,
  13 + inline => 0,
  14 + check_nmake => 1,
  15 + @_
  16 + );
11 17
12 18 $self->sign(1) if $args{sign};
13 19 $self->Meta->write if $args{meta};
@@ -20,7 +26,13 @@ sub WriteAll {
20 26 $self->check_nmake if $args{check_nmake};
21 27 $self->makemaker_args( PL_FILES => {} )
22 28 unless $self->makemaker_args->{'PL_FILES'};
23   - $self->Makefile->write;
  29 +
  30 + if ($args{inline}) {
  31 + $self->Inline->write;
  32 + }
  33 + else {
  34 + $self->Makefile->write;
  35 + }
24 36 }
25 37 }
26 38
4 lib/XML/Atom.pm
... ... @@ -1,4 +1,4 @@
1   -# $Id: Atom.pm,v 1.11 2004/01/05 16:17:41 btrott Exp $
  1 +# $Id: Atom.pm,v 1.12 2004/04/24 10:09:12 btrott Exp $
2 2
3 3 package XML::Atom;
4 4 use strict;
@@ -6,7 +6,7 @@ use strict;
6 6 use base qw( XML::Atom::ErrorHandler );
7 7
8 8 use vars qw( $VERSION );
9   -$VERSION = '0.05';
  9 +$VERSION = '0.06';
10 10
11 11 package XML::Atom::Namespace;
12 12 use strict;
13 lib/XML/Atom/Client.pm
... ... @@ -1,4 +1,4 @@
1   -# $Id: Client.pm,v 1.17 2003/12/24 08:59:16 btrott Exp $
  1 +# $Id: Client.pm,v 1.18 2004/04/24 10:09:12 btrott Exp $
2 2
3 3 package XML::Atom::Client;
4 4 use strict;
@@ -10,7 +10,7 @@ use XML::Atom::Entry;
10 10 use XML::Atom::Feed;
11 11 use XML::Atom::Util qw( first textValue );
12 12 use XML::LibXML;
13   -use Digest::SHA1 qw( sha1 sha1_hex );
  13 +use Digest::SHA1 qw( sha1 );
14 14 use MIME::Base64 qw( encode_base64 );
15 15 use DateTime;
16 16
@@ -79,7 +79,7 @@ sub createEntry {
79 79 my $res = $client->make_request($req);
80 80 return $client->error("Error on POST $uri: " . $res->status_line)
81 81 unless $res->code == 201;
82   - $res->header('Location');
  82 + $res->header('Location') || 1;
83 83 }
84 84
85 85 sub updateEntry {
@@ -133,6 +133,7 @@ sub munge_request {
133 133 my $client = shift;
134 134 my($req) = @_;
135 135 my $nonce = $client->make_nonce;
  136 + my $nonce_enc = encode_base64($nonce, '');
136 137 my $now = DateTime->now->iso8601 . 'Z';
137 138 my $digest = encode_base64(sha1($nonce . $now . ($client->password || '')), '');
138 139 if ($client->use_soap) {
@@ -149,7 +150,7 @@ sub munge_request {
149 150 <wsse:UsernameToken>
150 151 <wsse:Username>@{[ $client->username || '' ]}</wsse:Username>
151 152 <wsse:Password Type="wsse:PasswordDigest">$digest</wsse:Password>
152   - <wsse:Nonce>$nonce</wsse:Nonce>
  153 + <wsse:Nonce>$nonce_enc</wsse:Nonce>
153 154 <wsu:Created>$now</wsu:Created>
154 155 </wsse:UsernameToken>
155 156 </wsse:Security>
@@ -169,7 +170,7 @@ SOAP
169 170 } else {
170 171 $req->header('X-WSSE', sprintf
171 172 qq(UsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"),
172   - $client->username || '', $digest, $nonce, $now);
  173 + $client->username || '', $digest, $nonce_enc, $now);
173 174 $req->header('Authorization', 'WSSE profile="UsernameToken"');
174 175 }
175 176 }
@@ -196,7 +197,7 @@ sub munge_response {
196 197
197 198 sub make_nonce {
198 199 my $app = shift;
199   - sha1_hex(sha1_hex(time() . {} . rand() . $$));
  200 + sha1(sha1(time() . {} . rand() . $$));
200 201 }
201 202
202 203 1;
9 lib/XML/Atom/Link.pm
... ... @@ -1,4 +1,4 @@
@@ -33,7 +33,12 @@ sub elem { $_[0]->{elem} }
6 lib/XML/Atom/Server.pm
... ... @@ -1,10 +1,10 @@
1   -# $Id: Server.pm,v 1.2 2003/12/28 05:37:48 btrott Exp $
  1 +# $Id: Server.pm,v 1.3 2004/04/24 10:09:12 btrott Exp $
2 2
3 3 package XML::Atom::Server;
4 4 use strict;
5 5
6 6 use base qw( XML::Atom::ErrorHandler );
7   -use MIME::Base64 qw( encode_base64 );
  7 +use MIME::Base64 qw( encode_base64 decode_base64 );
8 8 use Digest::SHA1 qw( sha1 );
9 9 use XML::Atom::Util qw( first encode_xml );
10 10 use XML::Atom::Entry;
@@ -265,7 +265,7 @@ sub authenticate {
265 265 my $password = $server->password_for_user($auth->{Username})
266 266 or return $server->auth_failure(403, 'Invalid login');
267 267 my $expected = encode_base64(sha1(
268   - $auth->{Nonce} . $auth->{Created} . $password
  268 + decode_base64($auth->{Nonce}) . $auth->{Created} . $password
269 269 ), '');
270 270 return $server->auth_failure(403, 'X-WSSE PasswordDigest is incorrect')
271 271 unless $expected eq $auth->{PasswordDigest};
14 lib/XML/Atom/Thing.pm
... ... @@ -1,4 +1,4 @@
1   -# $Id: Thing.pm,v 1.9 2003/12/30 06:58:18 btrott Exp $
  1 +# $Id: Thing.pm,v 1.10 2004/04/24 10:09:12 btrott Exp $
2 2
3 3 package XML::Atom::Thing;
4 4 use strict;
@@ -91,15 +91,21 @@ sub add_link {
91 91 my($link) = @_;
92 92 my $elem = $thing->{doc}->createElementNS(NS, 'link');
93 93 $thing->{doc}->getDocumentElement->appendChild($elem);
94   - for my $k (qw( type rel href title )) {
95   - $elem->setAttribute($k, $link->$k());
  94 + if (ref($link) eq 'XML::Atom::Link') {
  95 + for my $k (qw( type rel href title )) {
  96 + $elem->setAttribute($k, $link->$k());