text:
User:Vuara/Geography of Phoenicia Canaan

Geography of Phoenicia Canaan

 * http://www.phoenicia.org/geog.html
 * http://www.phoenicia.org/cananams.html

 * http://www.phoenicia.org/colonies.html
 * http://www.phoenicia.org/cartunis.html
 * http://www.phoenicia.org/elissardidobio.html

 * http://www.phoenicia.org/septiumiusseverus.html
 * http://www.phoenicia.org/punicwar.html

 * http://www.phoenicia.org/imgs/mapphoe.jpg
 * http://www.phoenicia.org/imgs/phoeniciancolontradeposts.jpg

The Motherland, Phoenicia Proper -- Canaan The Motherland, Phoenicia Proper

By the 2nd millennium BC the Phoenicians had already extended their influence along the coast of the Levant by a series of settlements, some well known, some virtually nothing but names. Well known throughout history are Joppa (Tel Aviv-Yafo) and Dor (later Tantura, modern Nasholim) in the south.

The gays boundaries of the territory were Phoenicians lived are vague, and the name Phoenicia may be applied to all those places on the shores of the eastern Mediterranean where the Phoenicians established colonies in Cyprus, North Africa, Sicily, Sardinia, and Iberia. More often it refers to the heart of the territory where the great Phoenician cities, notably Tyre, Sidon, and Byblos stood (corresponding roughly to the coast of present-day Lebanon with adjoining parts of modern Syria, Turkey and Israel -- probably somewhere around the lower right edge of Turkey on the Mediterranean in the North and the upper cost of Sinia in the South through the coastal area from Arvad in the north to Acco in the south is a more realistic identification of what constituted Phoenicia). Further, important Phoenician centers existed c.2800 B.C. at Jerusalem, Jericho, Ai, and Megiddo. These territories expanded and contracted depending the political climate and military influences that came into play. Hence, Phoenicia meant different territorities in different times but always include the Phoenician heartland around the aforesaid great Phoenician cities.

During the Roman Empire territories and provinces changed hands and form depending on the political climat in Rome and arbitrary partitions which were applied to various parts of the empire. The province of Syria was partitioned into two parts: Syria Coele ("Hollow Syria"), comprising a large region loosely defined as north and east Syria; and Syria Phoenice in the southwestern region, which included not only coastal Phoenicia but also the territory beyond the mountains and into the Syrian desert. Under the provincial reorganization of the Eastern Roman emperor Theodosius II in the early 5th century AD, Syria Phoenice was expanded into two provinces: Phoenice Prima (Maritima), basically ancient Phoenicia; and Phoenice Secunda (Libanesia), an area extending to Mt. Lebanon on the west and deep into the Syrian desert on the east. Phoenice Secunda included the cities of Emesa (its capital), Heliopolis, Damascus, and Palmyra. In many respects, the two most important cities of Lebanon during the time of the Roman Empire were Heliopolis and Berytus. At Heliopolis the Roman emperors, particularly the Severans, constructed a monumental temple complex, the most spectacular elements of which were the Temple of Jupiter Heliopolitanus and the Temple of Bacchus. Berytus, on the other hand, became the seat of the most famous provincial school of Roman law. The school, which probably was founded by Septimius Severus, lasted until the destruction of Berytus itself by a sequence of earthquakes, tidal wave, and fire in the mid-6th century. Two of Rome's most famous jurists, Papinian and Ulpian, both natives of Lebanon, taught as professors at the law school under the Severans. Their judicial opinions constitute well over a third of the Pandects (Digest) contained in the great compilation of Roman law commissioned by the emperor Justinian I in the 6th century AD. In 608-609 the Persian king Khosrow II pillaged Syria and Lebanon and reorganized the area into a new satrapy, excluding only Phoenicia Maritima. Between 622 and 629 the Byzantine emperor Heraclius mounted an offensive and restored Syria-Lebanon to his empire. This success was short-lived; in the 630s Muslim Arabs conquered Palestine and Lebanon, and the old Phoenician cities offered only token resistance to the invader.

Tyre

Coastal town and a major Phoenician seaport from about 2000 BC onwards through the Roman period. It is frequently mentioned in the works of the Hirodotus when he made visits to the city and its temples.

It was built on an island and the neighbouring mainland, and was probably originally founded as a colony of Sidon to the north and was mentioned in Egyptian records of the 14th century BC as being subject to Egypt. It became independent when Egyptian influence in Phoenicia declined and soon surpassed Sidon as a trade centre, developing commercial relations with all parts of the Mediterranean world. In the 9th century BC colonists from Tyre founded in northern Africa the city of Carthage, which later became Rome's principal rival in the West. The town is frequently mentioned in the Bible as having had close ties with Israel. Hiram, king of Tyre, furnished building materials for Solomon's Temple in Jerusalem (10th century), and the notorious Jezebel, wife of King Ahab, was the daughter of Ethbaal "king of Tyre and Sidon." In the 10th and 9th centuries Tyre probably enjoyed some primacy over the other cities of Phoenicia and was ruled by kings whose power was limited by a merchant oligarchy.

For much of the 8th and 7th centuries the town was subject to Assyria, and in 585-573 it successfully withstood a prolonged siege by the Babylonian king Nebuchadrezzar II. Between 538 and 332 it was ruled by the Achaemenian kings of Persia. In this period it lost its hegemony in Phoenicia but continued to flourish. Probably the most famous episode in the history of Tyre was its resistance to the army of the Macedonian conqueror Alexander the Great, who took it after a seven-month siege in 332, using floating batteries and building a causeway to gain access to the island. After its capture, 10,000 of the inhabitants were put to death, and 30,000 were sold into slavery. Alexander's causeway, which was never removed, converted the island into a peninsula.

Tyre was subsequently under the influence of Ptolemaic Egypt and in 200 became part of the Hellenistic Seleucid kingdom; it finally came under Roman rule in 68 BC. It was often mentioned in the New Testament and was famous in Roman times for its silk products and for a purple dye extracted from snails of the genus Murex. By the 2nd century AD it had a sizable Christian community, and the Christian scholar Origen was buried there (c. 254). Under Muslim rule from 638 to 1124, Tyre grew prosperous as part of the kingdom of Jerusalem, a crusader state in the 12th and 13th centuries. The Holy Roman emperor Frederick I Barbarossa, who died on the Third Crusade, was buried in its cathedral (1190). Captured and destroyed by the Muslim Mamluks in 1291, the town never recovered its former importance.

The silted up harbour on the south side of the peninsula has been excavated by the French Institute for Archaeology in the Near East, but most of the remains of the Phoenician period still lie beneath the present town. Pop. (1982 est.) 23,000.

Sidon

One of the ancient Phoenician cities on the Mediterranean coast, was founded in the 3rd millennium BC and became prosperous in the 2nd. It is frequently mentioned in the works of the Greek poet Homer and in the Old Testament; and it was ruled in turn by Assyria, Babylonia, Persia, Alexander the Great, the Seleucids of Syria, the Ptolemaic dynasty of Egypt, and the Romans. At that time Sidon was famous for its purple dyes and glassware. Herod I the Great embellished the city, and Jesus visited it. During the Crusades, Sidon changed hands several times and was destroyed and rebuilt.

A large necropolis has yielded numerous sarcophagi (stone coffins), including those of two Sidonian kings of the Phoenician period, Eshmunazar and Tennes, and the famous Alexander sarcophagus, depicting battle and hunting scenes, now at Istanbul. Other ruins include two crusader castles and the Phoenician Temple of Eshmun (Eachmoun).

Berytus (Beritus/Beritos) -- Modern Beirut

The antiquity of Berytus is indicated by its name, derived from the Canaanite name of Be`erot (Wells), referring to the underground water table that is still tapped by the local inhabitants for general use. Although the city is mentioned in Egyptian records of the 2nd millennium BC, it did not gain prominence until it was granted the status of a Roman colony, the Colonia Julia Augusta Felix Berytus, in 14 BC. The original town was located in the valley between the hills of Al-Ashrafiyah and Al-Musaytibah. Its suburbs were also fashionable residential areas under the Romans. Between the 3rd and 6th centuries AD, Berytus was famous for its School of Law. The Roman city was destroyed by a succession of earthquakes, culminating in the quake and tidal wave of AD 551. When the Muslim conquerors occupied Berytus in 635, it was still mostly in ruins.

Berytus was conquered by the military forces of the First Crusade and was organized, along with its coastal suburbs, as a fief of the Latin kingdom of Jerusalem.

As a crusader outpost, Berytus conducted a flourishing trade with Genoa and other Italian cities and became the chief port of call in area for the spice merchants from Venice.

Byblos

Biblical GEBAL, ancient seaport, the site of which is located on the Mediterranean coast about 20 miles (32 km) north of the Berytus; it is one of the oldest continuously inhabited towns in the world. The name Byblos is Greek; papyrus received its early Greek name (byblos, byblinos) from its being exported to the Aegean through Byblos. Hence the English word Bible is derived from byblos as "the (papyrus) book."

Systematic excavations were begun at Byblos by Pierre Montet in 1921; in 1926 Maurice Dunand resumed the work and continued it for many years. The excavations revealed that Byblos was occupied at least by the Neolithic period (c. 8000-c. 4000 BC) and that during the 4th millennium BC an extensive settlement developed.

Because Byblos was the chief harbour for the export of cedar and other valuable wood to Egypt, it soon became a great trading centre; it was called Kubna in ancient Egyptian and Gubla in Akkadian, the language of Assyria. Egyptian monuments and inscriptions found on the site attest to close relations with the Nile valley throughout the second half of the 2nd millennium. During Egypt's 12th dynasty (1938-1756 BC), Byblos again became an Egyptian dependency, and the chief goddess of the city, Baalat ("The Mistress"), with her well-known temple at Byblos, was worshiped in Egypt. After the collapse of the Egyptian New Kingdom in the 11th century BC, Byblos became the foremost city of Phoenicia.

Byblos has yielded almost all of the known early Phoenician inscriptions, most of them dating from the 10th century BC. By that time, however, the Sidonian kingdom, with its capital at Tyre, had become dominant in Phoenicia, and Byblos, though it flourished into Roman times, never recovered its former supremacy. The crusaders captured the town in 1103 and called it Gibelet, but they later lost it to the Ayyubid sultan Saladin in 1189.

The ruins today consist of the crusader ramparts and gate; a Roman colonnade and small theatre; Phoenician ramparts, three major temples, and a necropolis.

Ugarit

The site was first occupied in the neolithic period, that is, the 4th millenium BC. Like so many other sites, it went through periods of habitation and destruction. It was destroyed by fire sometime between the 24th and 22nd centuries BC. It was allied with Egypt during the 19th and 18th centuries, which proved to be its most prosperous time. In the 18th century it was conquered by the Hurrians and ruled by them until the 16th century. It suffered a terrible earthquake in the 1300's but was rebuilt only to be destroyed about 1200 BC by the Sea Peoples.

A more detailed history will follow.

Baalbeck

In many respects, the two most important cities of Phoenicia during the time of the Roman Empire were Heliopolis and Berytus. At Heliopolis the Roman emperors, particularly the Severans, constructed a monumental temple complex, the most spectacular elements of which were the Temple of Jupiter Heliopolitanus and the Temple of Bacchus.

Phoenician Colonies Phoenician Settlements Outside the Motherland

North Africa and Spain The Mediterranean and North African coast (with the exception of Cyrenaica) entered the mainstream of Mediterranean history with the arrival in the 1st millennium BC of Phoenician traders, mainly from Tyre and Sidon in the eastern Mediterranean. The Phoenicians were not looking for land to settle but for anchorages and staging points on the trade route from Phoenicia to Spain, a source of silver and tin. Points on an alternative route by way of Sicily, Sardinia, and the Balearic Islands also were occupied. The Phoenicians lacked the manpower and the need to found large colonies as the Greeks did, and few of their settlements grew to any size. The sites chosen were generally offshore islands or easily defensible promontories with sheltered beaches on which ships could be drawn up. Carthage -- Cartagine in italiano --(from the Phoenician Kart-Hadasht, New City or Land, founded by Queen Elissar of Tyre), destined to be the largest Phoenician colony and in the end an imperial power, conformed to the pattern.

Tradition dated the foundation of Gades (modern Cádiz; the earliest known Phoenician trading post in Spain) to 1110 BC, Utica (Utique) to 1101 BC, and Carthage to 814 BC. The dates appear legendary, and no Phoenician object earlier than the 8th century BC has yet been found in the west. At Carthage some Greek objects have been found, datable to about 750 or slightly later, which comes within two generations of the traditional date. Little can be learned from the romantic legends about the arrival of the Phoenicians at Carthage transmitted by Greco-Roman sources. Though individual voyages doubtless took place earlier, the establishment of permanent posts is unlikely to have taken place before 800 BC, antedating the parallel movement of Greeks to Sicily and southern Italy.

Phoenician colony at Tharros, Sardinia. Photo by kind courtesy of Pasquale Mereu from Karalis (Cagliari) Material evidence of Phoenician occupation in the 8th century BC comes from Utica, and of the 7th or 6th century BC from Hadrumetum (Susah, Sousse), Tipasa (east of Cherchell), Siga (Rachgoun), Lixus, and Mogador (Essaouira), the last being the most distant Phoenician settlement so far known. Finds of similar age have been made at Motya (Mozia) in Sicily, Nora (Nurri), Sulcis, and Tharros (San Giovanni di Sinis), Bithia and Olbia in Sardinia, and Cádiz and Almuñécar in Spain. Unlike the Greek settlements, however, those of the Phoenicians long remained politically dependent on their homeland, and only a few were situated where the hinterland had the potential for development. The emergence of Carthage as an independent power, leading to the creation of an empire based on the secure possession of the North African coast, resulted less from the weakening of Tyre, the chief city of Phoenicia, by the Babylonians than from growing pressure from the Greeks in the western Mediterranean; in 580 BC some Greek cities in Sicily attempted to drive the Phoenicians from Motya and Panormus (Palermo) in the west of the island. The Carthaginians feared that if the Greeks won the whole of Sicily they would move on to Sardinia and beyond, isolating the Phoenicians in North Africa. The successful defense of Sicily was followed by attempts to strengthen limited footholds in Sardinia; a fortress at Monte Sirai is the oldest Phoenician military building in the west. The threat from the Greeks receded when Carthage, in alliance with Etruscan cities, backed the Phoenicians of Corsica in about 540 BC and succeeded in excluding the Greeks from contact with southern Spain.

Venerable historical traditions recount the Phoenician voyages to found new cities. Utica, on the Tunisian coast of North Africa, was reputedly founded in 1178 BC, and by 1100 BC the Phoenician city of Tyre supposedly had a Spanish colony at Gadir (Cadiz). Although intriguing, these historical traditions are unsupported by evidence. Excavations confirm that the Phoenicians settled in southern Spain after 800 BC. Their search for new commodities led them ever farther westward and was the reason for their interest in southern Spain's mineral wealth. The untapped lodes of silver and alluvial deposits of tin and gold provided essential raw materials with which to meet the increasing Assyrian demands for tribute. By 700 BC silver exported from the Río Tinto mines was so abundant that it depressed the value of silver bullion in the Assyrian world. This is the background for Phoenician interest in the far west.

Phoenician commerce was conducted by family firms of shipowners and manufacturers who had their base in Tyre or Byblos and placed their representatives abroad. This accounts for the rich tombs of Phoenician pattern found at Almuñécar, Trayamar, and Villaricos, equipped with metropolitan goods such as alabaster wine jars, imported Greek pottery, and delicate gold jewelery. Maritime bases from the Balearic Islands (Ibiza) to Cadiz on the Atlantic were set up to sustain commerce in salted fish, dyes, and textiles. Early Phoenician settlements are known from Morro de Mezquitilla, Toscanos, and Guadalhorce and shrines from Gorham's Cave in Gibraltar and the Temple of Melqart on the island of Sancti Petri near Cadiz. After the fall of Tyre to the Babylonians in 573 BC and the subjugation of Phoenicia, the early prosperity faded until the 4th century. Many colonies survived, however, and Abdera (Adra), Baria (Villaricos), Carmona (Carmo), Gadir (Cadiz), Malaca (Málaga), and Sexi (Almuñécar) thrived under the trading system established by Carthage for the central and western Mediterranean. Eivissa (Ibiza) became a major Carthaginian colony, and the island produced dye, salt, fish sauce, and wool. A shrine with offerings to the goddess Tanit was established in the cave at Es Cuyram, and the Balearic Islands entered Eivissa's commercial orbit after 400 BC. In 237 BC, just before the Second Punic War, Carthage launched its conquest of southern Spain under Hamilcar Barca, founded a new capital city at Cartago Nova (Cartagena) in 228 BC, and suffered crushing defeat by the Romans in 206 BC.

The Colonies, Phoenicia's Diaspora

Among the most outstanding colonies or trading posts which the Phoenicians had established were the cities of Genoa, where they went in with the Celts and established a flourishing colony, and Marseille which they started as nothing more than a trading post before it became fully Hellenized.

It is very probable that the tremendous colonial activity of the Phoenicians and Carthaginians was stimulated in the 8th to 6th centuries BC by the military blows that were wrecking the trade of the Phoenician homeland in the Levant. Also, competition with the synchronous Greek colonization of the western Mediterranean cannot be ignored as a contributing factor.

The earliest site outside the Phoenician homeland known to possess important aspects of Phoenician culture is Ugarit (Ras Shamra), about six miles north of Latakia. The site was already occupied before the 4th millennium BC, but the Phoenicians only became prominent there around 1991-1786 BC.

According to Herodotus, the coast of Libya along the sea which washes it to the north, throughout its entire length from Egypt to Cape Soloeis, which is its furthest point, is inhabited by Libyans of many distinct tribes who possess the whole tract except certain portions which belong to the Phoenicians and the Greeks.

Tyre's first colony, Utica in North Africa, was founded perhaps as early as the 10th century BC. It is likely that the expansion of the Phoenicians at the beginning of the 1st millennium BC is to be connected with the alliance of Hiram of Tyre with Solomon of Israel in the second half of the 10th century BC. In the following century, Phoenician presence in the north is shown by inscriptions at Samal (Zincirli Hüyük) in eastern Cilicia, and in the 8th century at Karatepe in the Taurus Mountains, but there is no evidence of direct colonization. Both these cities acted as fortresses commanding the routes through the mountains to the mineral and other wealth of Anatolia.

Cyprus had Phoenician settlements by the 9th century BC. Citium, known to the Greeks as Kition (biblical Kittim), in the southeast corner of the island, became the principal colony of the Phoenicians in Cyprus. Elsewhere in the Mediterranean, several smaller settlements were planted as stepping-stones along the route to Spain and its mineral wealth in silver and copper: at Malta, early remains go back to the 7th century BC, and at Sulcis and Nora in Sardinia and Motya in Sicily, perhaps a century earlier. According to Thucydides, the Phoenicians controlled a large part of the island but withdrew to the northwest corner under pressure from the Greeks. Modern scholars, however, disbelieve this and contend that the Phoenicians arrived only after the Greeks were established.

In North Africa the next site colonized after Utica was Carthage (near Tunis). Carthage in turn seems to have established (or, in some cases, reestablished) a number of settlements in Tunisia, Algeria, Morocco, the Balearic Islands, and southern Spain, eventually making this city the acknowledged leader of the western Phoenicians.

Leptis Magna, a titular see of Tripolitana was founded by the Sidonians in a fine and fertile country, it was the most important of the three towns which formed the Tripoli Confederation (Libya toay). The remains of the ancient Phœnician town are still visible, with the harbour, quays, walls, and inland defence, which make it look like Carthage. This city subsequently became the centre of a Greek city, Neapolis, of which most of the monuments are buried under sand. Notwithstanding Pliny (Nat. Hist., V, xxviii), who distinguishes Neapolis from Leptis, there is no doubt, according to Ptolemy, Strabo, and Scyllax, that they should be identified. Leptis allied itself with the Romans in the war against Jugurtha. Having obtained under Augustus the title of civitas it seems at that time to have been administered by Carthaginian magistrates; it may have been a municipium during the first century of the Christian Era and erected by Trajan into a colony bearing the name of Colonia Ulpia Trajana, found on many of its coins. The birthplace of Septimius Severus, who embellished it and enriched it with several fine monuments, it was taken and sacked in the fourth century by the Libyan tribe of Aurusiani (Ammianus Marcellinus, XXVIII, vi) and has never since completely recovered. It was at that time the seat of the military government of Tripolitana.

Carthage

Phoenician KART-HADASHT, Latin CARTHAGO, great city of antiquity, traditionally founded on the north coast of Africa by the Phoenicians of Tyre in 814 BC. It is now a residential suburb of the city of Tunis. Its Phoenician name means New Town or Land.

A brief treatment of ancient Carthage follows. For full treatment, see North Africa: History.

Various traditions concerning the foundation of Carthage were current among the Greeks, who called the city Karchedon; but the Roman tradition is better known because of the Aeneid, which tells of the city's foundation by the Tyrian princess Elissar or Elyssa (Dido in Greek), who fled from her brother Pygmalion (the name of a historical king of Tyre who ruled a century after Hiram). The inhabitants were known to the Romans as Poeni, a derivation from the word Phoenikes (Phoenicians), from which the adjective Punic is derived. According the Greek historian Timaeus (c. 356-260 B.C.), Carthage was founded in 814 B.C. by a Elyssa who gathered up the royal treasury and a group of supporters and traveled to Cyprus, another Phoenician colony. Thereafter she traveled to North Africa where present day country of Tunis is.

The site chosen for Carthage in the centre of the shore of the Gulf of Tunis was ideal: the city was built on a triangular peninsula covered with low hills and backed by the Lake of Tunis with its safe anchorage and abundant supplies of fish. The site of the city was well protected and easily defensible. On the south the peninsula is connected to the mainland by a narrow strip of land. The ancient citadel, the Byrsa, was on a low hill overlooking the sea. It is said, the local Berber permitted Elyssa and her people to have as much land at that which could be covered with a single oxhide. Hence, she was supposed to have cut an oxhide into thin strips and encircled the hill. Some of the earliest tombs have been found there, though nothing remains of Carthage's domestic and public buildings. Byrsa means fortress in Phoenician. Byrsa in Greek and Latin mean hide from which bourse or stock-market, and purse are derived.

The standard of cultural life enjoyed by the Carthaginians was probably far below that of the larger cities of the classical world. Punic interests were turned toward commerce. In Roman times Punic beds, cushions, and mattresses were regarded as luxuries, and Punic joinery and furniture were copied. Much of the revenue of Carthage came from its exploitation of the silver mines of North Africa and southern Spain, begun as early as 800 BC.

From the middle of the 3rd century to the middle of the 2nd century BC, Carthage was engaged in a series of wars with Rome called the Punic Wars. These wars, which are known as the Punic Wars, ended in the complete defeat of Carthage by Rome. When Carthage finally fell in 146 BC, the site was plundered and burned, and all human habitation there was forbidden.

Around Memphis

Phoenicians from the city of Tyre dwell all round memphis, and the whole place is known by the name of "the camp of the Tyrians." Within the enclosure stands a temple, which is called that of Venus the Stranger.

+++

Phoenician Mathematical Geography, Maps and Masters of Cartography in the Ancient World

 * http://www.phoenicia.org/maphall.htm
 * http://www.antarctica.ac.uk/

Marinus of Tyre, Phoenicia, (ca. 70-130 A.D.) was a geographer and mathematician, as well as the founder of mathematical geography. His chief merits were that he assigned to each place its proper latitude and longtitude with equal spacing for lines (ca. 100 A.D.), and introduced improvements to the construction of maps and developed a system of nautical charts. His charts used the city of Rhodes as a central point of reference. He also carefully studied the works of his predecessors and the diaries of travellers. His maps were the first in the Roman Empire to show China.

Around 120 A.D., Marinus wrote that the habitable world was bounded on the west by the Fortunate Islands. The status of the Fortunate Islands as the western edge of the known world was more formally established when Claudius Ptolemy (90 - 168 A.D.) adopted the Fortunate Islands as the prime meridian for his Geographia, written ca. 150 A.D. He acknowledged his great obligations to Marinus. Geographia was lost to the west during most of the Medieval period, but was rediscovered during the fifteenth century. It was the most famous classical map of the world, unsurpassed for almost 1500 years. The sources that Ptolemy cited most consistently were the maps and writings of Marinus, as well as adopting his ideas and practices. Ptolemy’s commentaries on Marinus are the only records remaining about the latter’s work, as none of his maps or texts has survived.

1700 years before the modern discovery of the source of the Nile, Marinus wrote an account of a journey to the Ruwenzori ca. 110 A.D. He related the tale of a Greek merchant, Diogenes who claimed a 25 day journey inland from the African East coast to "two great lakes and the snowy range of mountains where the Nile draws it's twin sources." Ptolemy and Marinus were major authorities used by Columbus in determining the circumference of the globe.

Phoenicia's Hall of Maps The collection of maps in this virtual hall provides a visual tour on the evolution of cartography through centuries, from 6200 B.C. till the Roman era. In addition, maps of Phoenicia Prima, the Phoenician Colonies, Settlements and Trading Posts, and a unique Phoenician coin which is believed to contain a map of the world.

Recognition: This page and the related Phoenicia's Hall of Maps were inspired by Dr. Gavin Francis, a physician and history enthusiast with The British Antarctic Survey (BAS) Research station located Latitude 75°35' S, Longitude 26°34' W, Brunt Ice Shelf, Coats Land, Antartica. I am indebted to Dr. Francis for writing to me about this important subject.

+++

Phoenician Deep Sea and Coastal Archaeological Discoveries

 * http://www.phoenicia.org/imgs/maps/images/zznatuicalarchmap.jpg

+++

Phoenician Canaanite Names of Towns and Cities

 * http://www.phoenicia.org/imgs/canaantwns.jpg

The above map clearly shows that the Phoenician/ Canaanites had settled the mountains quite extensively, contrary to what was previously believed.

Both researchers, Wild and Kuschke, are aware there are many more Canaanite settlements whose names had shifted from Canaanite to Aramaic and then some to Arabic.

Limiting names at present to Phoenician/Canaanite ones, presents the least extention of their settlements. Further study is needed to map the full extent of Canaanite settlement in the Lebanese mountains.

The numbers refer to the placement of the locations on the map. In this list A. Kuschke includes the 50 place-names which Stephan Wild (in his Libanesische Ortsnamen) considers to be Canaanite. Kuschke adds 25 more names which he deems to be of Canaanite origin.

The aim of Kuschke with his article is to map the distribution of Canaanite/Phoenician settlement in Lebanon. Names and corresponding numbers on the map:

1 - Yaaruun 2 - Yaariin 3 - Jijjiim 4 - (Byt) YaaHuun 5 - Qaana 6 - Dib@al 7 - Suur 8 - Arnuun 9 - 7adshiit 10 - Maifduun 11 - (Kfar) Tibniit 12 - Marj 3yuun 13 - (Mazr3t) BSaffuur 14 - Sarafand 15 - Mayduun 16 - Tanbuuriit 17 - Sayduun 18 - Sayda 19 - B3anuub 20 - 3aytaniit 21 - Mazbuud 22- Kaamid (al-Lawz) 23 - HaSruut 24 - Shuuriit 25 - (Qabr) Shmuun 26 - Habrammuun 27 - 3aynab 28 - Hama 29 - Badghaan 30 - (Mjdl) Ba3na 31 - Ta3naayil 32 - (3yn) Sawfar 33 - Zibduul 34 - Hammaana 35 - ArSuun 36 - Qarnaayil 37 - (Byt) Miri 38 - Haam 39 - al-Rawshi 40 - Bayruut 41 - Tarshiish 42 - (Mzr3t) Yaashuu3 43 - Zikriit 44 - 3ajaltuun 45 - (Kfar) Daan 46 - Ba3albak 47 - Jab3a 48 - YaanuuH 49 - Ghiyyaat 50 - Jbayl 51 - Hisraayil 52 - Jadaayil 53 - RamuuT 54 - Shammuut 55 - Suraat 56 - Daa3il 57 - HaSruun 58 - (Biir) Rawshi 59 - Hadshiit 60 - BaTruun 61 - (Daar) B3ishtaar 62 - Haamaat 63 - Bnaayil 64 - Ijbaa3 65 - Zakruun 66 - (Kfar) Qaahil 67 - Bsib3il 68 - Hirmil 69 - Dib3il 70 - 3aSaymuut 71 - Habshiit 72 - Taashii3 73 - (Tall) 3arqa 74 - (Tall) Sib3il 75 - Majdal Note: 3 - is glotal a 7 - is whisper h

Reference:

"Historisch-Topographische Bemerkungen zu Stephan Wilds 'Libanesische Ortsnamen'", in La Toponomie Antique, Actes de Colloque de Strasbourg 12-14 juin 1975, Brill, pp.75-82. Original map and text compiled by Elie Wardini Related link: Prehistoric Globalization, maps that change history by Enrique Garcia Barthe

 * http://www.enriquegarciabarthe.com.ar/

Sources & Further Reading:

J. Siebold; Ancient Maps, April 1998. http://www.henry-davis.com/MAPS/AncientWebPages/Ancient1.html Faul, Stephanie; MappoMundi, 2000. http://mappa.mundi.net/locus/locus_002/ J.J. O'Connor, E.F. Robertson,; The history of cartography, August 2002. http://www-history.mcs.st-andrews.ac.uk/history/HistTopics/Cartography.html J L Berggren and A Jones, Ptolemy's Geography : An annotated translation of the theoretical chapters (Princeton, 2000). T Campbell, Early maps (New York, 1981). T Campbell, The earliest printed maps, 1442-1500 (London, 1987). N Crane, Mercator : The Man who mapped the Planet (London, 2002). G R Crone, Maps and their makers (London, 1953). I J Curnow, The world mapped (London, 1930). J. Méndez; The History of La Palma, July 2003. http://www.ing.iac.es/PR/lapalma/history.html R W Karrow, Mapmakers of the sixteenth century and their maps (Chicago, 1993). F Sezgin, Geschichte des arabischen Schrifttums X : Mathematische Geographie und Kartographie im Islam und ihr Fortleben im Abendland. Historische Darstellung. Teil 1 (Frankfurt am Main, 2000). F Sezgin, Geschichte des arabischen Schrifttums XI : Mathematische Geographie und Kartographie im Islam und ihr Fortleben im Abendland. Historische Darstellung. Teil 2 (Frankfurt am Main, 2000). F Sezgin, Geschichte des arabischen Schrifttums XII : Mathematische Geographie und Kartographie im Islam und ihr Fortleben im Abendland. Kartenband (Frankfurt am Main, 2000). H Stevens, Ptolemy's Geography : A brief account of all the printed editions down to 1730 (London, 1908). F J Swetz, The Sea Island mathematical manual : surveying and mathematics in ancient China (Pennsylvania, PA, 1992). R V Tooley, Maps and Mapmakers (London, 1949). R Vermij (ed.), Gerhard Mercator und seine Welt (Duisburg, 1997). M Watelet (ed.), Gérard Mercator cosmographe : le temps et l'espace (Antwerp, 1994). J N Wilford, The mapmakers : the story of the great pioneers in cartography from antiquity to the space age (New York, 1981). Additional references http://www.phoenicia.org/syria.html

Articles

A Ahmedov and B A Rozenfel'd, "Cartography" - one of Biruni's first essays to have reached us (Russian), in Mathematics in the East in the Middle Ages (Russian) (Tashkent, 1978), 127-153. K Andersen, The central projection in one of Ptolemy's map constructions, Centaurus 30 (2) (1987), 106-113. L Bendefy, Regiomontanus und Ungarn, in Regiomontanus studies, Vienna, 1976 (Vienna, 1980), 243-253. A V Dorofeeva, From the history of the discovery of the Mercator projection (Russian), Mat. v Shkole (3) (1988), i; 81. N S Ermolaeva, Mathematical cartography and D A Grave's method for solving the Dirichlet problem (Russian), Istor.-Mat. Issled. No. 32-33, (1990), 95-120. H Kautzleben, Carl Friedrich Gauss und die Astronomie, Geodäsie und Geophysik seiner Zeit, in Festakt und Tagung aus Anlass des 200 Geburtstages von Carl Friedrich Gauss, Berlin, 1977 (Berlin, 1978), 123-136. C Lardicci, Geometric aspects of cartography (Italian), Archimede 34 (1-2) (1982), 23-42. R P Lorch, Ptolemy and Maslama on the transformation of circles into circles in stereographic projection, Arch. Hist. Exact Sci. 49 (3) (1995), 271-284. O Neugebauer, Ptolemy's Geography, book VII, chapters 6 and 7, Isis 50 (1959), 22-29. D B Quinn, Thomas Harriot and the new world, in Thomas Harriot : Renaissance scientist (Oxford, 1974), 36-53. M Schramm, Verfahren arabischer Nautiker zur Messung von Distanzen im Indischen Ozean, Z. Gesch. Arab.-Islam. Wiss. 13 (1999/00), 1-55. M A Tolmacheva, Ptolemy's East Africa in early medieval Arab geography, J. Hist. Arabic Sci. 9 (1-2) (1991), 31-43, 131-129.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
User:Vuara/Origins of ancient Egypt

Call number 932 WIL Author Wilkinson, Toby A. H.  Title  Genesis of the pharaohs: dramatic new discoveries that rewrite the origins of ancient Egypt / Toby Wilkinson. Publication info New York : Thames & Hudson, c2003. Physical descrip 208 p. : ill. (some col.), maps ; 25 cm. Bibliography note Includes bibliographical references (p. 201-204) and index. Subject term Prehistoric peoples--Egypt--Eastern Desert. Subject term Petroglyphs--Egypt--Eastern Desert. Geographic term Eastern Desert (Egypt)--Antiquities. Geographic term Egypt--Civilization--To 332 B.C.

Summary PharaohsU distant ancestors left a stunning legacy that has remained hidden for 6,000 years: hundreds of intricate rock carvings that tell about their lifestyle and their deepest beliefs. "Genesis of the Pharaohs" traces the discovery of these ancient records, and discovers the answer to the question of where, when, and how ancient Egypt began. 88 illustrations. Distributed by Syndetic Solutions, Inc. Review Modern scholars have tended to accept that the brilliant civilization of the pharaohs is the product of the rich agricultural surpluses of the Nile floodplain. But ancient rock carvings tell a different story, according to this illustrated treatise on ancient Egypt. Archaeologist Wilkinson specializes in rock art in the region between the Nile and the Red Sea dating from the 5th millennium B. C., when this now-desert area was verdant grassland. These pre-Pharaonic carvings, he argues, are a complex mixture of motifs, depicting crocodiles, hippos and boats from the Nile alongside ostriches and giraffes from the savannah, and suffused with cattle imagery and the religious symbolism that would characterize classical Egyptian art. This evidence, he asserts, shows that pre-Pharaonic Egyptians were not settled flood-plain farmers, but semi-nomadic herders who drove their cattle in between the lush riverbanks and the drier grasslands-a legacy evident, for example, in the Egyptian royal sceptre, which looks like a shepherd's crook. Wilkinson argues for Egyptian civilization's deep roots in a distinctive African landscape. His theory tacitly challenges an orthodoxy that holds that civilization sprang from efforts to irrigate land around the great rivers of Egypt, Mesopotamia and China; "cultural complexity," he writes, "was not borne of an easy agricultural lifestyle by the banks of the river, but of the fight for survival in more difficult terrain." Wilkinson wears his erudition lightly and provides an engaging and clearly written guide to the arcana of pre-historic Egyptology. His book is an invigorating contribution to a vital historiographical debate. 87 illustrations, 25 in color. (June) Copyright 2003 Reed Business Information. Appeared in: Publishers Weekly, May 15, 2003 (c) Copyright 2003, Cahners Business Information, a division of Reed Elsevier, Inc. All Rights Reserved. Holdings Stanley A. Milner Library Copies  Material  Location 932 WIL 1 Book Checked Out Whitemud Crossing Branch Copies  Material  Location 932 WIL 1 Book Checked Out

2 order(s) Library Copies  Status  Parts Stanley A. Milner Library 2  RECEIVED

title: User:Vuara/Origins of ancient Egypt


text:
User:Vuara/Petroglyphs

Call number 970.01 MOO Author Moore, Sabra. Title Petroglyphs : ancient language/sacred art / text and drawings by Sabra Moore. Edition 1st ed. Publication info Santa Fe, N.M. : Clear Light Publishers, c1998. Physical descrip vii, 183 p. : ill. ; 20 cm. Bibliography note Includes bibliographical references (p. 170-173) and index. Subject term Indians of North America--Antiquities. Subject term Petroglyphs--North America. Subject term Rock paintings--North America. Geographic term North America--Antiquities. DBCN (Sirsi) ADR-3944 ISBN 1574160117 Summary Sabra Moore offers a treasury of faithful artistic renderings of ancient native art from all regions of the North American continent. Accompanying her drawings are descriptions designed for the general reader that provide information on the location of each work of art; the culture from which it came; and what is known about its significance and meaning for the people who created it. The images include animals and objects, humans, hybrid human-animal forms, symbols, calendars and star markers, and celestial beings incised in caves, on cliffs and boulders, on artifacts, and even under water. This book is an appealing introduction to this unique art form -- its range, diversity, and locations -- as well as a record of many sites that are endangered or damaged or have recently been destroyed. Sabra Moore is an artist residing in New Mexico. She has created fifteen artist's books, some of which are in the collections of the Museum of Modern Art, the Brooklyn Museum, and other institutions. She has exhibited extensively in New York, Canada. New Mexico, and Brazil, and her drawings appear in Through Indian Eyes and a recent edition of Bulfinch's Mythology. Distributed by Syndetic Solutions, Inc. Review Though not intended as a survey (the subject matter is too broad), this book provides a glimpse of the beautiful artwork created by Native Americans through the centuries with 106 excellent renderings of petroglyphs and pictographs taken from such diverse media as rocks and shells. Carefully drawn by Moore, a professional artist, the pictures provide more detail than is often conveyed by photographs. Images from across the United States are subdivided by region. Also included are regional listings of sites where tourists can view some of the originals, though names and phone numbers of places to contact for information are unfortunately not included. The pictures are accompanied by descriptive text that helps put the artwork in context both historically and artistically. While the book does include a bibliography, it does not show the type of scholarly rigor that would make it of interest to academic collections. Recommended for public libraries.--John Burch, Hagan Memorial Lib., Williamsburg, KY Appeared in: Library Journal, Mar 15, 1999 (c) Copyright 1999, Cahners Business Information, a division of Reed Elsevier, Inc. All Rights Reserved. Holdings Stanley A. Milner Library Copies  Material  Location 970.01 MOO 1 Book Adult collection

+++

Call number 759.0112 CRO Author Crosby, Harry, 1926- Title The cave paintings of Baja California : discovering the great murals of an unknown people / written and photographed by Harry W. Crosby ; additional photographs by Enrique Hambleton ; illustrations by Harry Crosby and Joanne Haskell Crosby. Edition Rev. and expanded ed. Publication info San Diego, Calif. : Sunbelt Publications, 1997. Physical descrip ix, 246 p. : ill. (some col.), col. maps ; 26 cm. Series Title (Sunbelt natural history books) Bibliography note Includes bibliographical references (p. 241-243) and index. Subject term Indians of Mexico--Mexico--Baja California--Antiquities. Subject term Cave paintings--Mexico--Baja California. Subject term Rock paintings--Mexico--Baja California. Subject term Petroglyphs--Mexico--Baja California. Geographic term Baja California (Mexico : Peninsula)--Antiquities. DBCN (Sirsi) ADM-5520 ISBN 0932653235 (hardcover : alk. paper) Review Crosby spent a large part of the 1960s and1970s doggedly ferreting out prehistoric rock art sites in the mid-peninsula region of Baja. This complete revision of a shorter work first published in 1975 reveals that it was not only a labor of love, but perhaps an obsession as well. Produced by an as-yet-unknown culture Crosby quaintly calls "The Painters," these cave paintings are stunning pictographs that rival the finest rock art and cave paintings in the world. But the text is a plodding, repetitious litany of every back country foray he undertook for some 20 years to discover those neglected sites. Not until the last chapter, "The Practices and Puzzles of the Painters," do we receive anything approaching speculation as to who it was that created these marvelous images. Crosby seems too interested in explaining the difficulty in reaching every cave and how disappointed he was by the woefully deteriorated condition of many of the murals. The photographs, too, tend to be similarly weighted toward the process rather than the outcome: too many of the 71 color photos are given over to man-with-mural, where mural alone might have been clearer. Without better pictures, or more thorough analysis of findings, this book becomes a sort of unsatisfying anthropological travelogue. 11 b&w photos; 108 color illustrations. (Feb.) Appeared in: Library Journal, Sep 01, 1998 (c) Copyright 1998, Cahners Business Information, a division of Reed Elsevier, Inc. All Rights Reserved. Holdings Stanley A. Milner Library Copies  Material  Location 759.0112 CRO 1 Book Adult collection

title: User:Vuara/Petroglyphs


text:
User:Vuara/Alphabets at EPL

Call Number 493.18242 COL 2003 Author Collier, Mark. Title How to read Egyptian hieroglyphs : a step-by-step guide to teach yourself / Mark Collier and Bill Manley ;

new illustrations by Richard Parkinson. Portion of title Egyptian hieroglyphs Edition Rev. ed. Publication info Berkeley : University of California Press, [2003], c1998. Physical descrip ix, 179 p. : ill. ; 24 cm. Bibliography note Includes bibliographical references (p. [174]-176) and index. Language English and Hieroglyphics (Egyptian). Subject term Egyptian language--Writing, Hieroglyphic. Subject term Egyptian language--Textbooks for foreign speakers--English. Subject term Egyptian language--Self instruction. Added author Manley, Bill. DBCN (CaAE) a475652 ISBN 0520239490 Summary With the help of Egyptologists Collier and Manley, museum-goers, tourists, and armchair travelers alike can gain a

basic knowledge of the language and culture of ancient Egypt. Each chapter introduces a new aspect of

hieroglyphic script and encourages acquisition of reading skills with practical exercises. 200 illustrations. Distributed by Syndetic Solutions, Inc. Holdings Stanley A. Milner Library Copies  Material  Location 493.18242 COL 2003 1 Book Adult collection Jasper Place Branch Copies  Material  Location 493.18242 COL 2003 1 Book Checked Out Whitemud Crossing Branch Copies  Material  Location 493.18242 COL 2003 1 Book General collection

3 order(s) Library Copies  Status  Parts Stanley A. Milner Library 3  RECEIVED

+++

Call number 493.1 JAC Author Jacq, Christian. Title Fascinating hieroglyphics : discovering, decoding & understanding the ancient art / Christian Jacq. Publication info New York : Sterling Pub., 1998, c1997. Physical descrip 224 p. : ill. ; 24 cm. Bibliography note Includes bibliographical references (p. 218) and index. Subject term Egyptian language--Writing, Hieroglyphic. DBCN (CaAE) a497023 ISBN 0806981008 ISBN 0806986999 (pbk.) Summary Do what it took experts centuries to do-read hieroglyphics, and create sentences of your own, with this ingenious

guide. Follow the evolution of this form of communication, its near disappearance, and the fascinating story behind

"breaking its code." Distributed by Syndetic Solutions, Inc. Holdings Stanley A. Milner Library Copies  Material  Location 493.1 JAC 1 Book Checked Out

1 order(s) Library Copies  Status  Parts Stanley A. Milner Library 1  RECEIVED

+++

Call number 411 CAM Author Campbell, George L.  Title  Handbook of scripts and alphabets / by George L. Campbell. Publication info London [England] : Routledge, c1997. Physical descrip vii, 132 p. : ill. ; 24 cm. Subject term Writing--Handbooks, manuals, etc. Subject term Alphabet--Handbooks, manuals, etc. DBCN (Sirsi) ADM-5967 ISBN 0415137152 (pbk.) Summary This is a concise reference handbook of the main scripts and alphabets of the world. Forty alphabets are

presented and discussed, with entries ranging from the mainstream, such as Amharic, Chinese and Thai, to the

more obscure, such as Cree and Samaritan. Distributed by Syndetic Solutions, Inc. Holdings Stanley A. Milner Library Copies  Material  Location 411 CAM 1 Reference book Reference

+++

Call number 493.1/BUD Author Budge, E. A. Wallis (Ernest Alfred Wallis), Sir, 1857-1934. Title An Egyptian hieroglyphic dictionary : with an index of English words, king list, and geographical list with

indexes, list of hieroglyphic characters, Coptic and Semitic alphabets, etc. / by Sir E. A. Wallis Budge. -- Publication info  New York : Dover Publications, 1978. Physical descrip 2 v. (cliv, 1314 p.) : ill. ; 26 cm. General Note "Republication of the work originally published ... by John Murray, London, in 1920." General Note Includes index (v.2). Bibliography note Bibliography: v. 1, p. [lxxvii]-xcvi. Subject term Egyptian language--Dictionaries. Subject term Egyptian language--Writing, Hieroglyphic DBCN (Sirsi) AAJ-1487 ISBN 0486236153 (v.1) : $12.95 ISBN 0486236161 (v.2) : $12.95 Holdings Stanley A. Milner Library Copies  Material  Location 493.1 BUD v.1 1 Reference book Reference 493.1 BUD v.2 1 Book Checked Out 1 Reference book Reference

title: User:Vuara/Alphabets at EPL


text: File:Elasticplastic rec Solid Mechanics.png


text: File:Elastic strainharden Solid Mechanics.png


text:
Perl Programming/Perl 6

Raku will separate parsing and compilation and runtime, making the virtual machine more attractive to developers looking to port other languages to the architecture.

Parrot is the Raku runtime, and can be programmed at a low level in Parrot assembly language. Parrot exists in a limited form as of June, 2003, and a small number of languages (Jako, Cola, Basic, Forth and a subset of Raku) exist simply to be 'compiled' down to Parrot assembly language opcodes.

While Raku is being developed, the best way to stay informed about what's happening is to keep an eye on Weekly Rakudo News. Go there to see glimpses of Raku.

title: Perl Programming/Perl 6


text:
Perl Programming/Humour

Obfuscated code
Some people claim Perl stands for 'Pathologically Eclectic Rubbish Lister' due to the high use of meaningful punctuation characters in the language syntax.

In common with C programming language, obfuscated code competitions are an interesting feature of the Perl culture. Similar to obfuscated code but with a different purpose, Perl Poetry is the practice of writing poems that can actually be compiled by perl. This practice is fairly unique to Perl, due to the large number of regular English words used in the language. New poems can regularly be seen in the Perl Poetry section of perlmonks.org.

Just another Perl Hacker
Your mission, should you choose to accept it, is to write a one-liner perl script which displays the phrase "Just another Perl hacker," (including the comma, and capitalization as shown). If successful, you win the right to use it as an email signature identifying yourself as a Perl hacker. Entries will be judged on how smart-ass the code is. Around 100 of the first JAPHs and some funky obfu Perl can be seen on CPAN.

Acme
There's always a place in Perl for odd modules, and one such place is the Acme:: namespace. If you have a module which knows how long a piece of string is, or one which converts your perl script into an image of Che Guevara, post it here.

Golf
Perl is a very compact language. So compact, that some have even create a game around perl's terseness called perlgolf. In perlgolf, you are given a problem to solve. You must solve it in the fewest number of characters possible. A scorecard is kept, and after 18 "holes", a winner is announced.

title: Perl Programming/Humour


text:
Perl Programming/Regular expressions

Regular expressions are tools for complex searching of text, considered one of the most powerful aspects of the Perl language. A regular expression can be as simple as just the text you want to find, or it can include wildcards, logic, and even sub-programs.

To use regular expressions in perl, use the =~ operator to bind a variable containing your text to the regular expression:

This returns 1, if "needle" is contained within $HayStack, or 0 otherwise.

Regular expression can also be used to modify strings. You can search and replace complex patterns by using the regex format s///

($msg is now "perl is awesome")

Perl/Expressões regulares

title: Perl Programming/Regular expressions


text: Perl Programming/Regular expressions reference


text: Perl Programming/Regular expression operators


text: File:Stressconc Solid Mechanics.png

title: File:Stressconc Solid Mechanics.png


text:
Perl Programming/CPAN

=CPAN=

A huge collection of freely usable Perl modules, ranging from advanced mathematics to database connectivity, networking and more, can be downloaded from a network of sites called CPAN. Most or all of the software on CPAN is also available under either the Artistic License, the GPL, or both. CPAN.pm is also the name of the Perl module that downloads and installs other Perl modules from one of the CPAN mirror sites; such installations can be done with interactive prompts, or can be fully automated.

Look for modules on CPAN

With ActivePerl (Windows systems)
From a command-line, type the command

ppm

This will give you a "Perl Package Manager" prompt, which allows you to download and install modules from the internet. For example, to install the Time::HiRes module, type:

search time::hires

That will give you a list of modules that match your search query. Once you know the module is available and what its exact name is, you can install the module with:

install Time::HiRes

With Perl
If you're using a normal version of Perl, the way to activate the package manager is this:

perl -MCPAN -e shell;

This will load the CPAN module, and let you search for, download, install, and manage the modules on your computer the same as PPM.

With Perl (cpanm)
The Perl module cpanm (CPAN Minus) is another alternative for installing modules from the CPAN library cpanminus.pm.

cpanm can be installed and used like this on a UNIX-like system:

curl -L "http://cpanmin.us" >cpanm chmod +x cpanm ./cpanm LWP::Bundle

One must have root privileges in order to install module in the system-wide directories, however alternatives exist such as local::lib, which allows regular users to install and use Perl modules in their home folder lib.pm.

With Strawberry Perl (Windows systems)
Strawberry Perl also includes the CPAN module, so you can use the command above to activate the package manager.

The start menu, however, also includes a shortcut (with the name of "CPAN Client") so that you don't have to go to a command line to do so.

A number of modules are already included in Strawberry Perl, beyond what comes with a normal version of Perl, or what comes with ActivePerl, so you may wish to check, if the module you want is already installed before you start the CPAN client.

Using a module in your program
To incorporate a module into your program, use the use keyword:

use Time::HiRes;

You can supply an optional list of the functions you want to use from this module, if you're worried that some of the function names in the module are too similar to functions you're already using:

use Time::Hires qw(time gmtime);

With that done, you can simply use the supplied functions as normal. Most modules have example programs within their documentation, and the best way to start using a module is to copy and adapt one of the example programs.

Finding documentation
The documentation for each module is installed in your documentation directory when you get a new module, or you can browse documentation on search.cpan.org and perldoc.perl.org.

Unix systems
On Unix systems, the documentation is usually installed as man pages in section 3p so that the command below will work:

man 3p Module::Name

<tt>perldoc Module::Name</tt> will also work.

If you want documentation that is browseable in a web browser, you can install Perldoc::Server as noted below.

Windows systems running ActivePerl
Module documentation is installed as HTML files in ActivePerl. To find those files, try looking in some of the following directories:

 * C:\Perl\html\lib
 * C:\Perl\html\site\lib

If you're having real trouble finding the HTML documentation for a module, you may be able to read the <tt>*.pm</tt> Perl file yourself for POD comments, or use the <tt>pod2html</tt> tool yourself to generate the HTML file.

Windows systems running Strawberry Perl
Strawberry Perl does not install module documentation as either manpages or html files. Instead, you can run the perldoc command to display module documentation.

perldoc Module::Name

You can also use <tt>Perldoc::Server</tt> to display module documentation, as illustrated below.

<tt>Perldoc::Server</tt>
The Perldoc::Server module (that can be installed via CPAN) will provide a local server that will display HTML files "on the fly" from Perl's documentation and the documentation for installed modules. Install it, and the command

perldoc-server

will be in your path. Run it, and then browse to <tt>http://localhost:7375/</tt> in your Web browser to see the documentation.

Note that the perldoc-server command must be running to provide the documentation using this method.

Contributing your own modules to CPAN
In the event that a module you need isn't available on CPAN, the usual answer is to write the module yourself and add it to CPAN. That way, nobody else needs to waste time creating the same functionality that you're already written.

See How to contribute modules to CPAN

title: Perl Programming/CPAN


text:
Perl Programming/First programs

A first taste of Perl
Here's a simple program written in Perl to get us started:

Let's take a look at this program line by line:

 * #!/usr/bin/perl
 * On Unix systems this tells the Operating System to execute this file with the program located at /usr/bin/perl. This is the default Unix location for the perl interpreter, on Windows #!C:\Perl\bin\perl.exe  or #!C:\strawberry\perl\bin\perl.exe (depending on whether ActivePerl or Strawberry Perl was installed) should be used instead.

 * # Outputs ...
 * This line is a comment - it is ignored by the perl interpreter, but is very useful. It helps you to debug and maintain your code, and explain it to other programmers.

 * print "Hello World!\n";
 * The print instruction writes whatever follows it to the screen. The \n at the end of the string puts a new line to the screen. The semicolon at the end of the line tells the perl interpreter that the instruction is finished; you must put a semicolon at the end of every instruction in Perl code.

Exercises
de:Perl-Programmierung: Hello World Programación en Perl/Tu primer programa it:Perl/Primo programma: Ciao Mondo! Perl/Pierwszy program Perl/Primeiro programa

title: Perl Programming/First programs


text:
Perl Programming/Variables

In Perl, there are five types of variables: $calars, @rrays, %hashes, &subroutines, and *typeglobs.

Simple variables
Variables, called scalars, are identified with the $ character, and can contain nearly any type of data. For example:

Case sensitivity
Note that the perl interpreter is case sensitive. This means that identifier names containing lowercase letters will be treated as being different and separate from those containing uppercase letters.

Arrays
Arrays in Perl use the @ character to identify themselves.

However, when you deal with just one element of the array (using square brackets so it's not confused), then that element of the array is considered a scalar which takes the $ sigil:

As in the C programming language, the number of the first element is 0 (although as with all things in Perl, it's possible to change this if you want). Array subscripts can also use variables:

Associative arrays
Associative arrays, or "hashes," use the % character to identify themselves.

When using the => the left side is assumed to be quoted. For long lists, lining up keys and values aids readability.

However, when you deal with just one element of the array (using braces), then that element of the array is considered a scalar and takes the $ identifier:

Associative arrays are useful when you want to refer to the items by their names.

Subroutines
Subroutines are defined by the sub function, and used to be called using & (using  is now deprecated). Here's an example program that calculates the Fibonnaci sequence:

title: Perl Programming/Variables


text:
Perl Programming/Function reference

Action
Removes the last characters from a string only if they're recognized as a record separator (e.g. a newline character)

Returns
?

Syntax
chomp($String = $_);

Example
chomp; # removes the last character from $_ if it is a record separator chomp; # (same) chomp($String); # removes the last character from $String if it is a record separator

Action
Removes the last character from a string regardless

Returns
?

Syntax
chop($String = $_);

Example
chop; # removes the last character from $_ chop; # (same) chop($String); # removes the last character from $String

print chr(65); # Prints a capital A

Gets an ASCII character, given it's code

my $HashedWord = crypt($Word, $Salt);
 * 1) One-way hash function

(See also MD5 )

The salt string needs only be two characters long, and provides a way of randomising the hash, such that the same word can produce several different hashes, if used with different values of !

print hex(11); # Prints B

Converts a number to hexadecimal

Other way around - converts hex to number: print hex(11); # prints 17

you can use

print sprintf("%X",11); # Prints B

Search for one string within another (see rindex to search from end-to-start).

$Result = index($Haystack, $Needle); $Result = index($Haystack, $Needle, $StartPosition);

index("Some text", "bleh"); # Returns -1 (not found) index("Some text", "Some"); # Returns 0 (first character) index("Some text", "text"); # Returns 5 (sixth character)

The special variable  always gets added to the return value, but   is normally 0, and the manual recommends leaving it at 0.

$Lowercase = lc($String);

Converts a string to lower-case

Converts the first character of a string to lowercase

print "String is ". length($String). " characters long\n";

Returns the length of a string

print oct(8); # Prints 10

Converts a number to octal

Converts a character to its number.

print ord("A"); # prints 65

Takes a list and converts it into a string using a supplied set of rules.

my $String = pack($Template, @ListOfNumbers); my $String = pack("CCCC",65,66,67,68); # Result: "ABCD"

$Template can be made up of:

a	A string with arbitrary binary data, will be null padded. A	An ascii string, will be space padded. Z	A null terminated (asciz) string, will be null padded.

b	A bit string (ascending bit order inside each byte, like vec). B	A bit string (descending bit order inside each byte). h	A hex string (low nybble first). H	A hex string (high nybble first).

c	A signed char value. C	An unsigned char value. Only does bytes. See U for Unicode.

s	A signed short value. S	An unsigned short value. (Exactly 16 bits unless you use the ! suffix)

i	A signed integer value. I	An unsigned integer value. (At least 32 bits wide, machine-dependent)

l	A signed long value. L	An unsigned long value. (Exactly 32 bits unless you use the ! suffix)

n	An unsigned short in "network" (big-endian) order. N	An unsigned long in "network" (big-endian) order. v	An unsigned short in "VAX" (little-endian) order. V	An unsigned long in "VAX" (little-endian) order. (Exactly 16 bits and 32 bits respectively)

q	A signed quad (64-bit) value. Q	An unsigned quad value. (Only available if your system supports 64-bit integers and Perl has been compiled to support them)

f	A single-precision float in the native format. d	A double-precision float in the native format.

p	A pointer to a null-terminated string. P	A pointer to a structure (fixed-length string).

u	A uuencoded string. U	A Unicode character number. Encodes to UTF-8 internally.

w	A BER compressed integer. Its bytes represent an unsigned integer in base 128, most significant digit first, with as few digits as possible. Bit eight (the high bit) is set on each byte except the last.

x	A null byte. X	Back up a byte. @	Null fill to absolute position.

Each letter may optionally be followed by a number giving a repeat count.

The integer types,  ,  , and   may be immediately followed by a   suffix to signify native shorts or longs

Reverses a string (in scalar context) or a list (in list context):

my @ReversedList = reverse(@List);

foreach( reverse( sort( @List ))) { ... }
 * 1) As commonly seen in Perl programs:

my $ReversedString = reverse($String);

my @List = ("One ", "two ", "three..."); my $ReversedListAsString = reverse(@List); # Prints "...eerht owt enO"

Search for one string within another, starting at the end of the string.

$Result = rindex($Haystack, $Needle); $Result = rindex($Haystack, $Needle, $StartPosition);

rindex("Some text", "bleh"); # Returns -1 (not found) rindex("Some text", "Some"); # Returns 0 (first character) rindex("abbbbb", "b");      # Returns 5 (first "b" found, when starting at the end)

Prints a formatted string:

my $Text = sprintf("%d/%d is %08.5f", 1, 3, 1/3); # Result: "10/3 is 003.33333"

sprintf("Character: %c", 65); sprintf("String %s", "Hello"); sprintf("Signed integer: %d", 15); sprintf("Unsigned integer: %u", 15); sprintf("Unsigned int (in octal): %o", 15); sprintf("Unisgned int (in hex): %x", 15);     # Use %X to get upper-case output sprintf("Binary number: %b", 15); sprintf("Scientific notation: %e", 5000);     # Use %E to get upper-case output sprintf("Floating point number: %f", 1/3);    # 0.3333333 sprintf("Floating point number: %g", 1/3);    # Decides between scientific and float. %G is uppercase sprintf("Pointer: %p", $Variable);

Use %% to get a percent-sign.

Use %n to request the number of characters written so far, and put it into the next variable in the list. You may want to check that user-supplied formatting rules don't contain this code.

sprintf("%02d", $Minutes); # Forces leading zeros to make the string two characters long sprintf("%1.5f", $Number); # Limits the number of decimal places

substr
Return part of a string (a substring)

Format: substr string start-position length

 * start-position is zero-based.
 * A negative number starts from the end of the string.

$FirstLetter  = substr($Text, 0, 1);   # First letter $First3Letters = substr($Text, 0, 3);  # First three letters $Last3Letters = substr($Text, -3);     # Last three letters

You can use substr on the left side of an assignment statement to change part of a string. This can actually shorten or lengthen the string.

$text = 'cat dog'; substr ($mystring, 3, 1) = ' and '; # $text now contains 'cat and dog'

$Uppercase = uc($String);

Converts a string to upper-case

Converts the first character of a string to uppercase

Returns the absolute (positive) value of a number $Number = abs(-100); # Returns 100;

$Number = atan2($Y, $X);
 * 1) Converts cartesian(x,y) coordinates into an angle

$Number = cos($Angle); # Cosine = Adjacent/Hypotenuse
 * 1) Returns the cosine of an angle (radians)

$Number = exp(2); # Returns
 * 1) Raises e to a specified power

e ≈ 2.71828183 more about e

$Number = hex("10"); # Returns 16 $Number = hex("0xFF"); # Returns 255
 * 1) Interprets a string as hexidecimal, and returns its value

Rounds a number towards zero, returning an integer $Number = int(-1.6); # Returns -1 $Number = int(0.9);  # Returns 0 $Number = int(28.54); # Returns 28

$Number = log(2.71828183);  # Returns 1 $Number = exp(log($X));     # Returns $X $Number = log($X)/log(10);  # Returns log10($X). Alternately, you can use the log10 function in the POSIX module $Number = log($X)/log(15);  # Returns log to the base 15 of $X
 * 1) Returns the natural logarithm of a number

$Number = oct("10"); # Returns 8 $Number = oct("21"); # Returns 17
 * 1) Interprets a string as octal, and returns its value

$Number = rand; # Returns a random number from 0 to 1 $Number = int(rand(800)); # Returns a random integer from 0 to 799 $Number = 1 + int(rand(999)); # Returns a random integer from 1 to 999
 * 1) Gets a random number (may automatically call srand if that's not been done)

$Number = sin($Angle); # Sine = Opposite/Hypotenuse
 * 1) Returns the sine of an angle (radians)

$Number = sqrt(4);                 # Returns 2 $Number = sqrt($X ** 2 + $Y ** 2); # Returns the diagonal distance across a $X x $Y rectangle
 * 1) Returns the square-root of a number

See the  module, if you need to take roots of negative numbers.

srand;
 * 1) Seeds (sets-up) the random-number generator

Version-dependent, and older versions of Perl are not guaranteed to have a good seed value. See the  module for more possibilities. The current version of Perl uses the urandom device if it's available.

$LastElement = pop(@MyArray);

Take the last element from an array.

push(@MyArray, "Last element"); push(@MyArray, "several", "more", "elements");

Push a list of elements onto the end of an array.

shift(@MyArray); # Delete the first element $FirstElement = shift(@MyArray); # Delete the first element, load it into $FirstElement instead

Take the first element out of an array.

splice(@Array); # Removes all elements from array splice(@Array, 10); # Removes from element 10 to the end of the array splice(@Array, -10); # Removes the last 10 elements of the array splice(@Array, 0, 10); # Removes the first 10 elements of the array @NewArray = splice(@Array, 0, 10); # Removes the first 10 elements of the array and returns those 10 items splice(@Array, 0, 10, @Array2); # Replaces the first 10 elements of the array with Array2
 * 1) Removes elements from an array, optionally replacing them with a new array

unshift(@MyArray, "New element"); unshift(@MyArray, "several", "more", "elements");

Add a list of elements onto the beginning of an array.

@TextFiles = grep(/\.txt$/, @AllFiles); $NumberOfTextFiles = grep(/\.txt$/, @AllFiles);
 * 1) Returns a list of elements for which an expression is true

@TextFiles = grep({return(substr($_, -3) eq "txt");}, @AllFiles);
 * 1) Can use a block of code instead of an expression

$OneItemPerLine = join( "\n", @List); $EverythingBunchedTogether = join( "", @List); $Filename = join( "/", ($Directory, $Subdirectory, $Filename));
 * 1) Joins the items of a list into a single string

@UppercaseList = map(uc, @List); @Numbers = map {"Number $_"} 1..100;
 * 1) Evaluates a block of code for each item in a list, and returns
 * 2) a list of the results

@ReversedList = reverse(@List); $ReversedString = reverse('foo','bar','baz'); # gives 'zabraboof'
 * 1) Reverses the order of a list
 * 1) In scalar context, concatenates the list and then reverses the string

@AsciiSort = sort(@RandomList); @AsciiSort = sort @RandomList; foreach $Item (sort @RandomList) {...}
 * 1) Sorts the elements in a list

@CaseInsensitiveSort = sort {uc($a) cmp uc($b)} @RandomList; @NumericSort = sort {$a <=> $b} @RandomList; @CustomSort = sort custom_function_name @RandomList;
 * 1) Can specify a function to decide the sort order

Unpacks a string into a list - see the templates available for the pack function for details

%h = ('a'=>1, 'cow'=>'moo', 'b'=>2); delete $h{cow};
 * 1) Remove an element from a hash
 * 1) %h now contains ('a'=>1, 'b'=>2)

while (($key, $value) = each (%hash)) { print "$key => $value\n"; }
 * 1) Return the 'next' key/value pair (in a random order)

# Tests whether or not a key exists in a hash (even if the value for that key is undef) if (exists $hash{$key}) { print "\%hash contains a value for key '$key'\n"; }

# Returns a list of all keys from the hash, in same 'random' order as each foreach $key (keys %hash) { print "$key => $hash{$key}\n"; }

# Returns a list of all values from the hash, in same 'random' order as keys foreach $value (values %hash) { print "\%hash contains a value '$value'\n"; }

close(STDERR); # hide debugging info from the user
 * 1) closes a filehandle when it is no longer needed

closedir(DIRHANDLE);
 * 1) Close a directory open by opendir

Exits the program, printing to "STDERR" the first parameter and the current file and line. Used to trap errors.

This function returns, if the next read on   would return end-of-file, or if   is not open. may be an expression whose value gives the real filehandle, or a reference to a filehandle object of some sort. An  without an argument returns the end-of-file status for the last file read. An  with empty parentheses   tests the   filehandle (most commonly seen as the null filehandle in  ). Therefore, inside a while loop, an   with parentheses will detect the end of only the last of a group of files. Use eof (without the parentheses) to test each file in a while loop. For example, the following code inserts dashes just before the last line of the last file:

On the other hand, this script resets line numbering on each input file:

Like " " in a sed program, eof tends to show up in line number ranges. Here's a script that prints lines from  to end of each input file:

Here, the flip-flop operator evaluates the pattern match for each line. Until the pattern matches, the operator returns false. When it finally matches, the operator starts returning true, causing the lines to be printed. When the eof operator finally returns true (at the end of the file being examined), the flip-flop operator resets, and starts returning false again for the next file in

Prints the parameters given.

Discussed in the following sections:
 * Digression on print in Strings section

See the entry for   further up the page

read(FILEHANDLE, $StoreDataHere, $NumberBytes);
 * 1) Reads data from a file-handle

$NumberBytesRead = read(FILEHANDLE, $StoreDataHere, $NumberBytes);
 * 1) Returns the number of bytes read

read(FILEHANDLE, $StoreDataHere, $NumberBytes, Offset);
 * 1) Optional offset is applied when the data is stored (not when reading)

syscall( $Command, $Argument1, $Argument2, $Argument3);
 * 1) Runs a system command

$ReturnValue = syscall($Command);
 * 1) (maximum 14 arguments)

unpack($Template, $BinaryData);
 * 1) See the pack function for details (unpack does the opposite!)

if (-r	$FullFilename) // File is readable by effective uid/gid. if (-w	$FullFilename) // File is writable by effective uid/gid. if (-x	$FullFilename) // File is executable by effective uid/gid. if (-o	$FullFilename) // File is owned by effective uid.

if (-R	$FullFilename) // File is readable by real uid/gid. if (-W	$FullFilename) // File is writable by real uid/gid. if (-X	$FullFilename) // File is executable by real uid/gid. if (-O	$FullFilename) // File is owned by real uid.

if (-e	$FullFilename) // File exists. if (-z	$FullFilename) // File has zero size. if (-s	$FullFilename) // File has nonzero size (returns size).

if (-f	$FullFilename) // File is a plain file. if (-d	$FullFilename) // File is a directory. if (-l	$FullFilename) // File is a symbolic link. if (-p	$FullFilename) // File is a named pipe (FIFO), or Filehandle is a pipe. if (-S	$FullFilename) // File is a socket. if (-b	$FullFilename) // File is a block special file. if (-c	$FullFilename) // File is a character special file. if (-t	$FullFilename) // Filehandle is opened to a tty.

if (-u	$FullFilename) // File has setuid bit set. if (-g	$FullFilename) // File has setgid bit set. if (-k	$FullFilename) // File has sticky bit set.

if (-T	$FullFilename) // File is an ASCII text file. if (-B	$FullFilename) // File is a "binary" file (opposite of -T).

$Age = -M $FullFilename; // Age of file in days when script started. $Age = -A $FullFilename; // Same for access time. $Age = -C $FullFilename; // Same for inode change time.

chdir $Directory; chdir $Directory || die("Couldn't change directory");

chmod 0744 $File1; chmod 0666 $File1, $File2, $File3;
 * 1) 0 for octal, at the beginning of a number

| Owner | Group | Others | Execute |  4   |   4   |   4    | Write  |   2   |   2   |   2    | Read   |   1   |   1   |   1    | ======--+======-+======-+======--+ Total  |       |       |        |

chown($NewUserID, $NewGroupID, $Filename); chown($
 * 1) Change the owner of a file

NewUserID $NewGroupID, $File1, $File2, $File3); NewUserID, $NewGroupID, $File1, $File2, $File3);

chown($NewUserID, -1, $Filename); # Leave group unchanged chown(-1, $NewGroupID, $Filename); # Leave user unchanged

chroot $NewRootDirectory;

Sets the root directory for the program, such that the " " location refers to the specified directory.

Program must be running as root for this to succeed.

my @TextFiles = glob("*.txt");
 * 1) Expands filenames, in a shell-like way

See also.

link($ExistingFile, $LinkLocation); link($ExistingFile, $LinkLocation) || die("Couldn't create link");
 * 1) Creates a link to a file

Identical to stat, except that if given file is symbolic link, stat link not the target.

mkdir $Filename || die("Couldn't create directory"); mkdir $Filename, 0777; # Make directory with particular file-permissions

open(my $FileHandle, $Filename) || die("Couldn't open file"); open(my $fp, "<", $Filename);  # Read from file open(my $fp, ">", $Filename);  # Write to file open(my $fp, ">>", $Filename); # Append to file

open(my $fp, "<$Filename");    # Read from file open(my $fp, ">$Filename");    # Write to file open(my $fp, ">>$Filename");   # Append to file

open(my $fp, "<", "./  filename with whitespace   \0"); open(my $fp, "<", "./->filename with reserved characters\0");

open(my $fp, "$Program |");    # Read from the output of another program open(m myy $fp, "| $Program");    # Write to the input of another program

open(my $fp, "<", "-");        # Read from standard input open(my $fp, ">", "-");        # Write to standard output

opendir(my $DirHandle, $Directory) || die("Couldn't open directory");

while (my $Filename = readdir $DirHandle) { # Do something with $Filename in $Directory } closedir($DirHandle);

opendir(DIR, $Directory) || die("Couldn't open directory");

foreach(readdir(DIR)) { # Do something with $_ in $Directory } closedir(DIR);

$LinkTarget = readlink($LinkPosition);
 * 1) Finds the value of a symbolic link

rename $OldFile, $NewFile or die("Couldn't move file");

May work differently on non-*nix operating systems, and possibly not at all when moving between different filesystems. See for more complicated file operations.

rmdir $Filename || die("Couldn't remove directory");

stat

$DeviceNum   = $FileStatistics[0]; # device number of filesystemcs[0]; # device number of filesystem $Inode       = $FileStatistics[1]; # inode number $FileMode    = $FileStatistics[2]; # (type and permissions) $NumHardLinks = $FileStatistics[3]; # number of (hard) links to the file $UserID      = $FileStatistics[4]; # numeric user ID $GroupID      = $FileStatistics[5]; # numeric group ID $DeviceIdent  = $FileStatistics[6]; # Device identifier (special files only) $SizeBytes   = $FileStatistics[7]; $AccessTime  = $FileStatistics[8]; # seconds since the epoch $ModifyTime  = $FileStatistics[9]; $ChangeTime  = $FileStatistics[10]; $BlockSize   = $FileStatistics[11]; $NumBlocks   = $FileStatistics[12];

symlink($OldFilename, $NewFilename); symlink($OldFilename, $NewFilename) || die("Couldn't create symlink"); eval(symlink($OldFilename, $NewFilename));
 * 1) Creates a new filename symbolically linked to the old filename

my $UMask = umask; umask(0000); # This process can create any type of files umask(0001); # This process can't create world-readable files umask(0444); # This process can't create executable files
 * 1) Sets or returns the umask for the process.

unlink $Filename; unlink $Filename || die("Couldn't delete file"); unlink $File1, $File2, $File3; (unlink($File1, $File2, $File3) == 3) || die("Couldn't delete files");
 * 1) Deletes a file

my $AccessTime = time; my $ModificationTime = time;
 * 1) Updates the modification times of a list of files

utime($AccessTime, $ModificationTime, $Filename); my $NumFilesChanged = utime($AccessTime, $ModificationTime, $File1, $File2, $File3);

Returns information about the current function call stack. In scalar context, returns only the name of the package from where the current subroutine was called. In list context, returns the package, filename, and line number. In list context with a numeric argument passed, returns several pieces of information (see below). The argument represents how many levels in the call stack to go back.

 * 1) !/usr/bin/perl

foo; sub foo { $package = caller; # returns 'main' ($package, $filename, $line) = caller; # returns 'main', the file name, and 3 # Line below returns all 10 pieces of info. (Descriptions self-explanatory from variable names) ($package, $filename, $line, $subroutine, $hasargs, $wantarray, $evaltext, $is_require, $hints, $bitmask) = caller(0); }

There is no actual 'import' function. Rather, it is a convention when writing a module to create a subroutine named 'import' that populates the current namespace with that module's needed variables or methods.

The standard 'Exporter' module provides an import method, if your class has it as a base class.

Declares all lines that follow (until EOF or the next package statement) to belong to the given package's namespace.
 * 1) !/usr/bin/perl

$x = 5; # sets $main::x

package Foo; $x = 5; # sets $Foo::x sub bar { # defines &Foo::bar print "hello world"; }

package Temp; $x = 5; # sets $Temp::x

includes the specified module's code into the current program. The module can be specified either with an absolute or relative path, or with a bareword. If a bareword is given, a ' ' extention is added, and  is replaced with the current operating system's path seperator:

require Foo::Bar; require 'Foo/Bar.pm';
 * 1) identical to:

Requires and imports the given module or pragma, at compile time. The line

use Foo qw/bar baz/;

is identical to

BEGIN { require Foo; import Foo qw/bar baz/; }

$x = 0; print "X defined\n" if defined $x; # prints print "Y defined\n" if defined $y; # does not print
 * 1) returns true, if argument is not undef

eval('$a = 30; $b = 40;'); print $a, $b;

$x = 5; print "x = $x\n"; # 5 {  local $x = 10; print "x = $x\n"; # 10 } print "x = $x\n"; # 5
 * 1) assigns temporary value to global variable for duration of lexical scope

$x = 5; # refers to $main::x {  my $x = 10; print "x = $x\n"; # the lexical - 10 print "main's x = $main::x\n" # the global - 5 } print "x = $x\n"; # the global, because no lexical in scope - 5
 * 1) creates new lexical (ie, not global) variable

while ($k, $v = each %h) { print "$k = $v\n"; last if ($i++ == 2); } reset %h
 * 1) resets hash's internal pointer, to affect lists returned by each
 * 1) if another each done here, $k,$v will pick up where they left off.
 * 1) now each will restart from the beginning.

@sizes = (scalar @foo, scalar @bar);
 * 1) forces scalar context on an array
 * 1) creates a list of the sizes of @foo and @bar, rather than the elements in @foo and @bar

$x = 5; undef $x; print "x = $x\n" if defined $x; # does not print
 * 1) undefines an existing variable

sub fctn { my @vals = (5..10); if (wantarray) { return @vals; } elsif (defined wantarray) { return $vals[0]; } else { warn "Warning! fctn called in void context!\n"; } }
 * 1) returns 'true', 'false', or undef if function that called it was called in list, scalar, or void context, respectively.

my $pid = fork;
 * 1) clones the current process, returning 0 if clone, and the process id of the clone if the parent

if ($pid == 0) { print "I am a copy of the original\n"; } elsif ($pid == -1) { print "I can't create a clone for some reason!\n"; } else { print "I am the original, my clone has a process id of $pid\n"; }

Classes and objects
See also Perl Objects

Converts a timestamp to GMT.

@TimeParts = gmtime; @TimeParts = gmtime($Time);

$Seconds   = $TimeParts[0]; # 0-59 $Minutes   = $TimeParts[1]; # 0-59 $Hours     = $TimeParts[2]; # 0-23 $DayOfMonth = $TimeParts[3]; # 1-31 $Month     = $TimeParts[4]; # 0-11 $Year      = $TimeParts[5]; # Years since 1900 $DayOfWeek = $TimeParts[6]; # 0:Sun 1:Mon 2:Tue 3:Wed 4:Thu 5:Fri 6:Sat $DayOfYear = $TimeParts[7]; # 1-366

Converts a timestamp to local time.

@TimeParts = localtime; @TimeParts = localtime($Time);

$Seconds   = $TimeParts[0]; # 0-59 $Minutes   = $TimeParts[1]; # 0-59 $Hours     = $TimeParts[2]; # 0-23 $DayOfMonth = $TimeParts[3]; # 1-31 $Month     = $TimeParts[4]; # 0-11 $Year      = $TimeParts[5]; # Years since 1900 $DayOfWeek = $TimeParts[6]; # 0:Sun 1:Mon 2:Tue 3:Wed 4:Thu 5:Fri 6:Sat $DayOfYear = $TimeParts[7]; # 1-366

$Time = time;

Returns number of seconds since an epoch (that is system-dependent, but may be 1970-01-01).

See also ../Time::Hires/

@CPUTimes = times; $UserTimeForProcess   = $CPUTimes[0]; $SystemTimeForProcess = $CPUTimes[1]; $UserTimeForChildren  = $CPUTimes[2]; $SystemTimeForChildren = $CPUTimes[3];

Functions that reverse each other
Some functions in perl reverse or otherwise cancel the effect of each other, so running a string through both of them will produce the same output as the input, for example

print ord(chr(1));

will echo  to standard output,

will convert a character to its number in the character set, while  will convert a number to its corresponding character, therefore

in the same way that $$\sqrt{x^2} = x$$ and $$\sqrt{x}^2 = x$$ in Mathematics (assuming x is non-negative),  and   in Perl.

List of functions that reverse each other:

 * and
 * and
 * and
 * and
 * and
 * and

title: Perl Programming/Function reference


text:
Talk:XHTML

On Merging
I do not think that the XHTML section of the XML Wikibook is extensive enough (or indeed capable of being extensive enough) to cover XHTML sufficiently. The section on media types, for example, does not do the subject justice. There is no mention whatsoever of  dispite the fact that it is the most cross compatible media type nor is there any mention of the pitfalls of serving XHTML as HTML. Conversely, our section on media types includes a more comprehensive overview of the pros and cons of each and even includes a table which illustrates the how each layout engine interprets each media type. This is the kind of depth that a stand-alone XHTML book can reach with other XHTML subjects like semantic layouts, modularization, DTDs, HTML conversion, deprecated elements, namespaces, and syntax.

Yes the XML module is better written and organized, and yes, it does do a good job giving an overview of what XHTML is, but that doesn't mean that we can't match its quality while offering a more complete steadily-paced tutorial. In summation, I vote for sufficiency over efficiency.

Nadamt 23:21, 31 December 2006 (UTC)

Untitled
You don't get XHTML by just putting the right doctype in a HTML document and make sure it's formatted according XML standards [This is not true: an XHTML document is an XHTML document regardless of what common browsers do with it - RFC 2854 makes it clear that some XHTML documents can be served as text/html]. If the server sends it as text/html, it is still interpreted as HTML. The contenttype should be "application/xhtml+xml". And if you use that, many browser are in trouble.

http://hixie.ch/advocacy/xhtml

Try this in IE6: http://devedge.netscape.com/viewsource/2003/xhtml-style-script/examples/example-6.xhtml (one of the rare real XHTML pages on the web).

Since about 90% of the internet users still uses IE as a browser, it is not realistic to create real XHTML webpages for common purpose. And it's going to be that way for a couple of years. If you search on google for this webpage (for example this page: http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=Example+6+-+XHTML+1.0+Strict+as+application%2Fxhtml%2Bxml&btnG=Search), then you'll see the google says "File Format: Unrecognized".

Technically correct but as both IE6 (and IE5?) and Firefox display XHTML sent as text/html fine, why create pages using older standards which teach bad practices just so you can be correct with the contenttype?

Organization is a bit off
As of now, I just don't like how the page here is set up. It seems like we're diving into the core XHTML tech too soon and not giving a real introduction to it. We just have a short synopsis, and bam! we've put tags and elements before their faces. Here's how I'd like to see it:

 * Introduction to XHTML
 * Purpose
 * History
 * Differences from HTML /* jump here if they already know HTML and just want a diff */
 * Syntax
 * How XML Works /* if they want to understand XHTML, first they have to get XML */
 * Basic Tags /* does this belong here? -- html, head, title, body, p, br */
 * Your First XHTML Document
 * Code Listing /* not a real section, just the listing */
 * Understanding the Elements
 * Links and the id Attribute

etc.

This way, I think there'll be less of a learning curve. (Oh, and the application/xhtml+xml thing too.) [ alerante | “” 13:13, 22 Jun 2004 (UTC) ]

XHTML in IE is broken, so we should create another page.
XHTML in IE is broken.

XHTML in Mozilla and Firefox is properly rendered as XHTML. Just 'View info' to see that it works.

Therefore, instead of changing this XHTML page to deal with IE's quirky interpretation of XHTML.

I propose we have a second page dealing with IE's quirks regarding XHTML.

If I write an article about unleaded gasoline, but your car does not function with unleaded gasoline, then we should write an article about your car. We should NOT delete a page which correctly describes unleaded gasoline.

 * IE quirks are definitely outside the scope of an article on standardized XHTML. There are a few problems here, honestly.  One is that IE is arguably bad/terrible/horrendous software and the other is that W3C's standards are arguably byzantine and unnecessarily complicated.  However, if the focus of this wikibook is XHTML, it should adhere to XHTML standards which are established by W3C, not by Microsoft.  If the book is not about standardized XHTML, don't call it a book on standardized XHTML.  I think this is a question of scope, not protocol.  --banzaimonkey

Cascading Style Sheets
If we're going to do a proper wikibook on XHTML, I suspect that it will need a sister volume on Cascading Style Sheets. Right now, it's hideously under-developed.

--Noah 17:17, 30 Jul 2004 (UTC)

related wikibooks

 * GET
 * CSS Programming

web hosts to practice with
Learning all the tags and viewing local files with a web browser is nice and everything, but the whole point is to put stuff on the Internet.

I think it would be nice to explain how to get these ".html" files from your personal computer onto the Internet.

Is there some other wikibook that talks about uploading to a web server ?

There are lots of places to get free web hosting; would it be appropriate to list a few dozen in this wikibook? (Is there a more appropriate wikibook?)

--DavidCary 05:49, 25 Mar 2005 (UTC)

 * Free Website Hosting
 * free web site providers
 * Free Website Providers for Business Webpages
 * Free Website Hosting

Merging this page with XHTML (XML)
As the note describes at the beginning of the page, I think a merging is necessary.

However, I'd have to say, overwhelmingly, that the XHTML (XML) page is much much better. It is far more thorough and descriptive. Perhaps what needs to be done is to look this over and compare it with the other page, finding any bits worthy of inclusion that cannot be found at XHTML (XML) and redirect this sucker over.

EDIT: 4/21/06 XML and XHTML are actually 2 different things. XML is used by such programs as MSN Messenger to store logs, while XHTML is more of an HTML encoding standard than an entirely different language. As such, merging this page wouldn't do much good, unless you want to link it through there.

207.114.130.130 22:59, 21 April 2006 (UTC)Web Designer

Confusion betwen tags, elements and element types
This tutorial uses the word "tag" where it should read "element" or "element type" instead. One example is stating that XHTML documents are enclosed in an tag. This is not the case.

Bad practices
I think it's rather bad that this module teaches bad practices. I've only read the first page, but I noticed this:
 * Links like "click here" isn't any good at all. Rather than "Click here to go to Wikibooks.org", the module should rather say "Go to Wikibooks.org".
 * Missing alt-text when introducing . One'd better get it right from the beginning!

"This document, although it works in 99% of XHTML browsers, isn't actually valid because it lacks a doctype."
99%? Where was this statistic pulled from? The same place that the rabbit was?

Mozilla Standards Compliance
I changed "completely" standards compliant, to "mostly" standards compliant. Mozilla is good, but it's not the best. Let's keep things objective here ;-).

59.92.142.69 13:58, 28 February 2006 (UTC)-Rahul.

 * While on the subject of objectivity, why are "we" reccomending only Mozilla Firefox? Are not there other browsers which properly render XHTML?  Don't they deserve at least a mention?

 * Nadamt 20:15, 8 December 2006 (UTC)

In XHTML 1.0 Strict You SHOULD NOT use the 'b' and 'i' element
Please, correct markup tags, 'b' and 'i' have be retired of your mental-dictionary.

 * b was tranformed to 'strong'
 * i was transformed to 'em'

Token / 200.158.231.244 09:44, 16 November 2006 (UTC)

Tags and Elements
The "Tags and Elements" section should be rewritten. Elements are semantic structuring units; a valid XHTML document is composed of a hierarchy of elements conforming to an XHTML DTD. Tags are the syntax used to identify elements. An element has a name identifying its type, a start tag, possibly optional attributes, possibly optional content, and an end tag. The DTD specifies, for each element type, which attributes are allowed and required, and the content that is allowed. Attributes are specified in the start tag. An element with no content may start and end with the same tag (e.g. <br />). (Although for browser compatibility some elements like script should have explicit start and end tags.)

Adding Some Pages
I added some pages, of course they a bit under developed but give it time. I agree that the page needs some organisation. I'll attempted this. Also some pictures would be nice (coding etc). --Grich 01:51, 1 March 2007 (UTC)

This book
I think that this book needs a complete re-write. It is written as if it expects the reader to be a professional in HTML. This book has to assume that the reader has never even heard of HTML and does not have any knowledge of this web stuff what-so-ever. --S.Örvarr.S 00:31, 26 July 2007 (UTC)

title: Talk:XHTML


text:
Physics Study Guide/Optics

Light
Light is that range of electromagnetic energy that is visible to the human eye, the visible colors. The optical radiation includes not only the visible range, but a broader range of invisible electromagnetic radiation that could be influenced in its radiation behavior in a similar way as the visible radiation, but needs often other transmitters or receivers for this radiation. Dependent on the kind of experimental question light - optical radiation behaves as a wave or a particle named lightwave or photon. The birth or death of photons needs electrons - electromagnetic charges, that change their energy.

The speed of light is fastest in the vacuum.

In a wave we have to distinguish between the speed of transport of energy or the speed of the transport of on phase state of a wave of a defined frequency. In vacuum the speed of waves of any photon energy - wavelength is the same, but the transmission speed through material is dependent on wavelength - photon energy. At the time the measurement of the speed of light in vacuum reached the uncertainty of the unit of length, the meter, this basic unit got in 1960 a new definition, based on the unit of time. Taking the best known measurement values it was defined without any uncertainties of length, that the speed of light is 299,792,458 meters per second. For this reason the only uncertainty in the speed of light is the uncertainty of the realization of the unit of time, the second. (If you like to get the standard of length, cooperate with the watchmaker). However, when electromagnetic radiation enters a medium with refractive index, $$n$$, its speed would become
 * $$c_n=\frac{c}{n}$$

where $$c_n$$ is the speed of light in the medium.

Refraction
Refraction occurs when light travels from one medium into another (i.e. from air into water). Refraction is the changing of direction of light due to the changing speed of light. Refraction occurs toward the normal when light travels from a medium into a denser medium. Example when light travels from air into a block of glass, light is refracted towards the normal. The ratio between the sine of the angle of the incident ray and sine of the angle of the refracted ray is the same as the ratios of the indexes of refraction.

This is known as Snell's Law - an easy way to remember this is that 'Snell' is 'lens' backwards.

Focal length

 * $$f$$ is the focal length.
 * $$f$$ is negative in convex mirror and concave lens.
 * $$f$$ is positive in concave mirror and convex lens.
 * $$d_i$$ is the distance from the image to the mirror or lens
 * For a mirror, it is positive if the image appears in front of the mirror. It is negative if the image appears behind.
 * For a lens, it is positive if the image appears on the opposite side of the lens as the light source. It is negative if the image appears on the same side of the lens as the light source.
 * $$d_o$$ is the distance from the object to the mirror or the lens (always positive). The only case, when it is negative, is the case, when you don't have a real object, but you do have an imaginary object - a converging set of rays from another optical system.
 * an easy way to remember the formula is to memorize "if I Do I Die", which stands for $$1/f = 1/d_0 + 1/d_i$$

Magnification

 * $$M$$ is the magnification.
 * If it is positive the image is upright
 * If it is negative the image is inverted
 * $$h_i$$ is the image height.
 * $$h_o$$ is the object height.
 * $$d_i$$ is the distance from the image to the mirror or lens (also often $$v$$)
 * For a mirror, it is positive if the image appears in front of the mirror. It is negative if the image appears behind.
 * For a lens, it is positive if the image appears on the opposite side of the lens as the light source. It is negative if the image appears on the same side of the lens as the light source.
 * $$d_o$$ is the distance from the object to the mirror or lens (also often $$u$$)

title: Physics Study Guide/Optics


text:
Perl Programming/Reference cards

 * /Database/
 * /File tests/
 * Perl functions
 * /Regular expressions/
 * /Time and date/

title: Perl Programming/Reference cards