in reply to Printing to file

You'll want to use ${store} within the double quotes, or else perl will interpolate the entire $store_pdf as the variable name. You'd catch this with use strict (See docs as well as related tutorials in Tutorials.

Replies are listed 'Best First'.
Re^2: Printing to file
by Anonymous Monk on Jul 12, 2006 at 17:49 UTC
    I tried using both ($store) and ${store} but they both seem to give me the same error. Error : "Cannot open weekly_"24","25"_pdf.sas to read from"
      On to the next error :-)

      qw() creates an array, from items separated by whitespace. Quotes and commas in qw() are usually a mistake. You want:

      my @all_stores = qw(24 25);
      Or if, e.g., you wanted more stores (e.g. 10 to 99):
      my @all_stores = (10..99); # or even ("10".."99")
      That's due to how you're setting up your @all_stores array. You're mixing up the qw and standard array syntaxes. You need either:
      @all_stores = ("24", "25");
      *or*
      @all_stores = qw(24 25);

      Try put use strict;
      @all_stores = qw("24", "25"); will produce error. Try my @all_stores = qw(24 25); instead

      "The giving hands is better than the one accepting" - Muslim's cleric