in reply to Re: Re: Re: epoch time conversion
in thread epoch time conversion

If your using a *nix system, you may need to swap every occurance of the " char for a ' and vice versa. That's the only thing that comes to mind.

There's one more thing. Since there's a quoted comma in there, you should use the q() style to quote it. Update: Swapping all " for ' also works, of course, but I always use "q" and "qq" for single-line scripts like this for clarity.

perl -F, -ane 'local $,=q(,); print scalar localtime($F[0]), @F[1..$#F +] ' <junk.dat

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: epoch time conversion
by BrowserUk (Patriarch) on Dec 10, 2002 at 21:42 UTC

    It certainly wouldn't harm, though I only used single quotes because I can get away with them inside the doubles.

    Switching them to doubles and the outer quotes to singles still works in this case.


    Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
    Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
    Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
    Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.