ZALLHER, Albania (AP) _ Dozens of goats ran in panic as an Albanian Army platoon blasted an ''enemy'' mountain hideout with Kalashnikov rifle fire on Thursday. They were showing Defense Secretary William Perry how they'd defend their mountainous nation should the Yugoslav war come their way.

''This makes me think I'm visiting a Ranger regiment at Fort Benning, Ga.,'' Perry told the soldiers, who'd greeted him with a grunted ''uuu-rah 3/8''

Perry came to this spartan training base located in the Dajti mountain range outside the capital of Tirana to assess what kind of help the Pentagon might provide a nation that can only afford to pay its soldiers about $1 a month.

The soldiers put on a full display of their guerrilla-style combat prowess, filling the valley with crackling gunfire and smokebombs. As Perry strode down the hill from his observation site, several bushes at his feet suddenly plopped over and soldiers popped out of the ground, jack-in-the-box style. The secretary laughed as he realized the young men pointing guns had been hidden out of his sight for half an hour or more.

Other young men crawled under barbed wire, scurried along rope bridges hung overhead in the trees, or punched away at each other with six-foot sticks or boxing gloves.

''We can't keep our soldiers for long,'' the unit's commander, Maj. Agron Hima, told Perry as they toured a newly painted and scrubbed barracks used by 620 trainees. Every Albanian of 18 to 20 years is required to serve, but they also are eager to finish their 15-month service to try to get better-paying jobs, perhaps even outside this impoverished country.

Hima, dressed in a U.S. Army camouflage uniform with the Ranger motto ''Follow Me'' on his shoulder, briefed Perry in fluent English about the training methods he'd devised.

The Albanian officer had polished his language skills during his own nine- week training course with the Rangers at Fort Benning. The school's survival and combat training is considered among the toughest in the U.S. military, with only 40 percent of its starters completing the course, according to Army officers accompanying Perry.

Lt. Col. Pellumb Qazimi, who oversees such basic training for the Albanian military's general staff, said contact with U.S. military forces ''is a very good asset'' because it is teaching a military that two years ago did not even have a rank system, having been patterned on the communist Chinese forces. The Americans are helping the Albanians understand how to organize a military force and make use of such things as a noncommissioned officer corps, which is the backbone of most Western military armies.

''Now it is much better,'' Qazimi said, referring to the two years since the collapse of Albania's communist system.

Asked if his troops are concerned about a potential spillover of the war in the former Yugoslavia, Qazimi said Albania has had concerns about Serbian treatment of Albanians who live in the Serbian province of Kosovo.

''But they have made no actions against our country, so it is difficult to say that they are our enemy. Now, it is better just to be ready, to improve our troop readiness, '' he said.

The war interfered with Perry's planned visit to Sarajevo. He canceled after three planes from the United Nations airlift were hit by bullets, closing the Sarajevo airport.

Perry instead will travel to Zagreb on Friday where he is expected to meet with Croatian officials and possibly representatives of the United Nations peacekeeping mission in Yugoslavia.

In talks with Albanian officials, Perry discussed helping provide excess U.S. military articles ranging from boots to ambulances.

Even more important, Perry and other U.S. officials said, was helping the Albanian military learn how to organize itself under civilian control, and teaching basic military tactics.

The defense secretary said that of all former Communist states, Albania deserves the highest priority for U.S. support because of the ''dedication to democratic reform'' displayed by its people, as well as their political and military leadership.

''Obviously, they have much farther to go, but they are off to a very good beginning,'' Perry said.