home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / Perl / Non-RPC / !Perl / scripts / TextAreaRE < prev    next >
Text File  |  1998-07-14  |  515b  |  21 lines

  1. use RISCOS;
  2. use RISCOS::DrawFile;
  3. use RISCOS::File 'globlist';
  4.  
  5. # A program to change the contexts of text areas using a regular expression.
  6. # This RE makes all \AD\L24 into \AL\L24/\P24
  7. # Now do that in !Draw with 12 files...
  8.  
  9. sub change {
  10.     return unless my $met = $_[0]->can('TextArea');
  11.     $_ = &$met($_[0]);
  12.     $_ =~ s/\\AD\\L24/\\AL\\L24\/\\P24/;
  13.     &$met($_[0], $_);
  14. }
  15.  
  16. foreach $file (globlist (@ARGV)) {
  17.     $draw = new RISCOS::DrawFile ($file,'+');
  18.     $draw->Do(\&change);
  19.     $draw->Write($file);
  20. }
  21.