Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: selecting columns from a tab-separated-values file

by mildside (Friar)
on Jan 24, 2013 at 22:59 UTC ( #1015243=note: print w/ replies, xml ) Need Help??


in reply to Re^3: selecting columns from a tab-separated-values file
in thread selecting columns from a tab-separated-values file

Great job there Lotus1.

I'm curious about the use of splice to clear the array in your code, as below:

    splice( @$aref );

I would probably have used the below:

    @$aref = ();

Is splice faster or better in some other way?


Comment on Re^4: selecting columns from a tab-separated-values file
Select or Download Code
Re^5: selecting columns from a tab-separated-values file
by Lotus1 (Chaplain) on Jan 25, 2013 at 02:23 UTC

    Thanks. I started with assigning the empty array but I had a bug somewhere so I stuck the splice in and got it working. I think I forgot the '@' in the first try but put it in with splice. I don't know which is faster but it is only called a handful of times in this approach anyway.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-08-30 10:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (292 votes), past polls