in reply to Spurious `undefined' values and conversion issues

printf REBINOUT pack('V',$counts_rebin[$i]); # l: 1188

Use print instead of printf.

printf needs a format specification string as the first argument after the file handle REBINOUT. As you have not specified one, your packed data is being misinterpreted as a format string...

Update: Your "uninitialized values" errors might have to do with that you're initializing @energy_before with a loop running up to 16384, but then are retrieving values from that array up to an index of 16831 ...  (though I must admit I haven't looked into the code too deeply)

Replies are listed 'Best First'.
Re^2: Spurious `undefined' values and conversion issues
by sf_ashley (Sexton) on May 30, 2008 at 18:17 UTC

    Many thanks for looking through the code and for your comments almut.

    Both the printf statement and the array limit were indeed a typographical errors (well, the latter was a spoonerism I suppose), which is a little frustrating, given the amount of time I have spent trying to find the error. Modifying the above, as appropriate, eradicated the errors/warnings.

    Again, many thanks for your help.

    Steve