SPUG: -MO=Deparse; what it is?
Johnston, Mark
mark.johnston at pnl.gov
Mon Jan 31 15:07:42 CST 2000
Tim,
Looks like a literal translation of the parse tree to me.
Since Perl uses so many implicit shortcuts, the -MO=Deparse option could
be used to de-obfuscate someone else's dense code as well as to check to see if
the Perl interpreter was understanding one's own line of code the way it was
intended to be written. Otherwise, my guess is that many would consider it
something like "verbose mode."
--Mark
-----Original Message-----
From: Tim Maher/CONSULTIX [tim at consultix-inc.com]
Sent: Saturday, January 29, 2000 2:58 PM
To: spug-list at pm.org
Subject: SPUG: -MO=Deparse; what it is?
(E-)?SPUG-ticians,
In a Perl Beautification discussion I had with somebody,
the following -MO=Deparse business came up. Does anybody
know what this is? (My O'Reilly bookshelf seems mute on
the subject, and the person who brought this up has long
since "gone out of scope" (mine, not his)).
It sure gives interesting output, but I wouldn't call it
a beautifier; it's more like an overzealous copy-editor!
$ perl -n -e '1 .. 10 and print;' /etc/motd
Linux 2.0.36. (POSIX).
$ perl -MO=Deparse -n -e '1 .. 10 and print;' /etc/motd
-e syntax OK
LINE: while (defined($_ = <ARGV>)) {
print $_ if 1 .. 10;
}
$
*========================================================================*
| Tim Maher, PhD Consultix & (206) 781-UNIX/8649
|
| Pacific Software Gurus, Inc Email: tim at consultix-inc.com
|
| UNIX/Linux & Perl Training http://www.consultix-inc.com
|
| 2/22: UNIX 2/28: Perl Modules 2/29: Int. Perl 3/3: Pattern Matching
|
*========================================================================*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
Email to majordomo at pm.org: ACTION spug-list your_address
More information about the spug-list
mailing list