FAQ
Quick question, I have a chunk of code from a previous coder:

$member = $dbh->selectrow_array( <<"SQL" );
SELECT whatever FROM DATA
SQL

I'm not familiar with the syntax? Is the <<"SQL" string just replaced
by the text up to the "SQL" on a line by itself so functionally it
could
be written:

$member = $dbh->selectrow_array
("SELECT whatever FROM DATA");

and if so why do it the other way, perhaps because it's easier to
form a long length query?

$member = $dbh->selectrow_array( <<"SQL" );
SELECT whatever ...
more
more etc.
SQL

Don

Search Discussions

  • Peter J. Holzer at Aug 11, 2008 at 11:20 am

    On 2008-08-10 08:07:53 -0700, dshesnicky@yahoo.com wrote:
    Quick question, I have a chunk of code from a previous coder:

    $member = $dbh->selectrow_array( <<"SQL" );
    SELECT whatever FROM DATA
    SQL

    I'm not familiar with the syntax?
    See perldoc perlop, "Quote-Like Operators".

    hp

    --
    _ | Peter J. Holzer | Am Anfang war der Bug und der
    _|_) | Sysadmin WSR | Verantwortliche sprach:
    hjp@wsr.ac.at | Es werde ein Testcase.
    __/ | http://www.hjp.at/ | -- Clemens Zauner in dcii
  • Dshesnicky at Aug 11, 2008 at 6:50 pm

    Quick question, I have a chunk of code from a previous coder:
    $member = $dbh->selectrow_array( <<"SQL" );
    SELECT whatever FROM DATA
    SQL
    I'm not familiar with the syntax?
    See perldoc perlop, "Quote-Like Operators".
    Perfect Peter, thanks for the pointer. Didn't realize, but should
    have, that it was perl code.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbi-users @
categoriesperl
postedAug 10, '08 at 3:08p
activeAug 11, '08 at 6:50p
posts3
users2
websitedbi.perl.org

2 users in discussion

Dshesnicky: 2 posts Peter J. Holzer: 1 post

People

Translate

site design / logo © 2022 Grokbase