Keyboard/Character question

Okay, so I’m working my way through “Sam’s Teach Yourself Perl in 21 Days.” Things are going swimmingly until day 6, where the example code involves a ¦. Except there isn’t one on my keyboard.

All right,I’m not a complete idiot. I open Word, get one from the list of symbols, and then paste it into my program (which I’m writing with NotePad). Except now Perl keeps telling me “Unrecognized character \xA6 at line 11.” Yep, line 11 is where the ¦¦ is.

After doing a search, I’ve decided I need to install the US International English keyboard and then can get the ¦ from the keyboard that way. I’m waiting for Mr. Lestrange to wake up and tell me where he hides the Win95 discs, but meanwhile, will that work any better than copying and pasting, and why won’t pasting it from Word work? Will I have to figure out ways around using ¦¦ until I buy another keyboard? What’s the story?

Try holding down the Alt key, then type the number 124 using the keypad numbers, then release the Alt key. That’s the ascii code for the | character.

I’m guessing the confusion is from the fact that in your book the “|” character (often called a “pipe”) is written with a break in it like in your OP. It’s the same character as in Ethilrist’s post as far as you’re concerned. Some fonts just put the break there to differentiate between a pipe, and a lowercase “l”, a capital “I” or the number “1”. The pipe is a standard character that any keyboard should have a key for. On mine, it’s Shift+. This way, programmers from all over the world with all types of computers can write Perl (or any other type of) code.

-Rob

I’m not exactly sure what you are looking for here, i’m assuming that you pasted the ¦ in the document and that is the symbol that you are looking for (as opposed to |). If memory serves, ¦ is called a ‘pipe’. On the keyboard it should be <shift> \ (backslash) but i notice that if i do it i end up with the verticle line |. If you have the same problem, try alt+0166 (ascii for pipe).

So,
alt+0124 = |
alt+0166 = ¦

Complete agreement. | shares a key with \ on my keyboard, too.

Except when I use that character (which is Shift+), I get gajillions of error messages. I’m pretty sure I’ve typed it just as it is in the book. I tried the alt+166 and alt+124 also, and while I get the appropriate characters, it still doesn’t work–I guess I’d better check my typing again, because if | and ¦ are the same (which I didn’t know, and thanks for the help,there), it should work. Hold on.

Okay. Now it works. Damn semicolons! Bizzarely enough, though, it won’t work with ¦ but it will work with |. Huh.

Anyway, thanks for the help!