[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

useful snippets



It would be nice if wml::std had something like this in it:

(note: I haven't quite got the mp4h quoting down pat yet)
___
<: 
	sub params { 	my @foo = split /\s+/, scalar shift ; 
	 	 	return @foo;  } 
	sub truss   { 	my @params = params(shift);
			foreach (@params) {
		 		$$1 = $2 	if /(\w+)=(\w+)/ ||
						   /(\w+)='(.*?)'/;
			 }
		   }
:>
___


because then you could

___
<define-tag foo whitespace=delete>
	<: 
		local $foo, $bar;
		truss(q(%attributes));
		print "$foo:$bar";
	:>
</define-tag>

<foo foo=la bar=toodles>
---

and get 'la:toodles'.


Basically, I think that there needs to be some quick, default way
of importing %attributes into perl expressions.



-- 
Democracy is the theory that the common people know what they want and deserve 
to get it good and hard.      --Henry Louis Mencke
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com