help rewrite files

--===============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=A0=A0 my [at] slashes;
=A0=A0=A0 my $slashes;

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

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

=A0=A0=A0 [at] slashes =3D <IN>;

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

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

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
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.<br>I want to replace all o=
currences of nx by 71, ny by 71 and nxny by 5041.<br>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.<br>Help wi=
ll be appreciated.<br>Zilore<br><br>#!/usr/bin/perl --<br><br>use strict;<b=
r>use warnings;<br>use POSIX;<br>use File::Path;<br>use File::Copy;<br><br>=
# Variable declaration<br>my $debug =3D 1;<br><br>my $Grib_dir =3D "grib_fi=
les";<br><br>    my [at] slashes;<br>    my $slas=
hes;<br><br>opendir DIR, $Grib_dir or die "opendir failed on $Grib_dir: $! =
($^E)";<br>while ( my $item =3D readdir DIR ) {<br>    next =
if -d
$item;<br>    # Extra filtering, to copy only grib files en=
ding in H<br>    next unless $item =3D~ /\*H$/;<br><br> =
;   open (IN, "+>$item") or die "open '$item': $! ($^E)";<br>&=
nbsp;   binmode IN;<br><br>    [at] slashes =3D <IN=
>;<br><br>    for my $i ( [at] slashes) {<br>   =
;     s/nx d{4} {ny 1}/{nx 71 ny 71}/g;<br>  =
      s/nxny {4}{ny 1}/{nxny 5041}/g;<br> &nb=
sp;     }<br>      print IN " [at] =
slashes";<br>      close IN;<br>}<br>closedir DIR;=
<br><br></td></tr></table><br>=0A=0A
--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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1203406899==--
zilore mumba [ Do, 20 August 2009 19:35 ] [ ID #2012915 ]

Re: help rewrite files

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 [at] lines = ();
open IN, "+<$Grib_dir/$file" or die "open '$file': $! ($^E)";
binmode IN;
while (<IN>) {

# 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 [at] lines, $_;
}
seek IN, SEEK_SET, 0; # rewind file
print IN [at] lines;
close IN;
}
closedir DIR;

__END__
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Bill Luebkert [ Do, 20 August 2009 21:48 ] [ ID #2012916 ]

Fastest Path

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


<br><font size=2 face="sans-serif">Perl Guru's I greet you.</font>
<br><font size=2 face="sans-serif">        I
am putting together a script which I would be using to update</font>
<br><font size=2 face="sans-serif">Windows servers as part of a build process.
</font>
<br><font size=2 face="sans-serif">I have multiple mirrored shares across
my network</font>
<br><font size=2 face="sans-serif">My goal is to have this script run and
determine the fastest/closest update share</font>
<br><font size=2 face="sans-serif">that it can use to download  updates
from</font>
<br><font size=2 face="sans-serif">Can you think of any modules that can
help me with this ?</font>
<br>
<br><font size=2 face="sans-serif">As of now (design phase)</font>
<br><font size=2 face="sans-serif">I was thinking of the pseudocode</font>
<br><font size=2 face="sans-serif">1. Launch script</font>
<br><font size=2 face="sans-serif">2. query host for its IP</font>
<br><font size=2 face="sans-serif">3a use static table to determine which
is its best share </font>
<br><font size=2 face="sans-serif">(problem with this is I have to compile
a list of IP network values and determine which share best servers which
network)</font>
<br><font size=2 face="sans-serif">OR</font>
<br><font size=2 face="sans-serif">3b. Ping each update server and return
the one with the least number of hops or the one with the fastest response
time.</font>
<br>
<br>
<br><font size=2 face="sans-serif">Any ideas would be appreciated.</font>
<br><font size=2 face="sans-serif"><br>
<br>
<br>
<br>
Tony B. Okusanya<br>
</font>
<P>U.S. BANCORP made the following annotations<br/> ------------------------------------------------------------ ---------<br/><font face="Arial" size=2>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.</font><br>
<br>
------------------------------------------------------------ ---------<br/>
</P>
--=_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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1472795095==--
anthony.okusanya [ Do, 20 August 2009 22:19 ] [ ID #2012917 ]

Re: help rewrite files

--===============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=B0 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 <dbecoll [at] roadrunner.com> wrote:

From: Bill Luebkert <dbecoll [at] roadrunner.com>
Subject: Re: help rewrite files
To: "zilore mumba" <zmumba [at] yahoo.com>
Cc: activeperl [at] 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=A0=A0 next if -d $file;

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

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

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

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

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

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

<table cellspacing=3D"0" cellpadding=3D"0" border=3D"0" ><tr><td valign=3D"=
top" style=3D"font: inherit;">Thanks Bill for your time and effort.<br>Sorr=
y the explanation of what am trying to do was not clear.<br><br>In the file=
s I have fields which will appear as "nxny d1d1d1d1 d2d2d2d2"<br><br>d1d1d1=
d1 and d2d2d2d2 are two digit numbers.<br><br>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.<br><br>I want to keep "nxny d2d2d2d2"&nbs=
p; (n=B0 of points in x and y directions)<br><br>Later in the file I get "n=
xny d2d2d2d2", which I want to change to "nxny 5041"<br><br>and "nx d2d2d2d=
2 ny 1" to change to "nx 71 ny 71"<br><br>and "(d2d2d2d2 x 1)" to be change=
d to "(71 x 71)"<br><br>Thanks in advance for your time<br>Zilore<br><br><b=
r><br>--- On <b>Thu, 8/20/09, Bill Luebkert <i><dbecoll [at] roadrunner.com&g=
t;</i></b> wrote:<br><blockquote style=3D"border-left: 2px solid rgb(16, 16=
, 255); margin-left: 5px; padding-left: 5px;"><br>From: Bill Luebkert <d=
becoll [at] roadrunner.com><br>Subject: Re: help rewrite files<br>To: "zilore=
mumba" <zmumba [at] yahoo.com><br>Cc: activeperl [at] listserv.activestate.com=
<br>Date: Thursday, August 20, 2009, 10:48 PM<br><br><div class=3D"plainMai=
l">zilore mumba wrote:<br>> 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.<br>> I want to replace all ocurrences of nx by 71, ny by 71 an=
d nxny by 5041.<br>> 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.<br>> Help will be appreciated.<br><b=
r>I don't follow your replacement rules, but I fixed the rest and attempted=
<br>your rules literally.  I didn't attempt to change the basic logic.=
<br><br>use strict;<br>use warnings;<br>use POSIX;<br>use File::Path;<br>us=
e File::Copy;<br><br>my $Grib_dir =3D 'grib_files';<br><br>opendir DIR, $Gr=
ib_dir or die "opendir failed on $Grib_dir: $! ($^E)";<br>while (my $file =
=3D readdir DIR) {<br><br>    next if -d $file;<br><br> =
;   # Extra filtering, to copy only grib files ending in H<br>&nb=
sp;   next unless $file =3D~ /H$/;<br><br>   
print "Doing $file\n" if $debug;<br>    my [at] lines =3D ();<b=
r>    open IN, "+<$Grib_dir/$file" or die "open '$file': =
$! ($^E)";<br>    binmode IN;<br>    while (&=
lt;IN>) {<br><br>#         s/nxny {4}{ny 1=
}/{nxny 5041}/g;        # ?????<br>#  &n=
bsp;      s/nx d{4} {ny 1}/{nx 71 ny 71}/g;  =
  # ?????<br><br>        # your stated r=
ules (probably more to it than you stated):<br>     &nb=
sp;  #     nxny =3D> 5041<br>    &nbs=
p;   #     nx =3D> 71<br>    &nb=
sp;   #     ny =3D> 71<br><br>   &nbs=
p;     s/nxny/5041/g;<br>       &nb=
sp; s/(nx|ny)/71/g;<br>        push [at] lines,
$_;<br>    }<br>    seek IN, SEEK_SET, 0;&nb=
sp;       # rewind file<br>    prin=
t IN [at] lines;<br>    close IN;<br>}<br>closedir DIR;<br><br>_=
_END__<br></div></blockquote></td></tr></table><br>=0A=0A
--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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1151457870==--
zilore mumba [ Fr, 21 August 2009 11:49 ] [ ID #2013034 ]

RE: Fastest Path

--===============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 [at] listserv.ActiveState.com [mailto:activeperl-bounce=
s [at] listserv.ActiveState.com] On Behalf Of anthony.okusanya [at] usbank.com
Sent: Thursday, August 20, 2009 4:20 PM
To: activeperl [at] 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

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
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">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
..MsoChpDefault
{mso-style-type:export-only;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
/* List Definitions */
[at] list l0
{mso-list-id:1159805295;
mso-list-type:hybrid;
mso-list-template-ids:-303909258 67698703 67698713 67698715 67698703 67698=
713 67698715 67698703 67698713 67698715;}
[at] list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'>You are trying to solve the problem on the wrong end, let
windows do it for you – look into DFS <a
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</a><o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'>If DFS is not an option, then you have a few choices:<o:p></=
o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoListParagraph style=3D'text-indent:-.25in;mso-list:l0 level1 =
lfo1'><![if !supportLists]><span
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497D'=
><span
style=3D'mso-list:Ignore'>1.<span style=3D'font:7.0pt "Times New Roman"'>&n=
bsp;     
</span></span></span><![endif]><span style=3D'font-size:11.0pt;font-family:=
"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.<o:p></o:p></span></p>

<p class=3DMsoListParagraph style=3D'text-indent:-.25in;mso-list:l0 level1 =
lfo1'><![if !supportLists]><span
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;color:#1F497D'=
><span
style=3D'mso-list:Ignore'>2.<span style=3D'font:7.0pt "Times New Roman"'>&n=
bsp;     
</span></span></span><![endif]><span style=3D'font-size:11.0pt;font-family:=
"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></o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"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></o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'>If your ActiveDirectory sites are properly defined, %LOGONSE=
RVER
will be the “closest” domain controller.<o:p></o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri",=
"sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in =
0in 0in'>

<p class=3DMsoNormal><b><span style=3D'font-size:10.0pt;font-family:"Tahoma=
","sans-serif"'>From:</span></b><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"' > activeperl-bo=
unces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] <b>On Behalf Of </b>an=
thony.okusanya [at] usbank.com<br>
<b>Sent:</b> Thursday, August 20, 2009 4:20 PM<br>
<b>To:</b> activeperl [at] listserv.activestate.com<br>
<b>Subject:</b> Fastest Path<o:p></o:p></span></p>

</div>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal><br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Perl Guru=
's I
greet you.</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>  &n=
bsp;
    I am putting together a script which I would be using to upda=
te</span>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Windows s=
ervers
as part of a build process. </span><br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>I have mu=
ltiple
mirrored shares across my network</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>My goal i=
s to
have this script run and determine the fastest/closest update share</span> =
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>that it c=
an use
to download  updates from</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Can you t=
hink
of any modules that can help me with this ?</span> <br>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>As of now
(design phase)</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>I was thi=
nking
of the pseudocode</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>1. Launch
script</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>2. query =
host
for its IP</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>3a use st=
atic
table to determine which is its best share </span><br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>(problem =
with
this is I have to compile a list of IP network values and determine which s=
hare
best servers which network)</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>OR</span>=
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>3b. Ping =
each
update server and return the one with the least number of hops or the one w=
ith
the fastest response time.</span> <br>
<br>
<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Any ideas=
would
be appreciated.</span> <br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'><br>
<br>
<br>
<br>
Tony B. Okusanya</span><o:p></o:p></p>

<p>U.S. BANCORP made the following annotations<br>
------------------------------------------------------------ ---------<br>
<span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>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.</span><br>
<br>
------------------------------------------------------------ ---------<o:p><=
/o:p></p>

</div>

</body>

</html>

--_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 [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0932804671==--
Ken Cornetet [ Fr, 21 August 2009 16:05 ] [ ID #2013035 ]
Perl » gmane.comp.lang.perl.active-perl » help rewrite files

Vorheriges Thema: help rewrite files
Nächstes Thema: Cannot connect to SAP CRM using Perl.