in reply to Using the DATA file handle for ARGV
I found a simple example to test this on.
use strict; use warnings; BEGIN { *ARGV = *DATA unless @ARGV } my $timestamp = $ARGV[0]; my ($year,$month,$day,$hour,$minute,$second) = ($timestamp =~ /(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)/); printf "%s is %d seconds\n",$timestamp, ((($year * 365 + $day) * 24 + +$hour) * 60 + $minute) * 60 + $second; __DATA__ 620731142301
$timestamp is not picking up the value from DATA. What am I doing wrong?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using the DATA file handle for ARGV
by choroba (Cardinal) on Nov 13, 2013 at 17:52 UTC | |
by GotToBTru (Prior) on Nov 13, 2013 at 20:03 UTC | |
by choroba (Cardinal) on Nov 13, 2013 at 23:07 UTC | |
Re^2: Using the DATA file handle for ARGV
by aaron_baugher (Curate) on Nov 13, 2013 at 17:57 UTC | |
by GotToBTru (Prior) on Nov 13, 2013 at 22:44 UTC |
In Section
Meditations