Changeset 449 for cybozu2ical/trunk/lib
- Timestamp:
- 10/17/07 04:38:39 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
cybozu2ical/trunk/lib/WWW/CybozuOffice6/Calendar.pm
r448 r449 5 5 use warnings; 6 6 7 use Carp; 7 8 use Encode qw/from_to/; 8 9 use LWP::UserAgent; 9 10 use URI; 10 11 use DateTime; 11 use Text::CSV_XS;12 12 13 13 our $VERSION = '0.20'; … … 47 47 Password => $this->{password} || '', 48 48 }); 49 die'Failed to access Cybozu Office 6: ' . $res->status_line49 confess 'Failed to access Cybozu Office 6: ' . $res->status_line 50 50 unless $res->is_success; 51 51 … … 62 62 my ($file) = @_; 63 63 local *FH; 64 open FH, $file or die"Failed to read $file";64 open FH, $file or confess "Failed to read $file"; 65 65 my @lines; 66 66 while (<FH>) { … … 81 81 my $this = shift; 82 82 83 my $csv; 84 if (eval('require Text::CSV_XS')) { 85 $csv = Text::CSV_XS->new({ binary => 1 }); 86 } elsif (eval('require Text::CSV')) { 87 $csv = Text::CSV->new(); 88 } else { 89 confess 'Text::CSV_XS or Text::CSV package is required'; 90 } 91 83 92 my @items; 84 my $csv = Text::CSV_XS->new({ binary => 1 });85 93 for my $line ($this->response) { 86 94 $csv->parse($line) 87 or die'Failed to parse CSV input';95 or confess 'Failed to parse CSV input'; 88 96 my @fields = $csv->fields; 89 97 my $num_fields = @fields - 1;
![(please configure the [header_logo] section in trac.ini)](/public/chrome/common/trac_banner.png)