Well, I got interested and changed this code to mess around with unicode characters. The problem is it still doesnt print what it's supposed to, and it makes the PC speaker on my computer beep. The simbols were a variety of musical ones, a happy face, lightning bolt, etc. None of them were card symbols.
Any ideas? Joel ____________________________ #!/usr/bin/perl use warnings; use strict; my $h=15; my @word = (0x26A1, 0x2622, 0x2672, 0x2623, 0x2669, 0x266A, 0x266B, 0x266C, 0x266D, 0x266E, 0x266F, 0x262E, 0x262D, 0x263B, 0x260D); while ($h > 0) { $h--; my $letter=shift @word; print chr(@word); } ----- Original Message ----- From: "Rob Dixon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 02, 2004 12:46 PM Subject: Re: Why did it print a happy face? > Joel wrote: > > > > This is a precursor to a real JAPH signeture (I need to learn more perl > > before I can write a really obfuscated one), and I have already gotten it to > > print what it was supposed to, but I changed print chr($letter); to print > > chr(@word); to see if it would work, which is when I got the happy face > > output in perl. Any ideas? > > (By the way, I haven't fixed the while loop yet so be ready to quit fast to > > read the output.) > > > > Joel > > > > #!usr/bin/perl > > > > use Warnings; > > use Strict; > > > > my $h=4; > > my @word = (0x4E, 0x65, 0x72, 0x64); > > while ($h > 0) { > > $h++; > > $letter=shift @word; > > print chr(@word); > > } > > Hmm. I'm don't think I should be encouraging anybody to write obfuscated > Perl. Almost nobody does it well - including me. > > Why are you /incrementing/ $h from four until it's greater than zero? > > Your bug is that chr() forces its parameter into scalar mode, so that your > output will be > > "\03\02\01\0\0\0\0\0\0" > > Although your capitalised pragma could almost be seen as divisive: there's > neither a 'Warnings' nor a 'Strict', so you're practising unprotected > unintentional obfuscation. > > Write Perl well first. Please. Then write somthing clever. > > Rob > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>