"John W. Krahn" <jwkr...@shaw.ca> writes:
[...] >> ev 100411 4 >> Wash behind ears >> ev >> >> ev 100421 4 >> Avoid a beating by taking out the garbage >> this evening. >> ev >> >> [...] >> >> The multidigit numbers represents YYMMDD, > John K. wrote: > If we have learned anything from Y2K it is that you should always use > four digits for the year. Your right... my .events files has only 9 decades to muddle along until it quits working... hehe.. Lets see... I'm 65 now... I wonder if I'll care... Seriously, I guess you are saying it's really a bad habit... point taken. >> My script will read this file (from cron). It has to get a year >> mnth and mday out of there. > > $ perl -le' > my ( $year, $mnth, $mday ) = "100421" =~ /(\d\d)(\d\d)(\d\d)/; > print "Year = $year, Month = $mnth, Day = $mday" > ' > Year = 10, Month = 04, Day = 21 I guess I got a little carried away, using split, once I'd learned here about how it handles null strings. Instead of sticking with a simple s/// to get the same job done. Thanks -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/