Re: open > file && s/ / /;
- From: krahnj@xxxxxxxxx (John W. Krahn)
- Date: Thu, 28 Jul 2005 17:07:52 -0700
Brian Volk wrote:
>
>>From: John W. Krahn [mailto:krahnj@xxxxxxxxx]
>>
>># store the files to "edit" in @ARGV
>>@ARGV = map { chomp; "$dir/$_" } <BAD>;
>>
>># set the in-place edit variable
>># cannot be '' on Windows
>>$^I = '.bak';
>>
>># modify the files and save the originals with .bak extention
>>while ( <> ) {
>> s & http://.* & descriptions/product/MSDS/$file &;
>> print;
>> }
>
> John.. Thank you for the reply! Just a couple of things I don't
> understand...
>
> 1.) > # set the in-place edit variable
> > # cannot be '' on Windows
> > $^I = '.bak';
>
> This worked great on WinXP but when I went home and tried it on Linux it did
> not work. Which is what, I'm sure your comments ment.. :~) How would I
> write $^I = '.bak'; on Linux?
I have used it many times on Linux and it has worked for me. What does
"it did not work" mean exactly?
> 2.) The subsitution didn't work on some of the files... could this have to
> do w/ CR or LF?
It could be anything, it is hard to tell without seeing the actual
program and data.
John
--
use Perl;
program
fulfillment
.
- References:
- RE: open > file && s/ / /;
- From: Brian Volk
- RE: open > file && s/ / /;
- Prev by Date: Re: error message with net::FTP
- Next by Date: checking the reachability of the remote host
- Previous by thread: RE: open > file && s/ / /;
- Next by thread: command line problems - help!
- Index(es):
Relevant Pages
|