#! /usr/bin/perl use strict; use warnings; use Data::Dumper; my $file = './test.txt'; my @array; { local $/ = "\nlevel"; open(FILE,"<$file") or die $!; while(my $entry = <FILE>){ chomp $entry; $entry = 'level'.$entry unless($entry =~ /^level/); push(@array,$entry); } } print Dumper(\@array);
In reply to Re: Regular expression match in file
by reneeb
in thread Regular expression match in file
by perlsen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |