in reply to value disappears in if statement
The $month value('Mar'} seems to vanish within the if statement and only in the if statement. What's going on here?
If you want to figure it out your existing program use Basic debugging checklist
Otherwise see split, http://perldoc.perl.org/perlintro.html#Parentheses-for-capturing and http://perldoc.perl.org/perlrequick.html#Extracting-matches
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ dd /; my $now = localtime; dd( $now ); my( $weekday, $month, $monthday, $time, $year ) = split ' ', $now; dd( ( $weekday, $month, $monthday, $time, $year ) ); __END__ "Mon Mar 9 20:38:38 2015" ("Mon", "Mar", 9, "20:38:38", 2015)
|
|---|