Reading/writing binary

2009-05-07 Thread Raymond Wan
Hi all, I would like to write binary values to disk (as well as read them) but don't know how to do it. In C-speak, something like this: unsigned int foo = 42; fwrite (foo, sizeof (unsigned int), 1, stdout); I think the answer involves something with pack and unpack, but I'm completely lost as

Re: Reading/writing binary

2009-05-07 Thread Chas. Owens
On Thu, May 7, 2009 at 05:45, Raymond Wan rwan.w...@gmail.com wrote: Hi all, I would like to write binary values to disk (as well as read them) but don't know how to do it.  In C-speak, something like this: unsigned int foo = 42; fwrite (foo, sizeof (unsigned int), 1, stdout); I think the

Re: Reading/writing binary

2009-05-07 Thread John W. Krahn
Chas. Owens wrote: On Thu, May 7, 2009 at 05:45, Raymond Wan rwan.w...@gmail.com wrote: I would like to write binary values to disk (as well as read them) but don't know how to do it. In C-speak, something like this: unsigned int foo = 42; fwrite (foo, sizeof (unsigned int), 1, stdout); I

Re: Reading/writing binary

2009-05-07 Thread Chas. Owens
On Thu, May 7, 2009 at 12:24, John W. Krahn jwkr...@shaw.ca wrote: snip Shouldn't that be either: sysopen ... sysread ... Or: open ... read ... ? snip If this were C, then yes, but this is Perl and sysread takes a filehandle. Just remember not to mix sysread and readline (or the

Re: Reading/writing binary

2009-05-07 Thread John W. Krahn
Raymond Wan wrote: Hi all, Hello, I would like to write binary values to disk (as well as read them) but don't know how to do it. In C-speak, something like this: unsigned int foo = 42; fwrite (foo, sizeof (unsigned int), 1, stdout); I think the answer involves something with pack and

Licensing code

2009-05-07 Thread Steve Bertrand
Hi all, Although I am not a programmer, I do have a few dozen applications I've written. All programs concerned are in Perl. My 'programs' include numerous functions within dozens of library files which I've also personally written. Some of my applications utilize functions from other external

newbie needs help with first perl prog

2009-05-07 Thread Prince Mavi
Hi folks I am new to perl. this is my first real program in perl. The program is not doing what i intend it to do. The problem in nut shell is that: I expect to see the menu first and then input my choice. but the program asks for my choice first and then displays the menu Please have a look and

Re: newbie needs help with first perl prog

2009-05-07 Thread Rhinux.xu
Prince Mavi 写道: Hi folks I am new to perl. this is my first real program in perl. The program is not doing what i intend it to do. The problem in nut shell is that: I expect to see the menu first and then input my choice. but the program asks for my choice first and then displays the menu

Re: newbie needs help with first perl prog

2009-05-07 Thread Steve Bertrand
Prince Mavi wrote: Hi folks I am new to perl. this is my first real program in perl. The program is not doing what i intend it to do. The problem in nut shell is that: I expect to see the menu first and then input my choice. but the program asks for my choice first and then displays the

Re: Licensing code

2009-05-07 Thread Chas. Owens
On Thu, May 7, 2009 at 22:04, Steve Bertrand st...@ibctech.ca wrote: snip I like the BSD license, and I am a BSD person, but I'm asking for feedback from the creme-de-la-creme with regards to making code public, so that I can put something in my code to ensure that someone else doesn't decide

Re: Licensing code

2009-05-07 Thread Steve Bertrand
Chas. Owens wrote: On Thu, May 7, 2009 at 22:04, Steve Bertrand st...@ibctech.ca wrote: snip I like the BSD license, and I am a BSD person, but I'm asking for feedback from the creme-de-la-creme with regards to making code public, so that I can put something in my code to ensure that someone