in reply to Nothin' but punctuation

Care to explain how it works, roughly? For example what does the `$=` do on a *nix system, and what good is it if the result isn't being used in the code?

Replies are listed 'Best First'.
Re^2: Nothin' but punctuation
by Sue D. Nymme (Monk) on Jun 01, 2009 at 21:06 UTC

    Assuming you don't have a program named "60" (<grin>), it populates $! with a known error message, “No such file or directory”. Later, the line

    $!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/

    fetches some characters from that string. It then mangles and glues those characters together into a shell command, which is executed in the last ¾ of the fourth line.

    Hope this helps....

      I think it gets the text of not existing file "60" and processes is further. Try to run it in a different locale :-) The last statement will not become `echo Just another Perl hacker.`
Re^2: Nothin' but punctuation
by ikegami (Patriarch) on Jun 01, 2009 at 20:36 UTC

    It sets $? to -1 (any non-Windows system), and $! to ENOENT (any non-Windows system). ENOENT is 2/"No such file or directory" on linux. I don't know if the program relies on this.

    ...unless, of course, you have a program named 60.