IN 1543 JAPAN was in the grip of a power struggle. The Ashikaga shogunate, entrenched for over a century, could no longer control the many fiefdoms belonging to powerful and ambitious lords. Army clashed with army; alliances shifted and reshifted. To the north were the Uesugis, to the east, the Jojos, andin the center between Kanto and Kyoto, the rising Oda and Tokugawa clans. On August 25 of that year at Tanegashima (an island in southern Japan), typhoon blew ashore a Chinese junklike ship. On board were three Portugese sailors, a crew of some 100 Chinese - and two rifles. That day, Western "civilization" arrived, appropriately in a storm.

The lord of Tanegashima, after watching one of the Portuguese shoot a duck, immediately saw the military significance of the gun. He purchased the two harquebuses for one thousand tales each in gold and ordered his chief swordsmith to duplicate them. Within a year 10 guns were made and, according to Noel Perrin, "within a decade, gunsmiths all over Japan were making the new weapon in quantity.... By 1560, the use of firearms in large battles had begun...and fifteen years after that they were the decisive weapon in one of the great battles of Japanese history." That was at Nagashino where Oda Nabunaga, who later became the most powerful lord of Japan, overwhelmed the Takedas of the east. By using foot soldiers, armed with 3000 guns and shooting in alternating rows of three, his army mowed down thousand of enemy samurai on horseback.

"All this represents what would now be called a technological breakthrough," writes Perrin. But, amazingly, Japan decided to abandon the gun and return to the sword. "It chose to do this and it succeeded. There is no exact analogy to the world's present dilemma about nuclear weapons, but there is enough of one of that the story deserves to be far better known," he says.

According to Perrin, the process of reversion was gradual one, spanning more than two centuries. It started soon after the overshelming success of the gun at Nagashino. The samural realized that their status as killed swordsmen had diminished - even a lowly peasant, armed with one of these matchlocks, could kill the noblest, most heroic warrior, and without even an introduction. In the past, before any sword-to-sword fight, a samurai would bark out his names and, if the opponent allowed it, boast of past accomplishments. Perrin presents an example from the 13th-century epic Tale of the Heike: "In a mighty voice he named his name, saying, "You have long heard of me, now take a good look. I am Tsutsui no Jomo Meishu, known to all of Mii Temple as a warrior worth a thousand men." Only then did he begin to fight. With a gun it was much more practical to shoot first and introduce yourself later.

After the battle of Sekigahara in 1600, Tokugawa Ieyasu completed the task (begun by Oda Nobunaga, continued by his successor Toyotomi Hideyoshi) of uniting Japan under one rule. The country remained divided into fiefdoms but their lords all pledged obeisance to the supreme authority of Shotgun Ieyasu. To consolidate his power further, Leyasu, in 1607, forbade the manufacture of firearms and powder except at Nagahama and appointed a Commissioner of Guns to enforce his edict. (His predecessor, Hideyoshi, had begun the task of gun control through a wily campaign that sought "donations" of guns and swoards to be turned into statues of the Buddha.) Through a series of ingenious maneuvers, Ieyasu was able to check the rise of still-hostile fiefdoms and finally, again in the interests of security, closed the nation to the outside world. Thus, he was able to establish a dynasty which maintained peace throughout Japan for two-and-a-half centuries.

Perrin's message, that it is sometimes better to turn back the clock, to revert to an earlier technology, is morally convincing. What is not convincing is the claim that Japan did give up the gun and actually reverted to the sword. More accurately, Tokugawa Japan succeeded in controlling the development and distribution of guns. If guns were permitted to proliferate among unfriendly fiefdoms or rebellious peasants, they would jeopardize the power of the shogunate. Actually, Tokugawa Japan continued to manufacture guns and many of the samurai continued to practice with them. What happened was what happens to any nation whose people live in isolated peace - they lacked the motivation to improve a weapon they did not use. But they did not forget.

In 1840, Takashima Shuhan, realizing that his port town Nagasaki was incapable of defense against foreign warships, such as those of the British which had defeated the Chinese that year, decided that a technological leap was necessary. He began buying weapons from the Dutch; then, after learning to read and translate Dutch texts, he plunged into the study of gun manufacturing and military tactics. His sentiment and learning gradually spread to Edo (now Tokyo), the capital of the shoguante.

In 1853, Commodore Matthew Perry arrived with four large black ships equipped with 64-pound cannons. The Japanese watched helplessly as the small fleet sailed into Edo Bay. By that time, many realized that isolation from the rest of the world was impossible. A movement began to topple the ineffective feudal regime, to unite under the emperor and to build an army strong enough to repel the foreign invasion. Under such pressure, Shogun Keiki restored power to the emperor in 1867 and thus ended the Tokugawa reign.

Noel Perrin's crisp prose is already familiar to readers of The New Yorker and to those who have enjoyed his books on farming an d sugar-making. He has set down a fascinating story, one which has long been inaccessible to the West Giving Up the Gun, written for a general readership, is thoroughly enjoyable - filled with marvelous anecdotes and illustration. CAPTION: Illustration, no caption, FROM "GIVING UP THE GUN"