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

Re: [FWP] Drunk driving



Michael G Schwern writes:
|On Sat, Jun 19, 1999 at 03:55:00PM -0500, Tushar Samant wrote:
|> I saw code like this recently, and I hope the perp isn't reading this:
|>     $string = $x;
|>     open(TMPOUT, ">$tmpout");
|>     write TMPOUT;
|>     open(TMPOUT, "$tmpout");
|>     read(TMPOUT, $x, 1000);
|>     $string = $y;
|>     open(TMPOUT, ">$tmpout");
|>     write TMPOUT;
|>     open(TMPOUT, "$tmpout");
|>     read(TMPOUT, $y, 1000);
|Writing a format to a variable?

Actually writing formatted text to a variable. And to be somewhat fair,
that's about the only way to do it in base perl4.

|How to do it better is
|documented... somehwere... in the documentation... for that... umm,
|thing.

formline and $^A, mentioned in perlfunc.pod and described in more detail
in perlform.pod.

|(I don't use formats)

I don't use them often, but when I do, they save an enormous amount of time.
Formatting text always seems messier than it should be, but formats make it
pretty easy to do some complex stuff.

Brian

==== Want to unsubscribe from this list? (Don't you love us anymore?)
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org