[Dxspider-support] basic Perl programming question
Dirk Koopman
djk at tobit.co.uk
Mon Apr 28 18:43:59 BST 2003
On Mon, 2003-04-28 at 18:19, Brendan Minish wrote:
> Hi Everyone,
> I have been experimenting with adding my own user command to do
> SH/FDX
>
> I have created a new command called FDX which is a copy of the existing DX
> command with a new sub near the begining to define the output format to be used
>
> sub formatf
> {
> my $t = ztime($_[2]);
> my $d = cldate($_[2]);
> return sprintf "DX de %-7.7s%11.1f %-12.12s %-s $t", "$_[4]:", $_[0],
> $_[1], $_[3] ;
> }
>
>
>
> I have never done any perl before so please forgive this basic question,
>
> How do I position $t (the time variable ) a fixed no of characters from the
> beginning?
To make it the same, copy the code from Spot::formatl (in Spot.pm)
But the above code isn't reliable and isn't portable.
The best way to do this is actually to have another option on the sh/dx
command line and then alias that as sh/fdx
Dirk
--
Please Note: Some Quantum Physics Theories Suggest That When the
Consumer Is Not Directly Observing This Product, It May Cease to
Exist or Will Exist Only in a Vague and Undetermined State.
More information about the Dxspider-support
mailing list