Re: Perl code for comparing two files

2009-05-08 Thread Richard Loveland
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mr. Adhikary, The following will take any number of files as arguments, in the format you described (I even tested it! :-)). It goes through each line of those files, stuffing (the relevant part of) each line in a 'seen' hash (more on that, and other,

Re: Licensing code

2009-05-08 Thread Chas. Owens
On Fri, May 8, 2009 at 11:33, Randal L. Schwartz wrote: >> ""Chas" == "Chas Owens" writes: > > "Chas> Neither license prevents people from selling the software in question, > "Chas> but both require that source be available (or made available), so > "Chas> anyone charging an arm and a leg for

Re: Licensing code

2009-05-08 Thread Randal L. Schwartz
> ""Chas" == "Chas Owens" writes: "Chas> Neither license prevents people from selling the software in question, "Chas> but both require that source be available (or made available), so "Chas> anyone charging an arm and a leg for it will rapidly find free "Chas> versions being made available (

Re: newbie needs help with first perl prog

2009-05-08 Thread John W. Krahn
Prince Mavi wrote: Hi folks Hello, 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 th

Re: Reading/writing binary

2009-05-08 Thread John W. Krahn
Raymond Wan wrote: On 5/8/09, John W. Krahn wrote: [snip] That is equivalent in C to: unsigned char decimal_number = 42; Or another way to write that in Perl is: my $decimal_number = pack 'C', 42; Once you have created the appropriate strings using pack() then just print() them. I se

RE: Licensing code

2009-05-08 Thread Bob McConnell
From: Steve Bertrand > Chas. Owens wrote: >> On Thu, May 7, 2009 at 22:04, Steve Bertrand 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 e

Re: Reading/writing binary

2009-05-08 Thread Raymond Wan
Hi Chas., On 5/8/09, Chas. Owens wrote: > The place to go is http://perldoc.perl.org, and in your case > http://perldoc.perl.org/functions/pack.html and > http://perldoc.perl.org/functions/unpack.html. You can also get these > docs on your machine by saying > > perldoc -f pack > perldoc -f unpac

Re: Reading/writing binary

2009-05-08 Thread Raymond Wan
Hi John, On 5/8/09, John W. Krahn wrote: [snip] > That is equivalent in C to: > > unsigned char decimal_number = 42; > > Or another way to write that in Perl is: > > my $decimal_number = pack 'C', 42; > > > Once you have created the appropriate strings using pack() then just > print() them.

Re: Reading/writing binary

2009-05-08 Thread Chas. Owens
On Fri, May 8, 2009 at 03:20, Raymond Wan wrote: > Hi Chas, > > On 5/7/09, Chas. Owens wrote: >> You use pack to create a binary value and unpack to read a binary >> value.  So, to write a file containing three 32 bit integers you say > > [snip] > > Thanks for the sample code; that worked exactly

Re: Reading/writing binary

2009-05-08 Thread Raymond Wan
Hi Chas, On 5/7/09, Chas. Owens wrote: > You use pack to create a binary value and unpack to read a binary > value. So, to write a file containing three 32 bit integers you say [snip] Thanks for the sample code; that worked exactly as you said. I wasn't getting anywhere with google; I thought

Re: Licensing code

2009-05-08 Thread Chas. Owens
On Fri, May 8, 2009 at 00:51, Steve Bertrand wrote: snip > I wish all of my code be free, ie: I don't care if a commercial entity > uses it for their benefit or not, I don't care if derivatives are used > in commercial products or not, all I really care about is that my > current code is protected