in reply to Expanding a variable

I doubt you tried using double quotes, if you had your script would have opened a file of the right name, perhaps you mis-understood someone's instruction, the open command should read
open (MYFILE, '>>', "Z:/My Documents/Workspace/$test.csv");
The three parameter version, while not strictly needed in this instance is nicer as it avoids clobbering files if the string ends up starting with a > by mistake.

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Replies are listed 'Best First'.
Re^2: Expanding a variable
by moritz (Cardinal) on Sep 09, 2010 at 14:01 UTC
    Have you tested your code?
    $ perl -E 'my $x = 3; say "foo\$x"' foo$x

    (Agreed on the thre-argument open though)

    Perl 6 - links to (nearly) everything that is Perl 6.
      Edited to fix, no windows sys handy, so I forgot the obvious error.
      print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."