in reply to match expression from query

It is not an error but a warning. A regex will only make sense when applied on a scalar, not on an array, so Perl "decided" that you really meant scalar(@{$sth->{NAME}}). It warns you that it has applied this "correction".

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^2: match expression from query (m//atch operator)
by Anonymous Monk on Sep 20, 2013 at 01:07 UTC

    A regex will only make sense when applied on a scalar, not on an array,

    The m//atch operator applies a regex against a scalar

    The s///ubstitution operator applies a regex against a scalar

    The regex is the stuff in between m/ and /

    The m// is the match operator, the regex is the argument to the match operator match('regex')

Re^2: match expression from query
by PerlSufi (Friar) on Sep 19, 2013 at 19:16 UTC
    Ah. Thank you, CountZero. You're right. Changing it to that in my script did make it run, but no output was given when I ran it.