Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2021-12-05 11:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?