In an earlier thread I was shown how to strip spaces from a field. I also need to strip &,_,- from the output. Dbman does not like characters in the logon field.
while ($record = $sth->fetchrow_arrayref() ) {
$record->[0] =~ s/ //g;
$record->[0] =~ s/_//g;
$record->[0] =~ s/-//g;
$record->[0] =~ s/&//g;
$record->[0] =~ s/*//g;
print OUTFILE "$record->[0]:$record->[1]:$record->[2]:$record->[3]:$record->[4]:$record->[5]:$record->[6]\n";
}Above is what I tried, but it managed to drop all the data from the entry. Is there a syntax I am missing to make it perform all at once?
Thanks Dale
Code:
my $record; while ($record = $sth->fetchrow_arrayref() ) {
$record->[0] =~ s/ //g;
$record->[0] =~ s/_//g;
$record->[0] =~ s/-//g;
$record->[0] =~ s/&//g;
$record->[0] =~ s/*//g;
print OUTFILE "$record->[0]:$record->[1]:$record->[2]:$record->[3]:$record->[4]:$record->[5]:$record->[6]\n";
}
Thanks Dale