Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Splitting Multiple files into arrays.

by Laurent_R (Canon)
on Jul 20, 2013 at 23:03 UTC ( #1045481=note: print w/replies, xml ) Need Help??


in reply to Splitting Multiple files into arrays.

Please format your code to make it readable. This is your code correctly reformatted.

for (my $i = 1 ;$i <=8; $i++) { open (MYFILE,"server$i"); while (<MYFILE>) { chomp; my @values = split " ",$_; push @{ "table$i"},\@values; } }
In short, you are using symbolic references, which was right 15 years ago, but is deprecated and probably wrong today.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045481]
help
Chatterbox?
[Corion]: choroba: Yeah - I found that if you have the "right" datastructure from the start, it's fairly easy, but if you have some global datastructure that you mutate, you have to rewrite a lot to pass around the results instead.
[Corion]: I find the process quite similar to (in Prolog) passing around an accumulator variable in recursive predicates
[1nickt]: Good morning, brainy monks!
[marto]: Hi 1nickt, I know it's early days, but how is the new job?
[Corion]: Hi 1nickt!
[Corion]: Ohai marto!
[marto]: hey Corion

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2017-12-11 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (289 votes). Check out past polls.

    Notices?