what am i doing wrong here? i've tried it w/ and w/o the parens around the regexp.
use strict;
use warnings;
my $when = '2003-07-14 21:39:26.357';
my ( $yr, $mo, $day, $hr, $min, $sec ) =
( $when =~ /(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/ );
print "( $yr, $mo, $day, $hr, $min, $sec )\n";
__DATA__
Use of uninitialized value in concatenation (.) or string at C:\dev\sc
+ripts\reg.pl line 6.
Use of uninitialized value in concatenation (.) or string at C:\dev\sc
+ripts\reg.pl line 6.
Use of uninitialized value in concatenation (.) or string at C:\dev\sc
+ripts\reg.pl line 6.
Use of uninitialized value in concatenation (.) or string at C:\dev\sc
+ripts\reg.pl line 6.
Use of uninitialized value in concatenation (.) or string at C:\dev\sc
+ripts\reg.pl line 6.
Use of uninitialized value in concatenation (.) or string at C:\dev\sc
+ripts\reg.pl line 6.
( , , , , , )
can somebody help a (clueless) brother out?
Update:
cool cool cool- never knew you could return an array from a regexp. here's another way too:
my ( $yr, $mo, $day, $hr, $min, $sec ) =
( $when =~ /(\d{4})\D*(\d\d)\D*(\d\d)\D*(\d\d)\D*(\d\d)\D*(\d\d)/ );