Coderifous
Programmer
I've been reading my Perl book and have noted some operators which aren't explained very well. I'm sure they are second nature to more experienced programmers, but the the young and naive like myself, are foreign.
Could someone please explain and provide and example of use for the following operators:
>> << ~
The first two I understand are related. Basically they return the left operand shifted (bitwise) by [right operand] places. SO 4 << 2 returns 16 by doing this:
00100 shift two places to the left to become: 10000
Is this correct? And if so... how in the heck does 'print <<EOF' work? I understand that the 'EOF' part can is arbitrary, but how does the bitshift operator make this 'majic' happen?
And the ~ operator - I'm lost on.
--Jim
Could someone please explain and provide and example of use for the following operators:
>> << ~
The first two I understand are related. Basically they return the left operand shifted (bitwise) by [right operand] places. SO 4 << 2 returns 16 by doing this:
00100 shift two places to the left to become: 10000
Is this correct? And if so... how in the heck does 'print <<EOF' work? I understand that the 'EOF' part can is arbitrary, but how does the bitshift operator make this 'majic' happen?
And the ~ operator - I'm lost on.
--Jim