in reply to strange thing in perl's eval function(solved))
There are several things that are not efficient in your script as shown in your OP.
while (my $line=<DATA>) { chomp($line);..
#file: test.pl #!/usr/bin/perl -w use strict; use v5.10; my $pattern = qr/test/; while (my $line=<DATA>) { chomp($line); $line =~ /($pattern)/p; my $result = $line. ' => matched:'.${^MATCH}.$/; print $result; } __DATA__ test1a.txt test1b.txt test1c.txt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: strange thing in perl's eval function
by a369 (Initiate) on Jun 07, 2013 at 07:59 UTC |