הלינקייה: מגזין חודשי למפתחים

רוצה לשמוע על כל האירועים, המדריכים, הקורסים והמאמרים שנכתבו החודש ?
הלינקייה הינו מגזין חופשי בעברית שמשאיר אותך בעניינים.
בלי ספאם. בלי שטויות. פעם בחודש אצלך בתיבה.

Datatypes Exercise

Part 1

  1. Write a program that accepts 2 strings - a username & a password. The program will print "Welcome !" in case the password is correct
    acccording to the following table:

    Username Password
    apple red
    lettuce green
    lemon yellow
    orange> orange

    in case the username or password is incorrect, the program should print "No access!"

  2. Write a program that takes its input as command line arguments (@ARGV) and prints out only the unique values
  3. Write a program that reverses a hash, swapping between keys and values
  4. Write a program that takes as arguments (in @ARGV) a list of words, and prints only the longest word
  5. Write a program that takes as arguments (in @ARGV) a number AND a list of words, and prints only the words longer than the number
  6. The special hash %ENV holds all of the environment variables on the system. Write a program that prints only the environment variables whose value is a valid file name
  7. Write a perl program that prints how many different paths are in the environment variable $PATH

Part 2

  1. Write a program that reads a series of chars (one in each line) and prints a list of their decimal ascii value.
    (hint: use chr and ord)
  2. Write a program that reads a series of numbers (one in each line) and prints a list of their char ascii value.
    (hint: use chr and ord)
  3. Write a program that accepts a list of numbers (separate lines) and print for each number:
    "The number is odd (X)" - for odd numbers.
    "The number is even (X)" - for even numbers.
  4. Write a program that reads in a list of strings on separate lines and then prints out the list of strings
    in reverse order - without using reverse on the list.
  5. Write a program which reads strings (separate lines).
    For each string the user had typed:
    1) If the string is not empty, the program will print "Accepted: " in a new line.
    2) If the string is empty - print "No command!"
    3) If the string is "perl" or print "Welcome to Perl programming!!!"
  6. Link To Solutions

course: