Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Perl: How to perfectly match specific data between two files and do comparison?

by jwkrahn (Monsignor)
on Jul 24, 2013 at 02:16 UTC ( #1045983=note: print w/ replies, xml ) Need Help??


in reply to Perl: How to perfectly match specific data between two files and do comparison?

use warning;

Should be:

use warnings;
$ncc = 0; $pc = 0; $fc = 0;

Should be:

my $ncc = 0; my $pc = 0; my $fc = 0;
sub fileA_ext() {

Should be:

sub fileA_ext {
while (@array = <FileA>) {

Should be:

my @array = <FileA>;
foreach $line(@array) {

Should be:

foreach my $line ( @array ) {
$name1 = "$1"; $score1 = "$12";

Should be:

$name1 = $1; $score1 = $12;
foreach $line (@tmp1) {

Should be:

foreach my $line ( @tmp1 ) {
my $name2 = "$1"; substr($name2, -13) = ''; my $score2 = "$12";

Should be:

my $name2 = $1; substr($name2, -13) = ''; my $score2 = $12;
sub FileB_ext() {

Should be:

sub FileB_ext {
while (@array = <FileB>) {

Should be:

my @array = <FileB>;
foreach $line(@array) {

Should be:

foreach my $line ( @array ) {
my $name3 = "$1"; my $score3 = "$12";

Should be:

my $name3 = $1; my $score3 = $12;
foreach $line (@tmp2) {

Should be:

foreach my $line ( @tmp2 ) {
my $name4 = "$1"; substr($name4, -13) = ''; my $score4 = "$12";

Should be:

my $name4 = $1; substr($name4, -13) = ''; my $score4 = $12;
sub check() {

Should be:

sub check {
foreach $data1 (@arr1) {

Should be:

foreach my $data1 ( @arr1 ) {
my $ep1 = "$1"; my $s1 = "$2";

Should be:

my $ep1 = $1; my $s1 = $2;
foreach $data2 (@arr2) {

Should be:

foreach my $data2 ( @arr2 ) {
my $ep2 = "$1"; my $s2 = "$2";

Should be:

my $ep2 = $1; my $s2 = $2;
if ( $ep1 eq $ep2 && $s1 =~ m/-/g) {

Should be:

if ( $ep1 eq $ep2 && $s1 =~ m/-/) {
if ( $ep1 eq $ep2 && $s1 !~ m/-/g && $s1 > 50 && $ +s2 > 40) {

Should be:

if ( $ep1 eq $ep2 && $s1 !~ m/-/ && $s1 > 50 && $s +2 > 40) {
if ( $ep1 eq $ep2 && $s1 !~ m/-/g && $s1 < 50 && $ +s2 < 40) {

Should be:

if ( $ep1 eq $ep2 && $s1 !~ m/-/ && $s1 < 50 && $s +2 < 40) {


Comment on Re: Perl: How to perfectly match specific data between two files and do comparison?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-05 09:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (61 votes), past polls