develooper Front page | perl.beginners | Postings from May 2008

Re: $^I

Thread Previous | Thread Next
From:
Chas. Owens
Date:
May 11, 2008 15:20
Subject:
Re: $^I
On May 11, 2008, at 18:04, Richard Lee wrote:

> I just looked it up on perldoc perlvar, but I am still not sure what  
> it does.
>
>
>
> $^I     The current value of the inplace-edit extension.  Use  
> "undef" to disable inplace editing.  (Mnemonic: value of -i
>             switch.)
>
> I was reading perl cookbook and saw this example, and was wondering  
> what that is....
>
>
> if (@ARGV) {
>  $^I = ".orig";
> } else {
>   warn "$0: Reading from stdin\n" if -t STDIN;
> }


Setting $^I turns on in-place-editing*.

* http://perldoc.perl.org/perlrun.html#*-i*[_extension_]

--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.


Thread Previous | Thread Next


Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About