in reply to still can't create a file using a variable

Are all the characters in your filename legal for your platform? On Windows, for instance, you can't use the ':' character in a filename except after a one-character volume name. Best to use $! and print out error messages, as others have suggested. You also may want to use a numeric timestamp instead.
  • Comment on Re: still can't create a file using a variable

Replies are listed 'Best First'.
Re: Re: still can't create a file using a variable
by particle (Vicar) on Jun 25, 2001 at 23:09 UTC
    i created a datetime constant for use in a few of my scripts that run on Win32 && *NIX, for use in creating temporary directories and files. here's a snippet you may find helpful.
    use POSIX; use constant DATETIME => strftime("%Y-%m-%d_%H-%M-%S", localtime);
    this returns something like "2001-06-25_15-07-32"
    your mileage may vary

    ~Particle