Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
The wonders of Perl

I was asked yesterday (and not for the first time) what my favourite programming language is - and I have to say that it depends on what I'm doing at the time. That's not a "political" answer in any way - as we choose to train only on languages that we're very happy indeed with.

I've just had a little "exercise" to do. I have a list of place names in Mexico, and (on the following line) the dialling code for each of them within the country - for example

Acapulco
74

Cancun
98

Celaya
461

Chihuahua
14

And I needed the data reformatted at one place per line, to include the extra digits for the international code too. Easy - the Perl program was just

while (<>) {
        chop;
        /^\d/ and print "0052$_ $place\n";
        /^[[:alpha:]]/ and $place = $_;
        }

And the output produced:

005274 Acapulco
005298 Cancun
0052461 Celaya
005214 Chihuahua
005216 Ciudad Juarez
005267 Culiacan
00523 Guadalajara
005262 Hermosillo
0052112 La Paz
0052113 Loreto
0052678 Mazatlan
005299 Merida
005265 Mexicali
00525 Mexico City
00528 Monterrey
005222 Puebla
0052322 Puerto Vallarta
005248 San Luis Potosi
005212 Tampico
005266 Tijuana
005217 Torreon
005229 Veracruz
0052492 Zacatecas Mexico Telmex

We're also often asked how we maintain so much information on this web site AND run courses every week (Tcl last week, Python next ...) and the answer is easy - by using Modern open source languages to provide us with helpful tools to do the job. I've used Perl for this page, and an hour or so ago I was adding data under a PHP page


See also Topicalization in Perl - ideal for short data munging scripts

Please note that articles in this section of our web site were current and correct to the best of our ability when published, but by the nature of our business may go out of date quite quickly. The quoting of a price, contract term or any other information in this area of our website is NOT an offer to supply now on those terms - please check back via our main web site

Related Material

Perl - Topicalization and Special Variables
  [493] - ()
  [639] - ()
  [969] - ()
  [1136] - ()
  [1221] - ()
  [1232] - ()
  [1289] - ()
  [1444] - ()
  [1508] - ()
  [1704] - ()
  [1705] - ()
  [1728] - ()
  [1829] - ()
  [1860] - ()
  [1922] - ()
  [2833] - ()
  [2876] - ()
  [2972] - ()
  [3449] - ()
  [4301] - ()
  [4395] - ()
  [4682] - ()
  [4700] - ()

resource index - Perl
Solutions centre home page

You'll find shorter technical items at The Horse's Mouth and delegate's questions answered at the Opentalk forum.

At Well House Consultants, we provide training courses on subjects such as Ruby, Lua, Perl, Python, Linux, C, C++, Tcl/Tk, Tomcat, PHP and MySQL. We're asked (and answer) many questions, and answers to those which are of general interest are published in this area of our site.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/solutions/perl-the ... -perl.html • PAGE BUILT: Wed Mar 28 07:47:11 2012 • BUILD SYSTEM: wizard