Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Mactching arrays and reg. exp.

by eak (Monk)
on Aug 03, 2000 at 19:04 UTC ( #25989=note: print w/replies, xml ) Need Help??


in reply to Mactching arrays and reg. exp.

HEAD
  .
  .
  .
TAIL
and ends with suppose 
America 331
If your file looked something like what is above, you could do the following:
my $read = 1; my @output; foreach my $line (@array){ if($line =~ /HEAD/){ $read=0; } elsif($line =~ /TAIl/){ $read=1; } push @output, $line if $read; }
--eric

Replies are listed 'Best First'.
RE: Re: Matching arrays and reg. exp.
by davorg (Chancellor) on Aug 03, 2000 at 19:14 UTC
      Thank you guys, but I am trying to match the arrays here. If I want define 7 then it should recognize array 7 of another file and print some thing like
      define 7 thankx(#came from another file)
      . I couldn't find anywhere.
      Thankx.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://25989]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2022-01-28 23:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?