in reply to Re^20: How to store the output from foreach loop into variable/array without printing?
in thread How to store the output from foreach loop into variable/array without printing?
@_ refer to the whole dataset right?
Do a ctrl+f for spankTheMonkey to see what spankTheMonkey is being given (which args are passed)
Then see perlvar#@_ Within a subroutine the array @_ contains the parameters passed to that subroutine.
So, @_ is not "the whole dataset", there is no variable "the whole" of type "dataset" :)
But if I want to only include data from column 4 onward to the end, I have to write a function to split the data and then take column 4 to end and put it into @_?
Yes, you can modify spankTheMonkey to discard parts ... essentially turning it from readFullData into readColumnRange( $in_filehandle, 4 .. 10 );
perlintro#Arrays ought to help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^22: How to store the output from foreach loop into variable/array without printing?
by hellohello1 (Sexton) on Mar 24, 2014 at 01:41 UTC | |
|
Re^22: How to store the output from foreach loop into variable/array without printing?
by hellohello1 (Sexton) on Mar 25, 2014 at 09:22 UTC | |
by Anonymous Monk on Mar 25, 2014 at 15:28 UTC |