in reply to Re: Why does this code quit?
in thread Why does this code quit?

Yikes! You are right. Is there a better way?
--
ellem@optonline.net
There's more than one way to do it, just don't use my way.

Replies are listed 'Best First'.
Re: Re: Re: Why does this code quit?
by japhy (Canon) on Feb 01, 2002 at 14:43 UTC
    You could do something like:
    my ($field, $value); # then, inside your loop... ... { ... my @lines = ( [ "NAME", "$fname $lname" ], [ "AGE", $age ], [ "WHATEVER", $whenever ], # ... ); for (@lines) { ($field, $value) = @$_; write FORMAT; } ... } ... format FORMAT = @<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $field, $value .

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;