in reply to how to store text file information into my sql database

It looks like your data may be tab delimited, so try changing the split parameter, like this:

while (<$fh>){ chomp; my @vals = split /\t/; $sth->execute(@vals); }

Replies are listed 'Best First'.
Re^2: how to store text file information into my sql database
by hotchiwawa (Scribe) on Dec 31, 2015 at 15:08 UTC

    To split on \t seems the solution at your problem (already posted above).

    my $query = 'INSERT INTO student (StudentId,Name,Dept,address,city) VA +LUES (?,?,?,?,?)';

    but the quote delimiter in this code is weak and could break easely. "insert..... "; is better.

    why don't you replace all ' by \' in the values ?

    Peace
      but the quote delimiter in this code is weak and could break easely. "insert..... "; is better.

      Why are double quotes better when there are no variables to interpolate ?

      poj