turn text lines into a list

Big and Blue No_4 at dsl.pipex.com
Tue Jun 28 16:57:21 EDT 2005


Gunnar Hjalmarsson wrote:
>
>> @corenames=qw(
>> rb_basic_islamic
>> sq1_pentagonTile
>> sq_arc501Tile
>> sq_arc503Tile
>> );
> 
> 
> Impractical to mix code and data, isn't it?

    Obviously not impractical, given he did it quite easily and succinctly.

> chomp( my @corenames = <DATA> );
> 
> __DATA__
> rb_basic_islamic
> sq1_pentagonTile
> sq_arc501Tile
> sq_arc503Tile

    Not so easy when you have multiple variables to set.  And the original 
version was transparent in what it was doing - your version is not.


-- 
              Just because I've written it doesn't mean that
                   either you or I have to believe it.



More information about the Python-list mailing list