Hi all..i have wrote a script that import from several text file into mysql..

===========================================================================

#!/usr/local/bin/perl

use CGI ':standard';
use strict;
use warnings;
use DBI;

#my $dbh = DBI->connect("dbi:mysql:ayam","root",telekom);

#Prepare the insert SQL
my $rec = $Package::dbh->prepare("INSERT INTO t_flows(ipSrc, ipDst, pktSent, 
bytesSent, startTime, endTime, srcPort, dstPort, tcpFlags, proto, tos) VALUES 
('$value1', '$value2', '$value3', '$value4', '$value5', '$value6', '$value7', 
'$value8', '$value9', '$value10', '$value11')");
$rec->execute;

my $path = "/home/roime/flow/";
my @folder = <$path>;
my $file = ".flow";

foreach my $file (@folder)
{
        my $full_path = $path.$file;
        open(FILE, $full_path)||die("Could not read file !");
        $Package::file_contents = <FILE>;
        close(FILE);

        
}

        my @file_array = split($file_contents);
        my @counter = 0;

        for each my @file_array(@counter)
        {
                my @value1 = $file_array[$counter];
                $counter = $counter + 1;
                my @value2 = $file_array[$counter];
                $counter = $counter + 1;
                my @value3 = $file_array[$counter];
                $counter = $counter + 1;
        }

======================================================

when i try to run it and try to transfer the data into variable and from the , i got 
this error on my code

"Missing $ on loop variable at texttest.pl line 31."
....Do you guys have an opinion?..



This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to