www.webdeveloper.com
Results 1 to 3 of 3

Thread: Newbie to Perl Programming

  1. #1
    Join Date
    Mar 2009
    Posts
    12

    Newbie to Perl Programming

    I am very new to Perl and I am trying to learn little by little. What statement adds the element (willie, 74) to the hash %fun?
    I have no idea what it is asking?

    Also how do you get the address of a scalar variable $truck?

    And finally, how do you get the address of a list literal?

  2. #2
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    You should ask your teacher these questions.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  3. #3
    Join Date
    Oct 2007
    Location
    Vienna, Austria
    Posts
    393
    Or you can ask the perl documentation: perldata and perlop tell you about #1. If you don't understand the question, it says:
    Say you have a hash, like e.g.
    Code:
    %fun = {
        jeff => 32,
        sally => 18,
    }
    which holds the information that Jeff is 32 years old and Sally is 18. Now how do you add the record about Willy stating that he's 74? The resulting hash should look like
    Code:
    {
        jeff => 32,
        sally => 18,
        willy => 74,
    }
    Again, the links above should help you get the answers, though you may want to read them from start rather than just the parts I gave links to.

    Answer for question #2 is in perlref.

    The third question is tricky and you may conclude the answer from the documents linked here.

    Good luck. ;-)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles