in reply to Re^2: Perl database access
in thread Perl database access
You're welcome
<<';' is just like the <<EOF you've used elsewhere in your program, except the single quotes mean $ and @ won't be treated as variables, and it's ends with a line containing only ';' (and no spaces). In other words, the statement in question compiles to exactly the same as:
my $spdtrap_stmt = 'SELECT id,' . "\n" . ' state,' . "\n" . ' city,' . "\n" . ' discription' . "\n" . ' FROM speedtrap' . "\n" . ' WHERE state = ?' . "\n";
SQL doesn't care about tabs (not used) and newlines outside of quote strings; it just treats them as another space. So the statement in question is functionally equivalent to what's below, but easier way to read:
my $spdtrap_stmt = 'SELECT id, state, city, discription FROM speedtrap + WHERE state = ?';
|
|---|