in reply to Re: format function
in thread format function

The bare @'s in the format aren't syntactically correct.
Can you elaborate on that? They seem to work just fine, and how else would one get a single-character field anyway? The relevant doc is not specific on this, but I see that the Notes section has an example of a lone @ as a field. Your example works fine with the extra < removed, giving the expected output of the single most significant digit.

For that matter mhearse's example worked just fine for me also, once I removed the excess @ fields, so I suspect something else is going on in his case.

--
I'd like to be able to assign to an luser

Replies are listed 'Best First'.
Re: Re: Re: format function
by jmcnamara (Monsignor) on Oct 02, 2003 at 07:27 UTC

    You are correct. They are valid.

    When I ran mhearse's example code I got the following error:

    Array found where operator expected at format.pl line 17, at end of +line (Missing operator before ?) syntax error at format.pl line 17, near "@ @ @ @ "
    I misinterpreted this to mean that the bare @'s were the problem. However, as you point out, they are in fact valid and the error comes from the line wrapping around.

    In which case, I can't say what is the problem. Setting $= to 600 or any other value works fine for me with perls from 5.00405 onwards.

    --
    John.

      Thanks for the suggestions. This is a strange situation. The system I am working with is an older Solaris 7 server. For some reason, it only has the perl executable, not the full distro. This may be part of the problem.