Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    United States

    Perl Script (Syntax Error)

    Hi, I found a Dynamic IP updating script but for some reason when I run it I am getting "syntax error at Script line 10, near "=;" Script had compilation errors." I was wondering if someone can help me out. Thanks

    $htaccess = "/home/client/.htaccess";
    $template = "/home/client/htaccesstemplate";
    # get ip address
    @sp = split(/ /,$result);
    $size = @sp;
    $ip = $sp[$size-1];
    open(TEMPLATE, $template) || die("Could not open file!");
    open(NEW, ">$htaccess") || die("Could not create file!");
    foreach $line (@raw_data){
    	if($line =~ /\@\@\@DYNAMIC\@\@\@/){
    		print NEW "allow from $ip\n";
    		print NEW $line;
    Jumpto Media | Your Technology Experts!
    ■ Experts in setting up, configuring, securing, and managing Linux & Windows servers.
    ■ Experts with almost all control panels, scripts, apps, and softwares.
    ■ Experts Guaranteed Work.

  2. #2
    Join Date
    Feb 2005
    Looks like:
    Quote Originally Posted by LayerSolutions View Post
    should be:
    Bear in mind that the script will wipe out your current .htaccess and replace it with one generated from htaccesstemplate - you might want a backup of .htaccess first...

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

Similar Threads

  1. running a perl script throws internal 500 error.
    By jjk2 in forum Programming Discussion
    Replies: 3
    Last Post: 12-23-2008, 10:15 PM
  2. Parse error: syntax error,is this mysql problem,plz?
    By skyaus in forum Hosting Security and Technology
    Replies: 5
    Last Post: 10-25-2008, 09:31 PM
  3. Parse error: syntax error, unexpected ';' in ... on line 47
    By Riche_Angelus in forum Programming Discussion
    Replies: 3
    Last Post: 04-20-2008, 12:26 AM
  4. [perl] Why am I receiving a syntax error?
    By WoodShedd in forum Programming Discussion
    Replies: 3
    Last Post: 01-25-2004, 07:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts