Narveson has asked for the wisdom of the Perl Monks concerning the following question:
Update: Thanks, BrowserUK and ikegami, for the Perl wisdom.
My team is migrating from Windows Server 2003 to Windows Server 2008. We run the same ActiveState build of Perl 5.8.9 in both operating systems (verified using perl -V). Here is a transcript from the old server. Note the incorrect format string:
>perl -e "use POSIX; print qq(POSIX version $POSIX::VERSION\n); print + (strftime '%Y%m%d%', localtime)" POSIX version 1.1501 20100825 >
Here is the same little test run on the new server:
>perl -e "use POSIX; print qq(POSIX version $POSIX::VERSION\n); print +(strftime '%Y%m%d%', localtime)" POSIX version 1.1501 %Y%m%d% >
We had a program with this incorrect format string that nevertheless ran as intended on the old server, but of course it misbehaved badly on the new server.
Isn't POSIX supposed to give platform-independent results?
If it is argued that the test suites for POSIX only cover valid input, so with bad input all bets are off - then shouldn't POSIX::strftime blow up when it is given a malformed format string?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Platform-dependent behavior observed in POSIX::strftime
by BrowserUk (Patriarch) on Aug 25, 2010 at 18:36 UTC | |
|
Re: Platform-dependent behavior observed in POSIX::strftime
by ikegami (Patriarch) on Aug 25, 2010 at 18:55 UTC | |
|
Re: Platform-dependent behavior observed in POSIX::strftime
by zentara (Cardinal) on Aug 25, 2010 at 16:11 UTC | |
by Narveson (Chaplain) on Aug 25, 2010 at 17:32 UTC | |
by zentara (Cardinal) on Aug 25, 2010 at 19:44 UTC |