Gov. Robert L. Ehrlich Jr. signed legislation yesterday that will give Maryland some of the nation's toughest laws against drivers under the influence of drugs and computer hackers who send unsolicited e-mail.

The pile of 125 bills -- signed on Ehrlich's final day for endorsing measures approved by the General Assembly -- also included a set of proposals to revamp the state's juvenile justice system by developing smaller, community-based detention centers and by tracking young offenders after their release.

A day earlier, the governor had announced that he would veto 16 bills, including a measure that would have raised corporate taxes to help tamp down tuition increases at Maryland's public colleges and universities.

That decision prompted university boosters to launch a drive to override the veto. "Unfortunately, the veto means another year of double-digit tuition hikes," said James C. Rosapepe, a member of the University System of Maryland Board of Regents. "The only answer now is for the legislature to override the veto. I hope they will."

Ehrlich said yesterday he disliked the bill because it would have mandated a level of spending for higher education. "Mandated spending is a bad idea," he said. "Mandated spending led us into almost a $2 billion deficit.''

The governor won praise for endorsing bills that would target computer spam and drugged drivers.

Frustrated that motorists impaired by drugs often go undetected by police, the governor signed a bill that requires a motorist who causes a fatal or serious accident to submit to a blood test if an officer requests one.

Currently, police request drug tests only if they suspect a motorist is impaired and that suspicion is then confirmed by an officer who is certified in "drug recognition," said Sgt. Thornnie Rouse, a spokesman for Maryland State Police.

"Now, we'll just test everyone" involved in a serious accident, Rouse said.

Keith S. Franz, a Baltimore lawyer who helped draft the legislation, said few states require such testing in accidents that don't result in fatalities. "This is going to provide a very powerful tool to the police and prosecutors in getting convictions," he said.

Franz represents Hilde Carter, 38, of , Conowingo, Md., whose 24-year-old son, Reg Riley, was struck and killed in 2001 while walking along a road.

Franz said the driver of that car acknowledged taking Percocet, a narcotic painkiller, but was not charged with driving while impaired because prosecutors could not prove he was high on the drug. The driver was convicted of manslaughter and sentenced to three years in prison, Franz said.

The anti-spam law Ehrlich signed yesterday, also viewed as one of the toughest in the country, will prohibit individuals, organizations and companies from sending bulk e-mail that falsifies or disguises the sender's identity, address or subject matter. It also is designed to snag those who infiltrate a legitimate service provider's system and use it without authority to distribute e-mail.

Violators will face prison terms of three to 10 years and fines of $5,000 to $25,000.

"I don't think it is something we will see day in and day out, but you will see a couple of high-profile prosecutions," said Del. Neil F. Quinter (D-Howard), a sponsor of the legislation.

Both measures will take effect Oct. 1.

Earlier in the day, Ehrlich used the Annapolis Harbor as a backdrop to sign legislation aimed at upgrading 66 wastewater treatment plants that now spill toxins into Chesapeake Bay.

The elaborately staged signing ceremony, washed in sunlight, with waving flags and an orchestra, was a sign of how important Ehrlich considers the measure in the context of his reelection effort.

Seated on the deck of the Pride of Baltimore II, a double-mast tall ship, Ehrlich said he was reminded of a time "before harmful pollutants put the health of the Chesapeake Bay in jeopardy."

With the legislation, which imposes a $2.50 monthly surcharge on sewer and septic users starting in January, the state will start down a path of meeting its commitment to cleaning up the bay, Ehrlich said.

Bay protection efforts may also get a boost from Ehrlich's decision to sign a bill strengthening the state's critical areas law, which had been weakened by recent court decisions.

The governor also endorsed an energy conservation bill requiring that 7.5 percent of Maryland's electricity come from alternative sources by 2014, despite reservations of some small-businesses owners it could drive up utility rates.

The bill clears the way for large windmill farms to be constructed in Western Maryland to harness power that will eventually be supplied to utilities.

House Minority Leader George C. Edwards (R-Garrett) said the legislation will boost the economy of Western Maryland and will reduce the state's dependence on traditional energy sources, such as oil and coal.

Ehrlich also signed a law aimed at upgrading 66 treatment plants.