56

Variables
List Exercise

  • Using only the knowledge that you have gained in the course to this point, try the following exercise:


    Exercise
    1. Create a new script file called "lists".
    2. Start with @foo = ( "ape", "cat" );
    3. Write code to insert the word "bat" between "ape" and "cat".
    4. Output @foo using: $,=" "; print @foo, "\n";
    5. EXTRA: Experiment by finding more than one solution...
    No
    Hint
    To
    Start

    Solution