Sara has asked for the wisdom of the Perl Monks concerning the following question:

hello guys ,,thanks for help , this command work
system qw(updquery -sdate $sdate -edate $edate -brtype golden -status +closed);
but :( it dosent know what $sdate and $edate ,, I tried all possible things `` '' "" but no luck so far any tips ... thanks

Replies are listed 'Best First'.
Re: system qw()
by Aristotle (Chancellor) on Jul 08, 2002 at 18:40 UTC
    That's completely expected with qw() as it disables all variable interpolation. It simply splits the string on white space and turns that into a list of values - convenient since rather than "bla", "bla", "bla", you can just write qw(bla bla bla). In this case, to get the variable values, just close the qw() for a second: system(qw(updquery -sdate), $sdate, "-edate", $edate, qw(-brtype golden -status closed)); You could just mash it all into a string for less typing, but using a list when calling system is good practice. See perldoc -f system.

    Makeshifts last the longest.

Re: system qw()
by Rich36 (Chaplain) on Jul 08, 2002 at 18:43 UTC

    Try qq(). That indicates a literal string ( same as a double quoted string), which will interpolate the variables in the string. qw() is a word list, and does not interpolate variables.


    «Rich36»