As a beginner in perl, I am not sure how to do this. The file I want tosplit is pwm.pl and the contents are: .4 .01 .1 .9
.1 .03 .3 .1
.49 .95 .4 .1
.01 .01 .2 .3
I want to split the numbers separately from each other. I have got a few parts that are a HOT MESS which im aware is not close to working. Tips? Help?
#! usr/bin/perl
use strict;
use warnings;
retrievingData();
sub retrievingData {
open(MYINPUTFILE, "<pwm.pl");
my(@lines) = <MYINPUTFILE>;
my($line);
foreach $line (@lines)
{
print "$line";
}
close(MYINPUTFILE);
}
observedProbability();
sub observedProbability {
my %observed;
my $line;
my $i;
my @file;
my $alllines=(<$INPUT>);
$observed{"A"}=[];
$observed{"C"}=[];
$observed{"G"}=[];
$observed{"T"}=[];
@elements=split(/\s+/,$alllines[0]);
foreach $i(@elements);
for (my $i=0; $i<@file; $i++){}
print "$i\n";
.1 .03 .3 .1
.49 .95 .4 .1
.01 .01 .2 .3
I want to split the numbers separately from each other. I have got a few parts that are a HOT MESS which im aware is not close to working. Tips? Help?
#! usr/bin/perl
use strict;
use warnings;
retrievingData();
sub retrievingData {
open(MYINPUTFILE, "<pwm.pl");
my(@lines) = <MYINPUTFILE>;
my($line);
foreach $line (@lines)
{
print "$line";
}
close(MYINPUTFILE);
}
observedProbability();
sub observedProbability {
my %observed;
my $line;
my $i;
my @file;
my $alllines=(<$INPUT>);
$observed{"A"}=[];
$observed{"C"}=[];
$observed{"G"}=[];
$observed{"T"}=[];
@elements=split(/\s+/,$alllines[0]);
foreach $i(@elements);
for (my $i=0; $i<@file; $i++){}
print "$i\n";