Geo-TCX

 view release on metacpan or  search on metacpan

lib/Geo/TCX.pm  view on Meta::CPAN

        my $fname = $first_arg;
        my $file_to_read = $first_arg;
        croak 'first argument must be a filename' unless -f $fname;

        if ($fname =~ /(?i:\.fit$)/) {
            my ($fh, $tmp_fname) = tempfile();
            _convert_fit_to_tcx( $fname, $tmp_fname );
            $file_to_read = $tmp_fname;
            $fname =~ s/(?i:.fit)$/.tcx/
        }
        $txt = do { local(@ARGV, $/) = $file_to_read; <> };
        $o->set_filename($fname)
    }

    $txt =~ s,\r,,g;                               # if it's a windows file
    $txt =~ s,>\s+<,><,g;
    $o->{tag_creator} = $1 if $txt =~ s/(<Creator.*<\/Creator>)//;

    # Activities/Activity  - are as recorded  by an EDGE 705 device
    # Courses/Course       - are as converted by an EDGE 705 device from an Activity



( run in 0.657 second using v1.01-cache-2.11-cpan-49f99fa48dc )