Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Perl has failed me /sadpanda.png

Name: Anonymous 2007-07-31 16:59 ID:oPzZQth4

So, I have this script, but it doesn't work (syntax error), it's obviously because Perl sux... But, maybe you can fix it? Or maybe it even works for you?

#!/usr/bin/perl

use Switch;

print (10 / 2) ."\n";

while (<>)
{
    switch ($_)
    {
        case (/^EXIT\n$/i)
        {
            exit 0;
        }
        else
        {
            print $_;
        }
    }
}

Name: Anonymous 2007-07-31 18:07 ID:Heaven

>>5
actually, this is shorter, and fixes a bug (forgot the i on the regex):
/^exit$/i?last:print for"5\n",<>

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List