in reply to Simple query regarding unpack/splice
@datapoint = splice(@values, 0, $x);
So you take $x items from from @values, and assign it to @datapoint. How many values will @datapoint have at the end? Right, exactly $x. Which is 1, in your script.
Update: BTW this is a bad idea: while (read(FILE, $buf, $recsize) == $recsize) {
The last chunk of the file might be shorter than $recsize, in which case read returns a smaller number. The body of the loop is then skipped. If you want to read all records from your file, just say
while (read(FILE, $buf, $recsize)){ ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Simple query regarding unpack/splice
by pc88mxer (Vicar) on May 08, 2008 at 18:13 UTC | |
|
Re^2: Simple query regarding unpack/splice
by sf_ashley (Sexton) on May 08, 2008 at 16:31 UTC |