[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] inline edits on files in a user specified folder -- how to?



Could you assist me with a vexing MacPERL problem?

I am trying to open a folder and perform a series of inline edits on
each file inside.

 I can get the opertion to work as a droplet but not as a  batch
process.


I have commented or removed some statements as I was working on this
 (| die " .. etc) to simplify what I was looking at
thanks in advance

Brian Runk

> 
> #!/usr/local/bin/perl5 -w
> #$^I = ".orig";
> 
> #choose directory
> require "GUSI.ph" ;              
> $dir = &MacPerl'Choose(           
>      &GUSI'AF_FILE, 0, "", "",    
>      &GUSI'CHOOSE_DIR);           
> print "$dir\n";                   
> 
> 
> #read filenames into an array
> 
>     opendir(FOLDER,"$dir");  
>     chdir( $dir );
>     opendir( FOLDER, ':' );
>     @files = readdir(FOLDER);        
>                
> for (@files) 
>         {
>         while(<>)
>           {
>            s/TEXT STRING/REPLACMENT STRING/g; 
>            print;
>            }
>          }
> 
> closedir(FOLDER);
> 
> __END__
> 
>

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch