I believe what you're trying to do is read in a bunch of names from a file, and then have those names available to use as variable names in your code? Is that right?

I remember once trying to do something similar, and eventually convincing myself that it was a struggle to do for a reason. For a start, it's a huuuuge security risk, which makes it bad practice, whether or not this code is going to be used by anyone else.

Perhaps this is an example of an X-Y problem, where you're not telling us what you're trying to achieve in the long run, or why you've chosen this particular method. Or maybe you're just doing it for the hell of it, because it seems like a fun thing to do, or just to find out if it can be done.

If the former, if you can outline your goal and what you've tried so far, I'm sure people will give you great suggestions as to how to proceed. This is the case in which not using 'use strict' may well come back to haunt you, unless you really know what you're doing! If the latter, good on you, and again I'm sure people will help you out.

I know this wasn't much practical help, but I think I'm echoing what was said above by almut, in that the more detail you give, the better and more useful people's answers will be.

I for one am curious about what you want to use this for!

why_bird

update:added link

........
Those are my principles. If you don't like them I have others.
-- Groucho Marx
.......

In reply to Re: Reading and producing variable lists (w/o hashes!) by why_bird
in thread Reading and producing variable lists (w/o hashes!) by bingohighway

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.