I want to get the output of time() in perl. From subroutine, I am able to return the value to the macros calling it, but I can't store the value into a variable.
Code: Select all
#this is working
sub working{
return $timeSnapShot;
}
macro test{
log @eval(working)
}
#output: 1311864408
Code: Select all
#this is not working
sub notworking{
$timeSnapShot= $time();
return $timeSnapShot;
}
macro test{
log @eval(notworking)
}
#output: [macro] test error: error in 0: @eval(notworking) failed
In the mean time, I'll just use the predefined variable $.time in macros.