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

Perl: clearing $1

Name: Anonymous 2009-03-02 5:35

I've got a little Perl script does a series of regexs and the $1 sometimes carries over if there is no match because of an error. I came up with the following kludge, but there should be a better way to reset the $1.

while ($file = shift) {
    $file =~ /\[([0-9A-F]{8})\]/;
    $sum1 = $1;
...
    $bogus = "FAIL";
    $bogus =~ /(FAIL)/;

    $sum2 = `cksfv "$file" 2>/dev/null | grep -v "^;"`;
    $sum2 =~ /([0-9A-F]{8})$/;
    $sum2 = $1;

    if ($sum1 eq $sum2) {
...

Name: Anonymous 2009-03-02 6:05

Nevermind, seems you have to use an if to check for a valid match.

if ($file =~ /\[([0-9A-F]{8})\]/) {
    $sum1 = $1;
} else {
...
}

Name: Anonymous 2009-03-02 6:21

hurr

Name: Anonymous 2009-03-02 6:47

ZOMG LOOK IT S A BOLEAN

Name: Anonymous 2009-03-03 4:24

Don't need the if.


my ($sum1) = $file =~ /\[([0-9A-F]{8})\]/;

Name: Anonymous 2009-03-03 7:00

Ignore >>5, he's just another Perl "programmer" doing everything in his power to make the code COMPLETELY FUCKING UNREADABLE.

Name: Anonymous 2009-03-03 7:09

>>6
What's the matter, too different from JAWA for you?

Name: Anonymous 2009-03-03 8:16

>>7
Have fun writing "write-only" code you loonie lunix tard

Name: Anonymous 2009-03-03 9:34

>>8
Have fun writing "Perl" you silly troll

Name: Anonymous 2009-03-03 16:25

>>9
Please don't feed the trolls.

Name: Anonymous 2009-03-03 19:33

>>11
Please don't feed the troll feeders.

Name: Anonymous 2009-03-03 21:17

>>12
Please don't troll the troll feeders.

Name: Anonymous 2011-02-03 6:46

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