in reply to Re^2: Can I extract a Hash element by passing a variable to the hash?
in thread Can I extract a Hash element by passing a variable to the hash?
As I meant to mention that in my original post, you could just use localtime.
my $slot = (localtime)[6]; # 0..6 for Sun..Sat if ($slot == 6) { $slot = undef; # undef for Sat. elsif ($slot == 5) { $slot = 6; # 6 for Fri. } print "Slot Number is $slot\n";
|
|---|