Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Pattern Matching Exercises

by pedagogues
on Nov 27, 1999 at 21:54 UTC ( #1017=perlexercise: print w/replies, xml ) Need Help??

Pattern Matching Exercises

  1. Write a program which asks the user for a filename, then modifies that file, replacing each tab (\t) character with 3 spaces. (solution)
  2. Write a program which reads in lines of text and for each one prints "Weekend!" if the line contains "Saturday" or "Sunday", and for the other days of the week prints "This is a workday." Ignore capitalization in your regular expression. (solution)
  3. Write a program which reads in lines of text and for each line does the following: find the "words" (sequences of non-whitespace characters) and print each one on a line by itself. (solution)
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2022-01-17 00:30 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (50 votes). Check out past polls.