943,892 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 796
  • Perl RSS
Feb 9th, 2009
0

insert text

Expand Post »
Hi !

This sctipt work with \insert{aaa.tex} but dont work with \insert aaa.tex


What I must do ?!

while(/^\\insert\{(.*?)(\.tex)?\}/){
      $pries=$`."\n";
      $nekeisk=$&;
      $vardas=$1;
      $po=$';
      $failiukas=$1.".tex";
         
      if(-e "$dir/$failiukas"){
                               open (IN2,"<$failiukas") || die "negaliu atidaryti $failiukas failo.\n";
                               $vidus=<IN2>;
                               close IN2;
     
                               $visas=$visas.$pries.$vidus."\n";
                               $_=$po;
                               print "Idetas failas $failiukas\n";
                              }
     else{
           $visas=$visas.$pries.$failiukas."\n";
           $_=$po;
           print "$failiukas failas nerastas!!!!!!\n";
         }
                               }
$visas=$visas.$_;
$_=$visas;
$visas = "";
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
viktorijakup is offline Offline
8 posts
since Sep 2008
Feb 9th, 2009
0

Re: insert text

try:

while(/^\\insert{?(.*?)(\.tex)?}?/){

you don't need to escpae the {} brackets with \
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: perl form problem
Next Thread in Perl Forum Timeline: regex not validating email





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC