By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,541 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,541 IT Pros & Developers. It's quick & easy.

insert text

viktorijakup
P: 10
This sctipt work with \insert{aaa.tex} but dont work with \insert aaa.tex

What I must do ?!


Expand|Select|Wrap|Line Numbers
  1. while(/^\\insert\{(.*?)(\.tex)?\}/){
  2.       $pries=$`."\n";
  3.       $nekeisk=$&;
  4.       $vardas=$1;
  5.       $po=$';
  6.       $failiukas=$1.".tex";
  7.  
  8.       if(-e "$dir/$failiukas"){
  9.                                open (IN2,"<$failiukas") || die "negaliu atidaryti $failiukas failo.\n";
  10.                                $vidus=<IN2>;
  11.                                close IN2;
  12.  
  13.                                $visas=$visas.$pries.$vidus."\n";
  14.                                $_=$po;
  15.                                print "Idetas failas $failiukas\n";
  16.                               }
  17.      else{
  18.            $visas=$visas.$pries.$failiukas."\n";
  19.            $_=$po;
  20.            print "$failiukas failas nerastas!!!!!!\n";
  21.          }
  22.                                }
  23. $visas=$visas.$_;
  24. $_=$visas;
  25. $visas = "";
Feb 9 '09 #1
Share this Question
Share on Google+
1 Reply


KevinADC
Expert 2.5K+
P: 4,059
try:

while(/^\\insert{?(.*?)(\.tex)?}?/){
Feb 9 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.