Re: Perl - Bit Manipulation

2006-11-14 Thread Rob Dixon
Ricardo SIGNES wrote: * "Randal L. Schwartz" [2006-11-14T16:34:43] "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: This is indeed a documentation bug. perlop says, in full: ~ The "=>" operator is a synonym for the comma, but forces any word ~ (consisting entirely of word characters) to its

Re: Perl - Bit Manipulation

2006-11-14 Thread Dr.Ruud
Randal L. Schwartz schreef: > Ruud: >> >> The "=>" operator is a synonym for the comma, but forces any >> word to its left to be interpreted as a string (as of 5.001). >> >> >> And AFAICS that isn't true: >> >> $ perl -MData::Dumper -wle' >> %n = (00 => Integer, 01 => Floating, 10 => Char, 11

Re: Perl - Bit Manipulation

2006-11-14 Thread Ricardo SIGNES
* "Randal L. Schwartz" [2006-11-14T16:34:43] > > "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: > > Rob> This is indeed a documentation bug. perlop says, in full: > Rob> ~ The "=>" operator is a synonym for the comma, but forces any word > (consisting > Rob> ~ entirely of word characters) to

Re: Perl - Bit Manipulation

2006-11-14 Thread Randal L. Schwartz
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob> This is indeed a documentation bug. perlop says, in full: Rob> ~ The "=>" operator is a synonym for the comma, but forces any word (consisting Rob> ~ entirely of word characters) to its left to be interpreted as a string (as of Rob> ~ 5.

Re: Perl - Bit Manipulation

2006-11-13 Thread Rob Dixon
Randal L. Schwartz wrote: > > ""Dr" == Ruud" writes: >> >> >> The "=>" operator is a synonym for the comma, but forces any word to >> its left to be interpreted as a string (as of 5.001). >> >> >> And AFAICS that isn't true: >> >> $ perl -MData::Dumper -wle' >> %n = (00 => Integer, 01 => Floa

Re: Perl - Bit Manipulation

2006-11-13 Thread Randal L. Schwartz
> ""Dr" == "Dr Ruud" writes: "Dr> "Dr> The "=>" operator is a synonym for the comma, but forces any word to "Dr> its left to be interpreted as a string (as of 5.001). "Dr> "Dr> And AFAICS that isn't true: "Dr> $ perl -MData::Dumper -wle' "Dr> %n = (00 => Integer, 01 => Floating, 10 => C

Re: Perl - Bit Manipulation

2006-11-13 Thread Dr.Ruud
"John W. Krahn" schreef: > Dharshana Eswaran: >> %TypeofNumber = ( 00 => Integer, 01 => Floating, 10 => Char, 11 => >> Double ); > > Perl interprets numbers beginning with 0 as octal and the other > numbers as decimal so 00 is the number 0, 01 is the number 1, 10 is > the number ten and 11 is th

Re: Perl - Bit Manipulation

2006-11-13 Thread John W. Krahn
Dharshana Eswaran wrote: > Hi all, Hello, > In the below program, i give in the hash as > > %TypeofNumber = ( 0b00 => Integer, 0b01 => Floating, 0b10 => Char, 0b11 => > Double ); *You* *have* *to* *quote* *strings* my %TypeofNumber = ( 0b00 => 'Integer', 0b01 => 'Floating', 0b10 => 'Char', 0b

Re: Perl - Bit Manipulation

2006-11-13 Thread Dharshana Eswaran
Hi all, In the below program, i give in the hash as %TypeofNumber = ( 0b00 => Integer, 0b01 => Floating, 0b10 => Char, 0b11 => Double ); Using this hash i need to priont the appropriate combination How to do that? Thanks and Regards, Dharshana On 11/13/06, Dharshana Eswaran <[EMAIL PROT

Re: Perl - Bit Manipulation

2006-11-13 Thread John W. Krahn
Dharshana Eswaran wrote: > Hi all, Hello, > I am working on the code below > > use strict; > use warnings; > > my $hex = "43"; > > my $binary = unpack 'B*', pack 'H*', $hex; > > print "$binary\n\n"; > > my @fields = unpack 'A2A2A4', $binary; > > my $i; > printf "%-4s => %s\n", $fields[$

Re: Perl - Bit Manipulation

2006-11-13 Thread Owen
On Mon, 13 Nov 2006 11:35:11 +0530 "Dharshana Eswaran" <[EMAIL PROTECTED]> wrote: > Hi all, > > I am working on the code below > > use strict; > use warnings; > > my $hex = "43"; > > my $binary = unpack 'B*', pack 'H*', $hex; > > print "$binary\n\n"; > > my @fields = unpack 'A2A2A4', $bi

Perl - Bit Manipulation

2006-11-12 Thread Dharshana Eswaran
Hi all, I am working on the code below use strict; use warnings; my $hex = "43"; my $binary = unpack 'B*', pack 'H*', $hex; print "$binary\n\n"; my @fields = unpack 'A2A2A4', $binary; my $i; printf "%-4s => %s\n", $fields[$i++], $_ foreach qw/Ext TypeofNumber NumberingPlan/; **OUTPUT**