i am using IO::File so that i can use the seekable feature to set the
file pointer position.

   $OUT_BINARY = new IO::File "> test.file";
   binmode ($OUT_BINARY)

if i execute this, the write works:

   print $OUT_BINARY $data;

what i want to do (for the sake of pointing out the problem) is to
instead turn the print statement into a subroutine - where i would
call it passing in $OUT_BINARY (the file handle) and $data (the data
to write).

the sub looks like this:

   sub write_fp_data {

      #called with:
      #   file pointer = $_[0]
      #   data value = $_[1]

      #this attempts to do the write - but fails
      print $_[0] $_[1];                    #line 101
   }

and the call to the sub, looks like this:

   &write_fp_data($OUT_BINARY, $data);

this all seems 'simple enough', though when using this with the sub bombs with:

Scalar found where operator expected at FILE2.PL line 101, near "] $_"
        (Missing operator before  $_?)
syntax error at FILE2.PL line 101, near "] $_"
Execution of FILE2.PL aborted due to compilation errors.

im certain this must have something to do with my using $_[0] versus
$OUT_BINARY in the sub routine - but i cant see what is wrong with
this code.  would be most appreciative if anyone can see the glaring
problem!

greg
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to