Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
and.... no this is not homework.... I am simply searching for a better way to do it.#!/usr/bin/perl -w use strict; my $string="01:01:2000,14:01:12,1.584167"; my $time=(split(/\,/,$string))[1]; print "TIME: $time\n"; my $minute=(split(/:/,$string))[1]; print "MINUTE: $minute\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: time string parsing question
by Roy Johnson (Monsignor) on Jun 02, 2005 at 19:38 UTC | |
|
Re: time string parsing question
by VSarkiss (Monsignor) on Jun 02, 2005 at 21:06 UTC | |
|
Re: time string parsing question
by tlm (Prior) on Jun 02, 2005 at 19:37 UTC | |
|
Re: time string parsing question
by TedPride (Priest) on Jun 02, 2005 at 20:50 UTC | |
|
Re: time string parsing question
by GrandFather (Saint) on Jun 03, 2005 at 03:03 UTC | |
|
Re: time string parsing question
by PerlBear (Hermit) on Jun 02, 2005 at 19:32 UTC | |
|
Re: time string parsing question
by sh1tn (Priest) on Jun 02, 2005 at 20:24 UTC | |
|
Re: time string parsing question
by graff (Chancellor) on Jun 03, 2005 at 02:17 UTC |