[Dxspider-support] basic Perl programming question

Brendan Minish ei6iz at newsguy.com
Mon Apr 28 19:39:09 BST 2003


Hi Dirk

Thanks for the help

I now have

sub formatf
{
         my $t = ztime($_[2]);
         my $d = cldate($_[2]);
         return sprintf "DX de %-7.7s%11.1f  %-12.12s %-28.28s %7s ", 
"$_[4]:", $_[0], $_[1], $_[3], $t ;

}

this works ok although of course it does not handle things like locators 
and US State info

the new command is in
C:\spider\local_cmd\show
and is called
fdx.pl

I agree completely that this isn't the best way to implement this but I did 
end up learning a little about perl today so it can't be all bad <g>


73
Brendan

At 18:43 28/04/2003 +0100, Dirk wrote:
>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




More information about the Dxspider-support mailing list