Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
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., 2022: 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