Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!tut.cis.ohio-state.edu!giza.cis.ohio-state.edu!jgreely From: jgreely@giza.cis.ohio-state.edu (J Greely) Newsgroups: comp.lang.perl Subject: Re: dynamic formats Message-ID: Date: 15 Jan 90 20:30:29 GMT References: Sender: news@tut.cis.ohio-state.edu Reply-To: J Greely Organization: Ohio State University Computer and Information Science Lines: 38 In-reply-to: jv@mh.nl's message of 15 Jan 90 23:30:50 GMT In article jv@mh.nl (Johan Vromans) writes: >A format specification is apparently of a static nature. Is it >possible to dynamically create formats, Yes, but only the clumsy way. >Currently the only way I can think of, is creating a temporary file >with the format spec in it, and 'do'ing it. That's what I use. I have a subroutine 'feval' that I keep handy in a library. sub feval { local($form,$file) = @_; $file = "/tmp/feval.$$.pl"; open(file,">$file") || die "$file: $!\n"; print file $form; close(file); do $file; unlink $file; } It's a quick and dirty workaround, and I brought the problem to Larry's attention a while back. I'm sure he'll respond with the current status. Easy to use, though: $field = "foo"; &feval(<<'EOF'); format STDOUT = @<<<<< $field . EOF write; -- J Greely (jgreely@cis.ohio-state.edu; osu-cis!jgreely)