in reply to User-Defined Syntax, XPath, Tied Hashes, and Autovivification

Also, instead of source-filters, you could just put the psuedo-code into an arbitrary string, mangle the string into perl, and then eval that mangled string. (Obviously, this is example is oversimplified, but it gets the point accross)
my $code = q{ $x/html/head/title[0] = "Page Title"; $x/html/body/h1[0] = "Some text here"; }; $code =~ s|/(\w+)|->{$1}|g; eval $code; die $@ if $@;
------------ :Wq Not an editor command: Wq

Replies are listed 'Best First'.
Re: User-Defined Syntax, XPath, Tied Hashes, and Autovivification
by Abigail-II (Bishop) on Feb 11, 2004 at 16:53 UTC
    Well, except that a source filter doesn't do the evalling - it just hands the modified string back to the compiler, this is just what a source filter does, isn't?

    Abigail

      Pretty much... it's just a different way to skin the same cat. Also, depending on your mind-set, it may be a little more direct (or less direct =D).
      ------------ :Wq Not an editor command: Wq