in reply to Re^2: script running on linux but not windows -- File::Spec
in thread script running on linux but not windows
An obvious problem is that colon ":" is not valid in a Windows file name. Also regardless of that issue, the complete path does look a bit suspicious to me - that path does not exist on the Windows machine I'm writing this post upon using to write this post.
As an extra updated note: I use Windows as my development platform and often move programs to a Unix environment. I try to only use file names that are compatible with both Windows and Unix.#!/usr/bin/perl use strict; use warnings; use POSIX qw(strftime); my $creationTime = strftime "%F-%R:%S", localtime; my $sqlLog = "C:/Users/thclotworthy/squirrel/logs/squirrel-sql-" . $cr +eationTime . ".log"; my $scriptLog = "C:/Users/thclotworthy/squirrel/logs/squirrel-" . $cre +ationTime . ".log"; print "$sqlLog\n$scriptLog\n"; __END__ prints: C:/Users/thclotworthy/squirrel/logs/squirrel-sql--:23.log C:/Users/thclotworthy/squirrel/logs/squirrel--:23.log
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: script running on linux but not windows -- File::Spec
by choroba (Cardinal) on Dec 21, 2017 at 15:57 UTC |