Macro Subroutine help.

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Message
Author
kabayongtao
Noob
Noob
Posts: 8
Joined: 28 Jul 2011, 09:35
Noob?: No

Macro Subroutine help.

#1 Post by kabayongtao »

I'm having problem with with writing subroutines.

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.

Mortimal
Developers
Developers
Posts: 389
Joined: 01 Nov 2008, 15:31
Noob?: No

Re: Macro Subroutine help.

#2 Post by Mortimal »

Code: Select all

$timeSnapShot= time();
no?
Please use pin function for uploading your file contents!

Post Reply