invaderzard has asked for the wisdom of the Perl Monks concerning the following question:
use Modern::Perl open trained , 'D://ARP//libsvm-3.12//families//antioxidant//training. +scale'; open predict , 'D://ARP//libsvm-3.12//families//antioxidant//testing.s +cale'; my $counter = 0; while (<trained>) { my $train = $_; while (<predict>) { #print $_; my $predict = $1; if ($train = $predict) { #print $train; $counter = $counter + 1 } } } print $counter;
Sup guys. There's something that I need to clarify. for the line "my $predict = $1;", i want to define it as the current line of <predict> in the while function. I tried $_ and it gave me the line from <trained,> but when I tried $1 it was initialized.
What should I do to get the line from <predict>?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Some Basic Help.
by nemesdani (Friar) on Sep 24, 2012 at 07:57 UTC | |
Re: Some Basic Help.
by kcott (Archbishop) on Sep 24, 2012 at 08:15 UTC | |
Re: Some Basic Help.
by Jenda (Abbot) on Sep 24, 2012 at 09:01 UTC | |
by invaderzard (Acolyte) on Sep 25, 2012 at 07:14 UTC | |
by Jenda (Abbot) on Sep 25, 2012 at 08:06 UTC | |
by invaderzard (Acolyte) on Sep 25, 2012 at 08:35 UTC | |
by Jenda (Abbot) on Sep 25, 2012 at 13:12 UTC | |
| |
Re: Some Basic Help.
by 2teez (Vicar) on Sep 24, 2012 at 09:13 UTC | |
Re: Some Basic Help.
by Anonymous Monk on Sep 24, 2012 at 08:59 UTC |