Exhibit 5.1


FOLEY HOAG
ATTORNEYS AT LAW

January 2, 2002


PRI Automation, Inc.
805 Middlesex Turnpike
Billerica, Massachusetts  01821

       Re:  PRI Automation, Inc. 1997 Non-Incentive Stock Option Plan
            PRI Automation, Inc. 2000 Employee Stock Purchase Plan

Gentlemen:

       We are familiar with the Registration Statement on Form S-8 (the
"Registration Statement") to be filed by PRI Automation, Inc., a Massachusetts
corporation (the "Company"), with the Securities and Exchange Commission (the
"Commission") under the Securities Act of 1933, as amended (the "Securities
Act"), relating to the offering by the Company of up to 1,800,000 shares (the
"Shares") of its common stock, par value $0.01 per share, issuable upon exercise
of options pursuant to the Company's 1997 Non-Incentive Stock Option Plan and
2000 Employee Stock Purchase Plan (the "Plans").

       In arriving at the opinion expressed below, we have examined and relied
on the articles of organization of the Company, as amended to date, the by-laws
of the Company, as amended to date, the records of meetings and consents of the
Board of Directors and stockholders of the Company provided to us by the
Company, the Registration Statement and the Plans.

       In addition, we have examined and relied on the originals or copies
certified or otherwise identified to our satisfaction of all such corporate
records of the Company and such other instruments and other certificates of
public officials, officers and representatives of the Company and such other
persons, and we have made such examination of law, as we have deemed appropriate
as a basis for the opinion expressed below. This opinion is limited solely to
the laws of The Commonwealth of Massachusetts as applied by courts located in
Massachusetts.

       We assume that all Shares issued upon exercise of options pursuant to the
Plans are issued in accordance with the terms of the Plans and that the purchase
price of the Shares is valid consideration.

       Based upon and subject to the foregoing, it is our opinion that the
Shares, when issued and delivered upon the exercise of options duly granted
pursuant to the Plans and against the receipt of the purchase price therefor,
will be validly issued, fully paid and nonassessable.





PRI Automation, Inc.
January 2, 2002
Page 2


       This opinion is to be used only in connection with the offer and sale of
the Shares while the Registration Statement is in effect.

       Please note that we are opining only as to the matters expressly set
forth herein, and no opinion should be inferred as to any other matters.

       We hereby consent to the filing of this opinion as an exhibit to the
Registration Statement in accordance with the requirements of Item 601(b)(5) of
Regulation S-K under the Securities Act and to the reference to our firm under
the caption, "Interests of Named Experts and Counsel." In giving such consent,
we do not admit that we are in the category of persons whose consent is required
under Section 7 of the Securities Act or the rules and regulations of the
Commission.

                                         FOLEY, HOAG & ELIOT LLP


                                         By: /s/ ROBERT L. BIRNBAUM
                                            -----------------------------------
                                            a Partner