Results 1 to 7 of 7

Thread: Perl variables ....

  1. #1

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Perl variables ....

    Seems like it only takes the first vhost . It would help if I knew what all these variables in perl meant.
    Code:
    <perl>
    #!/usr/bin/perl -w
    #line <1022>
    
    local ($vhost_dir, $doc_root, $name, $vh);
    
    $vhost_dir = "/home/web";
    
    opendir(VHOSTS, $vhost_dir);
    
    my @file_list = grep(/^[^\.]/,readdir(VHOSTS));
    closedir(VHOSTS);
    
    foreach $name (@file_list) {
            $doc_root = "$vhost_dir/$name";
    
            if (-d $doc_root) {
                    $vh={
                      ServerName => "$name.codedv.com",
                      DocumentRoot => "$doc_root/htdocs",
                      SuExecUserGroup => "$name users",
                      CustomLog => "$doc_root/logs/access_log common",
                      ErrorLog => "$doc_root/logs/error_log",
                      ScriptAlias => "/cgi-bin/ $doc_root/cgi-bin/",
                      Directory => {
                            "$doc_root/cgi-bin" => {
                                    Options => "+ExecCGI",
                                    Order => "allow,deny",
                                    Allow => "from all"
                            }
                      }
                    };
    
                    if (-f "$doc_root/conf/httpd.conf") {
                            $$vh{Include} = "$doc_root/conf/httpd.conf";
                    }
    
                    $VirtualHost{'10.10.3.2:80'};
            }
    }
    __END__
    </perl>
    Last edited by visualAd; Jul 6th, 2005 at 04:09 AM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  2. #2

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Perl ...... yuk ...... :sick:

    I think I get it now anyway but still no luck ... it seems the its an array and I need to push it on :thinks:
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Perl ...... yuk ...... :sick:

    Stupid thing - grrrrrrrrr
    Code:
    <perl>
    #!/usr/bin/perl -w
    #line <1022>
    
    local ($vhost_dir, $doc_root, $name, $vh);
    
    $vhost_dir = "/home/web";
    
    opendir(VHOSTS, $vhost_dir);
    
    my @file_list = grep(/^[^\.]/,readdir(VHOSTS));
    closedir(VHOSTS);
    
    foreach $name (@file_list) {
            $doc_root = "$vhost_dir/$name";
    
            if (-d $doc_root) {
                    $vh={
                      ServerName => "$name.codedv.com",
                      DocumentRoot => "$doc_root/htdocs",
                      SuExecUserGroup => "$name users",
                      CustomLog => "$doc_root/logs/access_log common",
                      ErrorLog => "$doc_root/logs/error_log",
                      ScriptAlias => "/cgi-bin/ $doc_root/cgi-bin/",
                      Directory => {
                            "$doc_root/cgi-bin" => {
                                    Options => "+ExecCGI",
                                    Order => "allow,deny",
                                    Allow => "from all"
                            }
                      }
                    }
    
                    if (-f "$doc_root/conf/httpd.conf") {
                            $$vh{Include} = "$doc_root/conf/httpd.conf";
                    }
    
                    push @{ $VirtualHost{'10.10.3.2:80'} }, $vh
            }
    }
    __END__
    </perl>
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Perl ...... yuk ...... :sick:

    Gottit YAYYYYYYY
    Code:
    <perl>
    #!/usr/bin/perl -w
    #line <1022>
    
    local ($vhost_dir, $doc_root, $name, $vh);
    
    $vhost_dir = "/home/web";
    
    opendir(VHOSTS, $vhost_dir);
    
    my @file_list = grep(/^[^\.]/,readdir(VHOSTS));
    closedir(VHOSTS);
    
    foreach $name (@file_list) {
            $doc_root = "$vhost_dir/$name";
    
            if (-d $doc_root) {
                    $vh={
                      ServerName => "$name.codedv.com",
                      DocumentRoot => "$doc_root/htdocs",
                      SuExecUserGroup => "$name users",
                      CustomLog => "$doc_root/logs/access_log common",
                      ErrorLog => "$doc_root/logs/error_log",
                      ScriptAlias => "/cgi-bin/ $doc_root/cgi-bin/",
                      Directory => {
                            "$doc_root/cgi-bin" => {
                                    Options => "+ExecCGI",
                                    Order => "allow,deny",
                                    Allow => "from all"
                            }
                      }
                    };
    
                    if (-f "$doc_root/conf/httpd.conf") {
                            $$vh{Include} = "$doc_root/conf/httpd.conf";
                    }
    
                    push @{ $VirtualHost{'10.10.3.2:80'} }, $vh
            }
    }
    __END__
    </perl>
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Perl ...... yuk ...... :sick:

    I still havn't got a clue how the variables work but the main thing is it works
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: Perl ...... yuk ...... :sick:

    Still wrong forum though..

  7. #7

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Perl ...... yuk ...... :sick:

    You were too slow - I solved my problem now.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width