perldoc -A @+

Ovid on 2008-02-26T19:22:49

I've just sent Sean Burke a patch which allows you to use perldoc to search perlvar. I hijacked the -A switch because it was free and -V defaulted to 'version'. Didn't understand the option handling code, but I didn't try too hard. It's smart enough to know how to handle 'dollar digit' variables (e.g., regex matches), and if there's more than one name for a variable, it pulls the first one:

$ perldoc -A $^I

$INPLACE_EDIT
$^I
The current value of the inplace-edit extension.  Use "undef" to disable
inplace editing.  (Mnemonic: value of -i switch.)

Heck, I don't even know what an "inplace-edit extension" is, but this patch will at least tell you the variable.


-i

chromatic on 2008-02-26T20:17:35

I don't even know what an "inplace-edit extension" is...

It's the .bak in perl -pi.bak -e 's/foo/bar/'.

Re:-i

Ovid on 2008-02-26T20:28:39

Oh, duh! Thanks :)

Working on this code, I saw plenty of variables I have no familiarity with. I don't know when I'd use %! or $^C, for example, though $^T looks very useful. It's a strange world, peering down there.

Make it a ticket

ferreira on 2008-02-27T01:00:03

And don't forget to send that patch also into the rt.cpan.org queue, where it can rest for a long long time. ;-) Just kidding. Only to be sure it is readily available.

Please share!

drhyde on 2008-02-27T12:46:53

Please post your patch here too. I've been meaning to do the same for perlop for ages, so might as well copy how you've done it.