W
William
input file - dummylist.txt:
|ZZ_JEN|1|0|0|0|[email protected]
expected output:
6
ZZ_JEN
current output:
35
Z
code in question:
#!/usr/bin/perl -w
use strict;
my $dummy_list = "/mkapp/webapps/mxrt-cgi/upload_vol/dummylist.txt";
open ( DUMMY_FD , $dummy_list ) || die "Cannot open file $dummy_list\n";
my @lines = <DUMMY_FD>;
foreach my $currentLine ( @lines ) {
my @instrumentEntries = ( split(/|/, $currentLine) );
my $numEntries = @instrumentEntries;
print $numEntries . "\n";
print $instrumentEntries[1] . "\n";
}
close ( DUMMY_FD );
for the line
my @instrumentEntries = ( split(/|/, $currentLine) );
what is the correct way to split $currentLine of the input file?
P.S. i already checked perldoc -f split and perldoc -q split.
|ZZ_JEN|1|0|0|0|[email protected]
expected output:
6
ZZ_JEN
current output:
35
Z
code in question:
#!/usr/bin/perl -w
use strict;
my $dummy_list = "/mkapp/webapps/mxrt-cgi/upload_vol/dummylist.txt";
open ( DUMMY_FD , $dummy_list ) || die "Cannot open file $dummy_list\n";
my @lines = <DUMMY_FD>;
foreach my $currentLine ( @lines ) {
my @instrumentEntries = ( split(/|/, $currentLine) );
my $numEntries = @instrumentEntries;
print $numEntries . "\n";
print $instrumentEntries[1] . "\n";
}
close ( DUMMY_FD );
for the line
my @instrumentEntries = ( split(/|/, $currentLine) );
what is the correct way to split $currentLine of the input file?
P.S. i already checked perldoc -f split and perldoc -q split.