Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How to store multiples lines/records in a array

by toolic (Chancellor)
on Jun 28, 2013 at 17:13 UTC ( #1041291=note: print w/ replies, xml ) Need Help??


in reply to How to store multiples lines/records in a array

It doesn't output anything for me because you didn't use print. Why do you split on commas when your input has no commas? Show us your expected output.

Tips #1 and 2 from the Basic debugging checklist


Comment on Re: How to store multiples lines/records in a array
Re^2: How to store multiples lines/records in a array
by Perlseeker_1 (Acolyte) on Jun 28, 2013 at 17:32 UTC
    Hi,

    Please check the input below:

    ABC_TEK,12,DFE_YJK,24,JKL_GHY,26,LKJ_UYH,29,GHK_YTH,23,GHS_JSF,34, FHK_THE,25,SHJ_TRE,26,HSJ_TEH,39,AHJ_EGH,56,SGH_HEJ,42,HGE_THE,46, HEJ_EJJ,67,JLE_EJK,89,EHJ_EJK,78,EHJ_IKL,68,EHJ_EJK,57,EJH_EKL,69,

    I am tired with code shown below (subroutine-data):

    data{ my @values; my $table; open (F, "Filename") || die ("Could not open $Filename!"); while (my $line = <F>) { chomp($line); push (@values,split(',', $line));} close (F); $table .= "<table border=1>"; for (my $i=1;$i<4;$i++) { $table .= "<tr>"; for (my $j=1;$j<7;$j++) { $table .= "<td>$values[$j]</td>";} $table .= "</tr>";} $table .= "</table>";} }

    I am calling the subroutine data as mentioned below:

    my $table = Data(); Email( $table); <> <p>gives me this output message / faulty output: in table </p> <code> ABC_TEK 12 DFE_YJK 24 JKL_GHY 26 LKJ_UYH 29 GHK_YTH 23 GHS_JSF 34 FHK_ +THE 25 SHJ_TRE 26 HSJ_TEH 39 AHJ_EGH 56 SGH_HEJ 42 HGE_THE 46 HEJ_EJJ + 67 JLE_EJK 89 EHJ_EJK 78 EHJ_IKL 68 EHJ_EJK 57 EJH_EKL 69

    I am putting all the read from the array in table and calling subroutine email to print the data in table format in the body

    Please check why i was not able to print all records

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-09-21 22:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls