the @hashname{@keys_for_the_hash} = @values_for_those_keys notation is a hash slice which you can read more about in perldoc perldata and from which I quote:
Entire arrays (and slices of arrays and hashes) are denoted by '@', wh +ich works much like the word "these" or "those" does in English, in t +hat it indicates multiple values are expected. @days # ($days[0], $days[1],... $days[n]) @days[3,4,5] # same as ($days[3],$days[4],$days[5]) @days{'a','c'} # same as ($days{'a'},$days{'c'}) Entire hashes are denoted by '%': %days # (key1, val1, key2, val2 ...)
In answer to your second question about storing the song titles in a file - yes you can just have a subroutine that dumps all of the keys to the file overwriting the old list but is there a better way (read: more convenient for you)?

If you do not need the file to be human-readable (i.e. you don't look through it yourself) then you might consider using a DBM - basically a perl hash operating out of a file.You can read more here.

Hope this helps,

   larryk                                          
perl -le "s,,reverse killer,e,y,rifle,lycra,,print"
Will code for food - looking for work - London - CV

In reply to Re: Re: Re: Re: Re: Re: Re: Adding and Deleting Upload File name and File by larryk
in thread Adding and Deleting Upload File name and File by lex2001

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.