[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

RE: [MacPerl] several dumb questions



I think you want:

      while(<YOURFILENAMEHERE>){
          if ($_ =~ /(a)bc(x)|$1de$2|$1fg$2|$1hi$2/){
               --Statements here
          }
      }

Brackets will only match an individual character within the brackets, not
groups of characters.

Not sure about the machine-name question.
         
_______________________________________________________________________________
_
From: hammond@u.Arizona.EDU on Wed, Oct 30, 1996 4:34 PM
Subject: [MacPerl] several dumb questions
To: Henrichs_Steve; mac-perl@iis.ee.ethz.ch

Hi.

I have several questions which I'm sure are quite dumb.

One is not specific to MacPerl. This can be best explained with an example.
Imagine I want to search through a file for the following strings:
        abcx
        adex
        afgx
        ahix
The following does NOT seem to work:
        /a[(bc)(de)(fg)(hi)]x/
Is there an elegant way to do this?

The second question is specific to MacPerl I think. I simply want to find a
way to return the particular mac's name. For example, my office mac is
called something like "Mike's office Mac". How can I get MacPerl to find
this and return it as a string?

mike h.

********************************************************************

PLEASE DIRECT ALL EMAIL TO: hammond@u.arizona.edu

The following address will cease to work shortly: hammond@ccit.arizona.edu

Michael Hammond
Department of Linguistics
University of Arizona
Tucson, AZ 85721

phone: (520) 621-5759, 621-6897
fax: (520) 626-9014
email: hammond@u.arizona.edu
www: http://aruba.ccit.arizona.edu/~hammond