help rewrite files

help rewrite files

am 20.08.2009 19:35:58 von zilore mumba

--===============1203406899==
Content-Type: multipart/alternative; boundary="0-1954471058-1250789758=:9372"

--0-1954471058-1250789758=:9372
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Once more Dear kind Perl users, I have a small problem, being so raw in per=
l. I have binary files which contain some headers of the type nx 70 ny 1, a=
nd nxny 3542 ny 1.
I want to replace all ocurrences of nx by 71, ny by 71 and nxny by 5041.
The code below does not give any error but I end up with files of size 0 an=
d the same zero size files are copied to current directory where the scrip =
is located.
Help will be appreciated.
Zilore

#!/usr/bin/perl --

use strict;
use warnings;
use POSIX;
use File::Path;
use File::Copy;

# Variable declaration
my $debug =3D 1;

my $Grib_dir =3D "grib_files";

  =A0 my @slashes;
  =A0 my $slashes;

opendir DIR, $Grib_dir or die "opendir failed on $Grib_dir: $! ($^E)";
while ( my $item =3D readdir DIR ) {
  =A0 next if -d $item;
  =A0 # Extra filtering, to copy only grib files ending in H
  =A0 next unless $item =3D~ /\*H$/;

  =A0 open (IN, "+>$item") or die "open '$item': $! ($^E)";
  =A0 binmode IN;

  =A0 @slashes =3D ;

  =A0 for my $i (@slashes) {
      =A0 s/nx d{4} {ny 1}/{nx 71 ny 71}/g;
      =A0 s/nxny {4}{ny 1}/{nxny 5041}/g;
       }
    =A0 print IN "@slashes";
    =A0 close IN;
}
closedir DIR;

=0A
--0-1954471058-1250789758=:9372
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">Once more Dear kind Perl users, I have a smal=
l problem, being so raw in perl. I have binary files which contain some hea=
ders of the type nx 70 ny 1, and nxny 3542 ny 1.
I want to replace all o=
currences of nx by 71, ny by 71 and nxny by 5041.
The code below does no=
t give any error but I end up with files of size 0 and the same zero size f=
iles are copied to current directory where the scrip is located.
Help wi=
ll be appreciated.
Zilore

#!/usr/bin/perl --

use strict; r>use warnings;
use POSIX;
use File::Path;
use File::Copy;

=
# Variable declaration
my $debug =3D 1;

my $Grib_dir =3D "grib_fi=
les";

    my @slashes;
    my $slas=
hes;

opendir DIR, $Grib_dir or die "opendir failed on $Grib_dir: $! =
($^E)";
while ( my $item =3D readdir DIR ) {
    next =
if -d
$item;
    # Extra filtering, to copy only grib files en=
ding in H
    next unless $item =3D~ /\*H$/;

 =
;   open (IN, "+>$item") or die "open '$item': $! ($^E)";
&=
nbsp;   binmode IN;

    @slashes =3D <IN=
>;

    for my $i (@slashes) {
   =
;     s/nx d{4} {ny 1}/{nx 71 ny 71}/g;
  =
      s/nxny {4}{ny 1}/{nxny 5041}/g;
 &nb=
sp;     }
      print IN "@=
slashes";
      close IN;
}
closedir DIR;=




--0-1954471058-1250789758=:9372--


--===============1203406899==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1203406899==--

Re: help rewrite files

am 20.08.2009 21:48:18 von Bill Luebkert

zilore mumba wrote:
> Once more Dear kind Perl users, I have a small problem, being so raw in
> perl. I have binary files which contain some headers of the type nx 70
> ny 1, and nxny 3542 ny 1.
> I want to replace all ocurrences of nx by 71, ny by 71 and nxny by 5041.
> The code below does not give any error but I end up with files of size 0
> and the same zero size files are copied to current directory where the
> scrip is located.
> Help will be appreciated.

I don't follow your replacement rules, but I fixed the rest and attempted
your rules literally. I didn't attempt to change the basic logic.

use strict;
use warnings;
use POSIX;
use File::Path;
use File::Copy;

my $Grib_dir = 'grib_files';

opendir DIR, $Grib_dir or die "opendir failed on $Grib_dir: $! ($^E)";
while (my $file = readdir DIR) {

next if -d $file;

# Extra filtering, to copy only grib files ending in H
next unless $file =~ /H$/;

print "Doing $file\n" if $debug;
my @lines = ();
open IN, "+<$Grib_dir/$file" or die "open '$file': $! ($^E)";
binmode IN;
while () {

# s/nxny {4}{ny 1}/{nxny 5041}/g; # ?????
# s/nx d{4} {ny 1}/{nx 71 ny 71}/g; # ?????

# your stated rules (probably more to it than you stated):
# nxny => 5041
# nx => 71
# ny => 71

s/nxny/5041/g;
s/(nx|ny)/71/g;
push @lines, $_;
}
seek IN, SEEK_SET, 0; # rewind file
print IN @lines;
close IN;
}
closedir DIR;

__END__
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Fastest Path

am 20.08.2009 22:19:37 von anthony.okusanya

This is a multipart message in MIME format.
--===============1472795095==
Content-Type: multipart/alternative;
boundary="=_alternative 006FA9EB86257618_="

This is a multipart message in MIME format.
--=_alternative 006FA9EB86257618_=
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii

Perl Guru's I greet you.
I am putting together a script which I would be using to update
Windows servers as part of a build process.
I have multiple mirrored shares across my network
My goal is to have this script run and determine the fastest/closest
update share
that it can use to download updates from
Can you think of any modules that can help me with this ?

As of now (design phase)
I was thinking of the pseudocode
1. Launch script
2. query host for its IP
3a use static table to determine which is its best share
(problem with this is I have to compile a list of IP network values and
determine which share best servers which network)
OR
3b. Ping each update server and return the one with the least number of
hops or the one with the fastest response time.


Any ideas would be appreciated.




Tony B. Okusanya

U.S. BANCORP made the following annotations
------------------------------------------------------------ ---------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.



------------------------------------------------------------ ---------


--=_alternative 006FA9EB86257618_=
Content-Transfer-Encoding: 7bit
Content-Type: text/html;
charset=us-ascii



Perl Guru's I greet you.

        I
am putting together a script which I would be using to update


Windows servers as part of a build process.


I have multiple mirrored shares across
my network


My goal is to have this script run and
determine the fastest/closest update share


that it can use to download  updates
from


Can you think of any modules that can
help me with this ?




As of now (design phase)

I was thinking of the pseudocode

1. Launch script

2. query host for its IP

3a use static table to determine which
is its best share


(problem with this is I have to compile
a list of IP network values and determine which share best servers which
network)


OR

3b. Ping each update server and return
the one with the least number of hops or the one with the fastest response
time.






Any ideas would be appreciated.









Tony B. Okusanya


U.S. BANCORP made the following annotations
------------------------------------------------------------ ---------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.



------------------------------------------------------------ ---------


--=_alternative 006FA9EB86257618_=--

--===============1472795095==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1472795095==--

Re: help rewrite files

am 21.08.2009 11:49:23 von zilore mumba

--===============1151457870==
Content-Type: multipart/alternative; boundary="0-1694465003-1250848163=:78162"

--0-1694465003-1250848163=:78162
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Thanks Bill for your time and effort.
Sorry the explanation of what am trying to do was not clear.

In the files I have fields which will appear as "nxny d1d1d1d1 d2d2d2d2"

d1d1d1d1 and d2d2d2d2 are two digit numbers.

d1d1d1d1. is always the same number (71x71=3D5041) and I want to keep,=0Abu=
t d2d2d2d2. will vary from file to file, I want get rid of it.

I want to keep "nxny d2d2d2d2"=A0 (n° of points in x and y directions)

Later in the file I get "nxny d2d2d2d2", which I want to change to "nxny 50=
41"

and "nx d2d2d2d2 ny 1" to change to "nx 71 ny 71"

and "(d2d2d2d2 x 1)" to be changed to "(71 x 71)"

Thanks in advance for your time
Zilore



--- On Thu, 8/20/09, Bill Luebkert wrote:

From: Bill Luebkert
Subject: Re: help rewrite files
To: "zilore mumba"
Cc: activeperl@listserv.activestate.com
Date: Thursday, August 20, 2009, 10:48 PM

zilore mumba wrote:
> Once more Dear kind Perl users, I have a small problem, being so raw in p=
erl. I have binary files which contain some headers of the type nx 70 ny 1,=
and nxny 3542 ny 1.
> I want to replace all ocurrences of nx by 71, ny by 71 and nxny by 5041.
> The code below does not give any error but I end up with files of size 0 =
and the same zero size files are copied to current directory where the scri=
p is located.
> Help will be appreciated.

I don't follow your replacement rules, but I fixed the rest and attempted
your rules literally.=A0 I didn't attempt to change the basic logic.

use strict;
use warnings;
use POSIX;
use File::Path;
use File::Copy;

my $Grib_dir =3D 'grib_files';

opendir DIR, $Grib_dir or die "opendir failed on $Grib_dir: $! ($^E)";
while (my $file =3D readdir DIR) {

  =A0 next if -d $file;

  =A0 # Extra filtering, to copy only grib files ending in H
  =A0 next unless $file =3D~ /H$/;

  =A0 print "Doing $file\n" if $debug;
  =A0 my @lines =3D ();
  =A0 open IN, "+<$Grib_dir/$file" or die "open '$file': $! ($^E)";
  =A0 binmode IN;
  =A0 while () {

#   =A0   =A0 s/nxny {4}{ny 1}/{nxny 5041}/g;  =A0   =A0 # =
?????
#   =A0   =A0 s/nx d{4} {ny 1}/{nx 71 ny 71}/g;  =A0 # ?????

  =A0   =A0 # your stated rules (probably more to it than you state=
d):
  =A0   =A0 #   =A0 nxny =3D> 5041
  =A0   =A0 #   =A0 nx =3D> 71
  =A0   =A0 #   =A0 ny =3D> 71

  =A0   =A0 s/nxny/5041/g;
  =A0   =A0 s/(nx|ny)/71/g;
  =A0   =A0 push @lines, $_;
  =A0 }
  =A0 seek IN, SEEK_SET, 0;  =A0   =A0 # rewind file
  =A0 print IN @lines;
  =A0 close IN;
}
closedir DIR;

__END__
=0A
--0-1694465003-1250848163=:78162
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

top" style=3D"font: inherit;">Thanks Bill for your time and effort.
Sorr=
y the explanation of what am trying to do was not clear.

In the file=
s I have fields which will appear as "nxny d1d1d1d1 d2d2d2d2"

d1d1d1=
d1 and d2d2d2d2 are two digit numbers.

d1d1d1d1. is always the same =
number (71x71=3D5041) and I want to keep,=0Abut d2d2d2d2. will vary from fi=
le to file, I want get rid of it.

I want to keep "nxny d2d2d2d2"&nbs=
p; (n° of points in x and y directions)

Later in the file I get "n=
xny d2d2d2d2", which I want to change to "nxny 5041"

and "nx d2d2d2d=
2 ny 1" to change to "nx 71 ny 71"

and "(d2d2d2d2 x 1)" to be change=
d to "(71 x 71)"

Thanks in advance for your time
Zilore

r>
--- On Thu, 8/20/09, Bill Luebkert <dbecoll@roadrunner.com&g=
t;
wrote:
, 255); margin-left: 5px; padding-left: 5px;">
From: Bill Luebkert <d=
becoll@roadrunner.com>
Subject: Re: help rewrite files
To: "zilore=
mumba" <zmumba@yahoo.com>
Cc: activeperl@listserv.activestate.com=

Date: Thursday, August 20, 2009, 10:48 PM

l">zilore mumba wrote:
> Once more Dear kind Perl users, I have a sma=
ll problem, being so raw in perl. I have
binary files which contain some headers of the type nx 70 ny 1, and nxny 3=
542 ny 1.
> I want to replace all ocurrences of nx by 71, ny by 71 an=
d nxny by 5041.
> The code below does not give any error but I end up=
with files of size 0 and the same zero size files are copied to current di=
rectory where the scrip is located.
> Help will be appreciated.
r>I don't follow your replacement rules, but I fixed the rest and attempted=

your rules literally.  I didn't attempt to change the basic logic.=


use strict;
use warnings;
use POSIX;
use File::Path;
us=
e File::Copy;

my $Grib_dir =3D 'grib_files';

opendir DIR, $Gr=
ib_dir or die "opendir failed on $Grib_dir: $! ($^E)";
while (my $file =
=3D readdir DIR) {

    next if -d $file;

 =
;   # Extra filtering, to copy only grib files ending in H
&nb=
sp;   next unless $file =3D~ /H$/;

   
print "Doing $file\n" if $debug;
    my @lines =3D (); r>    open IN, "+<$Grib_dir/$file" or die "open '$file': =
$! ($^E)";
    binmode IN;
    while (&=
lt;IN>) {

#         s/nxny {4}{ny 1=
}/{nxny 5041}/g;        # ?????
#  &n=
bsp;      s/nx d{4} {ny 1}/{nx 71 ny 71}/g;  =
  # ?????

        # your stated r=
ules (probably more to it than you stated):
     &nb=
sp;  #     nxny =3D> 5041
    &nbs=
p;   #     nx =3D> 71
    &nb=
sp;   #     ny =3D> 71

  &nbs=
p;     s/nxny/5041/g;
      &nb=
sp; s/(nx|ny)/71/g;
        push @lines,
$_;
    }
    seek IN, SEEK_SET, 0;&nb=
sp;       # rewind file
    prin=
t IN @lines;
    close IN;
}
closedir DIR;

_=
_END__


--0-1694465003-1250848163=:78162--


--===============1151457870==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1151457870==--

RE: Fastest Path

am 21.08.2009 16:05:54 von Ken Cornetet

--===============0932804671==
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_DF6A68E27C9C734592018E2317E9583678925C7Bnts53 2kiikimbal_"

--_000_DF6A68E27C9C734592018E2317E9583678925C7Bnts532kiikimb al_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

You are trying to solve the problem on the wrong end, let windows do it for=
you - look into DFS http://www.microsoft.com/windowsserver2003/technologie=
s/storage/dfs/default.mspx

If DFS is not an option, then you have a few choices:


1. As you mentioned, use a database of some sort (could be a flat fil=
e, web service, database table, etc) that maps a particular IP subnet to a =
file server.

2. The other option you mention, ping, might work as well, so long as=
you are using a large packet when you ping. See the docs for Net::Ping.

The way we used to do this was to put our data share on domain controllers =
(because most every remote site had a domain controller). Client applicatio=
ns would then reference the share as %LOGONSERVER%\DATASHARE\...

If your ActiveDirectory sites are properly defined, %LOGONSERVER will be th=
e "closest" domain controller.



From: activeperl-bounces@listserv.ActiveState.com [mailto:activeperl-bounce=
s@listserv.ActiveState.com] On Behalf Of anthony.okusanya@usbank.com
Sent: Thursday, August 20, 2009 4:20 PM
To: activeperl@listserv.activestate.com
Subject: Fastest Path


Perl Guru's I greet you.
I am putting together a script which I would be using to update
Windows servers as part of a build process.
I have multiple mirrored shares across my network
My goal is to have this script run and determine the fastest/closest update=
share
that it can use to download updates from
Can you think of any modules that can help me with this ?

As of now (design phase)
I was thinking of the pseudocode
1. Launch script
2. query host for its IP
3a use static table to determine which is its best share
(problem with this is I have to compile a list of IP network values and det=
ermine which share best servers which network)
OR
3b. Ping each update server and return the one with the least number of hop=
s or the one with the fastest response time.


Any ideas would be appreciated.




Tony B. Okusanya

U.S. BANCORP made the following annotations
------------------------------------------------------------ ---------
Electronic Privacy Notice. This e-mail, and any attachments, contains infor=
mation that is, or may be, covered by electronic communications privacy law=
s, and is also confidential and proprietary in nature. If you are not the i=
ntended recipient, please be advised that you are legally prohibited from r=
etaining, using, copying, distributing, or otherwise disclosing this inform=
ation in any manner. Instead, please reply to the sender that you have rece=
ived this communication in error, and then immediately delete it. Thank you=
in advance for your cooperation.

------------------------------------------------------------ ---------

--_000_DF6A68E27C9C734592018E2317E9583678925C7Bnts532kiikimb al_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:p=3D"urn:schemas-m=
icrosoft-com:office:powerpoint" xmlns:a=3D"urn:schemas-microsoft-com:office=
:access" xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s=3D"=
uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs=3D"urn:schemas-microsof=
t-com:rowset" xmlns:z=3D"#RowsetSchema" xmlns:b=3D"urn:schemas-microsoft-co=
m:office:publisher" xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadshee=
t" xmlns:c=3D"urn:schemas-microsoft-com:office:component:spread sheet" xmlns=
:odc=3D"urn:schemas-microsoft-com:office:odc" xmlns:oa=3D"urn:schemas-micro=
soft-com:office:activation" xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc=3D"http://m=
icrosoft.com/officenet/conferencing" xmlns:D=3D"DAV:" xmlns:Repl=3D"http://=
schemas.microsoft.com/repl/" xmlns:mt=3D"http://schemas.microsoft.com/share=
point/soap/meetings/" xmlns:x2=3D"http://schemas.microsoft.com/office/excel=
/2003/xml" xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" xmlns:ois=
=3D"http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir=3D"http://=
schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds=3D"http://www.w3=
..org/2000/09/xmldsig#" xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint=
/dsp" xmlns:udc=3D"http://schemas.microsoft.com/data/udc" xmlns:xsd=3D"http=
://www.w3.org/2001/XMLSchema" xmlns:sub=3D"http://schemas.microsoft.com/sha=
repoint/soap/2002/1/alerts/" xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#"=
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" xmlns:sps=3D"http://=
schemas.microsoft.com/sharepoint/soap/" xmlns:xsi=3D"http://www.w3.org/2001=
/XMLSchema-instance" xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/so=
ap" xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile " xmlns:udc=
p2p=3D"http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf=3D"http:/=
/schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss=3D"http://sche=
mas.microsoft.com/office/2006/digsig-setup" xmlns:dssi=3D"http://schemas.mi=
crosoft.com/office/2006/digsig" xmlns:mdssi=3D"http://schemas.openxmlformat=
s.org/package/2006/digital-signature" xmlns:mver=3D"http://schemas.openxmlf=
ormats.org/markup-compatibility/2006" xmlns:m=3D"http://schemas.microsoft.c=
om/office/2004/12/omml" xmlns:mrels=3D"http://schemas.openxmlformats.org/pa=
ckage/2006/relationships" xmlns:spwp=3D"http://microsoft.com/sharepoint/web=
partpages" xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/service s/20=
06/types" xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/service s/200=
6/messages" xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/ Sli=
deLibrary/" xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPor tal=
Server/PublishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" xmlns:=
st=3D"" xmlns=3D"http://www.w3.org/TR/REC-html40">












"sans-serif";
color:#1F497D'>You are trying to solve the problem on the wrong end, let
windows do it for you – look into DFS href=3D"http://www.microsoft.com/windowsserver2003/technolog ies/storage/dfs=
/default.mspx">http://www.microsoft.com/windowsserver2003/te chnologies/stor=
age/dfs/default.mspx



"sans-serif";
color:#1F497D'> 



"sans-serif";
color:#1F497D'>If DFS is not an option, then you have a few choices: o:p>



"sans-serif";
color:#1F497D'> 



lfo1'> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497D'=
> style=3D'mso-list:Ignore'>1.&n=
bsp;     
"Calibri","sans-serif";
color:#1F497D'>As you mentioned, use a database of some sort (could be a fl=
at
file, web service, database table, etc) that maps a particular IP subnet to=
a
file server.



lfo1'> style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497D'=
> style=3D'mso-list:Ignore'>2.&n=
bsp;     
"Calibri","sans-serif";
color:#1F497D'>The other option you mention, ping, might work as well, so l=
ong
as you are using a large packet when you ping. See the docs for Net::Ping.<=
o:p>



"sans-serif";
color:#1F497D'> 



"sans-serif";
color:#1F497D'>The way we used to do this was to put our data share on doma=
in
controllers (because most every remote site had a domain controller). Clien=
t
applications would then reference the share as %LOGONSERVER%\DATASHARE\...<=
o:p>



"sans-serif";
color:#1F497D'> 



"sans-serif";
color:#1F497D'>If your ActiveDirectory sites are properly defined, %LOGONSE=
RVER
will be the “closest” domain controller.



"sans-serif";
color:#1F497D'> 



"sans-serif";
color:#1F497D'> 



"sans-serif";
color:#1F497D'> 



0in 0in'>

","sans-serif"'>From: style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' > activeperl-bo=
unces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of an=
thony.okusanya@usbank.com

Sent: Thursday, August 20, 2009 4:20 PM

To: activeperl@listserv.activestate.com

Subject: Fastest Path





 





Perl Guru=
's I
greet you.


  &n=
bsp;
    I am putting together a script which I would be using to upda=
te



Windows s=
ervers
as part of a build process.


I have mu=
ltiple
mirrored shares across my network


My goal i=
s to
have this script run and determine the fastest/closest update share
=


that it c=
an use
to download  updates from


Can you t=
hink
of any modules that can help me with this ?




As of now
(design phase)


I was thi=
nking
of the pseudocode


1. Launch
script


2. query =
host
for its IP


3a use st=
atic
table to determine which is its best share


(problem =
with
this is I have to compile a list of IP network values and determine which s=
hare
best servers which network)


OR=


3b. Ping =
each
update server and return the one with the least number of hops or the one w=
ith
the fastest response time.






Any ideas=
would
be appreciated.










Tony B. Okusanya



U.S. BANCORP made the following annotations

------------------------------------------------------------ ---------

Electroni=
c
Privacy Notice. This e-mail, and any attachments, contains information that=
is,
or may be, covered by electronic communications privacy laws, and is also
confidential and proprietary in nature. If you are not the intended recipie=
nt,
please be advised that you are legally prohibited from retaining, using,
copying, distributing, or otherwise disclosing this information in any mann=
er.
Instead, please reply to the sender that you have received this communicati=
on
in error, and then immediately delete it. Thank you in advance for your coo=
peration.




------------------------------------------------------------ ---------<=
/o:p>









--_000_DF6A68E27C9C734592018E2317E9583678925C7Bnts532kiikimb al_--

--===============0932804671==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0932804671==--