Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Epoch to specific output

by toolic (Bishop)
on Jan 02, 2014 at 17:01 UTC ( [id://1068988]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Epoch to specific output
in thread Epoch to specific output

Use upper case: POSIX is a Core module installed with Perl.
perl -MPOSIX -E 'say POSIX::strftime("%m%d%H%M",localtime(time()))'

Replies are listed 'Best First'.
Re^4: Epoch to specific output
by Anonymous Monk on Jan 02, 2014 at 18:19 UTC

    I am using Perl v5.8.4 on an Intel based machine with Solaris 10 64bit operating system.

    The capitalized POSIX was accepted but I am receiving other errors now.

    Input:
    perl -MPOSIX -E 'say POSIX::strftime("%m%d%H%M", localtime(1388679108))'

    Output:
    Unrecognized switch: -E (-h will show valid options).

    Input:
    perl -MPOSIX -e 'say POSIX::strftime("%m%d%H%M", localtime(1388679108))'

    Output:
    Bareword found where operator expected at -e line 1, near "say POSIX::strftime"
    (Do you need to prodeclare say?)
    Execution of -e aborted due to compilation errors.

      Your version of Perl is too old. -E requires perl 5.10. Use -e and print instead.
      perl -MPOSIX -e 'print POSIX::strftime("%m%d%H%M",localtime(time())),$ +/'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1068988]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-19 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found