RE: 'moving' an activeperl install to a new machine (xp to windows 7)

2013-03-15 Thread Wagner, David --- Sr Programmer Analyst --- CFS

>-Original Message-
>From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-
>users-boun...@listserv.activestate.com] On Behalf Of Greg
VisionInfosoft
>Sent: Friday, March 15, 2013 14:12
>To: Perl-Win32-Users@listserv.ActiveState.com
>Subject: 'moving' an activeperl install to a new machine (xp to windows
7)
>
>hi all, ive got a wonderfully working activeperl 5.8.9 environment
>that was originall setup on Windows XP.
>
>so that i dont need to reinstall the many, many packages that ive
>ammased throughout the years - i had the thought to simply copy my
>entire 'perl' folder from the older windows xp pc to my newer windows
>7 pc.
>
>certainly this will move perl and all packages just fine...
>
>the problem with this, is i dont know how to preserve the built-in PPM
>database functionality.
>
What you want to do is:

ppm profile save [ filename ] 
Write profile of configured repositories and installed packages to the
given file. If no file is given then print the profile XML to standard
output.

Then install the AS you want and do:

ppm profile restore [ filename ] 
Install the packages listed in the given profile file. If no file is
given try to read the profile from standard input.

Jan D is on the list and someone else may have more input, but I don't
believe you want to just copy it across...

 If you have any questions and/or problems, please let me know. 
 Thanks. 
 
Wags ;) 
David R. Wagner 
Senior Programmer Analyst 
FedEx Services 
1.719.484.2097 Tel 
1.719.484.2419 Fax 
1.408.623.5963 Cell
http://Fedex.com/us
 
>originally i had 5.8.8 and only one file:
>
>   C:\Documents and Settings\GAiken\Local Settings\Application
>Data\ActiveState\ActivePerl\ppm-MSWin32-x86-multi-thread-5_8.db
>
>
>at some point in time, i ran a 5.8.9 install ON TOP OF my 5.8.8
>installation, and from that point on, the PPM folder structure somehow
>changed to become 3 files:
>
>   C:\Documents and Settings\GAiken\Local Settings\Application
>Data\ActiveState\ActivePerl\ppm-MSWin32-x86-multi-thread-5_8.db
>   C:\Documents and Settings\GAiken\Local Settings\Application
>Data\ActiveState\ActivePerl\ppm-MSWin32-x86-multi-thread-5_8.db-journal
>   C:\Documents and Settings\GAiken\Local Settings\Application
>Data\ActiveState\ActivePerl\820\ppm-MSWin32-x86-multi-thread-5_8.db
>
>I am suspecting that there is truly just one 'master database file',
that
>being:
>
>   C:\Documents and Settings\GAiken\Local Settings\Application
>Data\ActiveState\ActivePerl\ppm-MSWin32-x86-multi-thread-5_8.db
>
>
>does anyone have any first hand knowledge here what i would do, to
>somehow utilize my old .db file on the new windows 7 pc?
>
>i am thinking i can run the 5.8.9 install to the new windows 7 pc,
>then see if i can determine where the new *.db file gets created - and
>then possibly just 'swap out' the newly created *.db file with my
>original *.db file?
>
>i guess i have nothing to loose by trying this, but it would be nice
>if someone has walked this path before me, and can tell me which
>branches to duck under - so to speak...
>
>greg
>___
>Perl-Win32-Users mailing list
>Perl-Win32-Users@listserv.ActiveState.com
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: I have a secondary Inbox folder and trying to read the messages in the 2ndary inbox

2011-07-25 Thread Wagner, David --- Sr Programmer Analyst --- CFS
>-Original Message-
>From: Jan Dubois [mailto:j...@activestate.com]
>Sent: Monday, July 25, 2011 12:24
>To: 'Wagner, David --- Sr Programmer Analyst --- CFS'; perl-win32-
>us...@listserv.activestate.com
>Cc: Wagner, David --- Sr Programmer Analyst --- CFS
>Subject: RE: I have a secondary Inbox folder and trying to read the
>messages in the 2ndary inbox
>
>On Mon, 25 Jul 2011, Wagner, David --- Sr Programmer Analyst ---
>CFS wrote:
>>
>>  I got some code from a reply I found on Perl Monks and brought
>> over to my Desktop and ran the code. It does what I am after, BUT I
do
>> not want the default inbox, but another inbox.
>>
>>  The code for the default inbox is:
>>
>>  my $folder = $namespace->GetDefaultFolder(olFolderInbox);
>>
>>  How do I get a different folder to read from messages from???
>
>Sorry, no time to test right now, but I suspect something like this
>might work:
>
>my $folder = $namespace->Folders("Outlook Data
File")->Folders("Alternate
>Input");
>
Thanks, Jan. That was close, but what I ended up was doing a
properties against the other inbox:
\\Mailbox - Email.Reports
So I removed the \\ and used that portion for the first Folders
and for the second Folders used Inbox and was able to read...

I appreciate the insight.
Know you are busy, but when the time is available, where does
one find out such info. Never would have found it. I looked at the MS
Outlook 12.0 Object Library. I found Folders and if that is the right
Folders, I do not see it..

Again, I have it going, but when you have sometime to drop a few
pointers, it would be greatly appreciated...
>Cheers,
>-Jan
>

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


I have a secondary Inbox folder and trying to read the messages in the 2ndary inbox

2011-07-25 Thread Wagner, David --- Sr Programmer Analyst --- CFS

I got some code from a reply I found on Perl Monks and brought
over to my Desktop and ran the code. It does what I am after, BUT I do
not want the default inbox, but another inbox.

The code for the default inbox is:

my $folder = $namespace->GetDefaultFolder(olFolderInbox);

How do I get a different folder to read from messages from???

I have looked at the OLE browser, but there is way too many
things to look at and I am lost at this point.

Thoughts??

 If you have any questions and/or problems, please let me know. 
 Thanks. 
 
Wags ;) 
David R. Wagner 
Senior Programmer Analyst 
FedEx Services 
1.719.484.2097 Tel 
1.719.484.2419 Fax 
1.408.623.5963 Cell
http://Fedex.com/us


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: looking for amine's 'MemMap' module for Win32 x86 Perl version 5.8

2010-10-18 Thread Wagner, David --- Senior Programmer Analyst --- CFS
From: perl-win32-users-boun...@listserv.activestate.com
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of
Greg Aiken
Sent: Monday, October 18, 2010 15:53
To: perl-win32-users@listserv.activestate.com
Subject: looking for amine's 'MemMap' module for Win32 x86 Perl version
5.8

 

I was able to find MemMap.ppd (and matching MemMap.tar.gz) at a website.

[Wags] Unsure what happened or where Amine went, but to the best of my
knowledge he vanished from the Perl scene almost 10 years ago, give or
take a year or two.

I had another module of his which I was using and it had to do with
changes within a folder for a file. Much nicer than anything else that
was around, but it quit working and Amine quit responding.

 

 So unsure who is maintaining and handling.

 

 Now, I could be completely wrong, but I have not seen or heard of
Amine on any of the Perl lists.

 

 Anyone know differently?? Unsure who would be maintaining the code,
but not changing who is actually handling the changes???

 

 

 If you have any questions and/or problems, please let me know. 
 Thanks. 
 

Wags ;) 
David R. Wagner 
Senior Programmer Analyst 
FedEx Services 
1.719.484.2097 Tel 
1.719.484.2419 Fax 
1.408.623.5963 Cell

http://Fedex.com/us

 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: PerlTk: problem with notebook and canvas

2007-09-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Daniel Burgaud
Sent: Thursday, September 20, 2007 14:49
To: perl-win32-users@listserv.activestate.com
Subject: PerlTk: problem with notebook and canvas


Hi,

Is it possible to create "Notebooks" of Canvas?

use Tk;
require Tk::BrowseEntry;
require Tk::ROText;
require Tk::NoteBook;

my $mw = MainWindow->new( -bg => "#00" ); 
$frames{main}=
$mw->NoteBook(-relief=>'flat',-border=>1,-tabpadx=>1,-tabpady=>1,-font=>
[-family=>"Tahoma",-size=>8],-bg=>'#404040',-foreground=>'#FF',-inac
tivebackground=>"#808080")->pack(-expand => 1,-fill => 'both',-side =>
'top'); 

foreach my $pair (qw/Pair1 Pair2 Pair3 Pair4 Pair5/) {
$frames{tab}{$pair}= $frames{main}->add($pair,
-label=>$pair);
$frames{canvas}{$pair}= $frames{tab}{$pair}->Canvas(
-width => 400, -height => 635, -background => 'black',)->pack(-side =>
'top'); 
}
$charts{$pair}{grid}{$price} =
$frames{canvas}{$pair}->createLine(0,50,615,50, -fill => "#404040");

Compiles ok, but the last code keeps giving me this error:
Can't call method "createLine" on an undefined value at chart.pl
line 105.

If I remove the "Notebook" codes the script runs ok.

What I wanted to do is create a TK, create notebooks and each of
these "tabs" are canvases where I draw charts.

thanks
Dan
 
I don't do that much tk, but here is yours with what you gave
and using strict/warnings. I alos created the frames with a different
color for each. Like I said, I don't have a real understanding of tk,
but it is part of Perl, so here is simple start and others can give me
insight.
#!perl
 
use strict;
use warnings;
 
use Tk;
require Tk::BrowseEntry;
require Tk::ROText;
require Tk::NoteBook;
my %frames = ();
my %charts = ();
my $pair;
 
my $MyIdx = 0;
my @MyColor = qw(green red blue yellow white);
 
my $mw = MainWindow->new( -bg => "#00" ); 
$frames{main}=
$mw->NoteBook(-relief=>'flat',-border=>1,-tabpadx=>1,-tabpady=>1,-font=>
[-family=>"Tahoma",-size=>8],-bg=>'#404040',-foreground=>'#FF',-inac
tivebackground=>"#808080")->pack(-expand => 1,-fill => 'both',-side =>
'top'); 
foreach $pair (qw/Pair1 Pair2 Pair3 Pair4 Pair5/) {

$frames{tab}{$pair}= $frames{main}->add($pair,
-label=>$pair);
$frames{canvas}{$pair}= $frames{tab}{$pair}->Canvas(
-width => 400, -height => 635, -background =>
$MyColor[$MyIdx++],)->pack(-side => 'top'); 
$charts{$pair}{grid}{$pair} =
$frames{canvas}{$pair}->createLine(0,50,615,50, -fill => "#404040");
}
MainLoop; 



**
This message contains information that is confidential and proprietary to FedEx 
Freight or its affiliates.  It is intended only for the recipient named and for 
the express  purpose(s) described therein.  Any other use is prohibited.
**

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: PerlTk: problem with notebook and canvas

2007-09-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Daniel Burgaud
Sent: Thursday, September 20, 2007 14:49
To: perl-win32-users@listserv.activestate.com
Subject: PerlTk: problem with notebook and canvas


Hi,

Is it possible to create "Notebooks" of Canvas?

use Tk;
require Tk::BrowseEntry;
require Tk::ROText;
require Tk::NoteBook;

my $mw = MainWindow->new( -bg => "#00" ); 
$frames{main}=
$mw->NoteBook(-relief=>'flat',-border=>1,-tabpadx=>1,-tabpady=>1,-font=>
[-family=>"Tahoma",-size=>8],-bg=>'#404040',-foreground=>'#FF',-inac
tivebackground=>"#808080")->pack(-expand => 1,-fill => 'both',-side =>
'top'); 

foreach my $pair (qw/Pair1 Pair2 Pair3 Pair4 Pair5/) {
$frames{tab}{$pair}= $frames{main}->add($pair,
-label=>$pair);
$frames{canvas}{$pair}= $frames{tab}{$pair}->Canvas(
-width => 400, -height => 635, -background => 'black',)->pack(-side =>
'top'); 
}
$charts{$pair}{grid}{$price} =
$frames{canvas}{$pair}->createLine(0,50,615,50, -fill => "#404040");

Compiles ok, but the last code keeps giving me this error:
Can't call method "createLine" on an undefined value at chart.pl
line 105.

If I remove the "Notebook" codes the script runs ok. 
 
You state it runs okay, yet $price is never defined
anywhere. I don't believe you are running with strict/warnings on
because you would see uninitialized msgs coming along.
 
Check that out first and then let the list know.
Wags ;) 

What I wanted to do is create a TK, create notebooks and each of
these "tabs" are canvases where I draw charts.

thanks
Dan




**
This message contains information that is confidential and proprietary to FedEx 
Freight or its affiliates.  It is intended only for the recipient named and for 
the express  purpose(s) described therein.  Any other use is prohibited.
**

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: hash table question

2007-08-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Mark Funk
Sent: Wednesday, August 08, 2007 14:59
To: perl-win32-users@listserv.ActiveState.com
Subject: hash table question


What exactly does the following Perl code do?
 
%hash=(); 
This should be my %seen = (); 

open(PREVFILE, $prevfile) or die("Unable to open previous
file");

while() {
  chomp;
  last if /BREAK/;
  $seen{$_}++;
}
close(PREVFILE);
 
TIA, 
removing the carriage return info as defined on your system
and counting all occurances of whatever it finds on the lines it reads.
If it finds the characters BREAK ( since it is done this way, it could
be anywhere on the line, BREAKDOWN or xxBREAK or BREAKnnn ), but will
not exist the processing if it sees break ( Must be capitalized to get
out early ).  
 
If this is all then you are not seeing the actual totals, but is
just placing in the hash keyed by whatever you are reading in.
 
Wags ;)
 

David M. Funk 
President/CEO 
Tivoli Certified Enterprise Consultant 
Specializing in Network and Systems Management Solutions 
Trinity Solutions 
604 Cassandra Dr. 

Suite 204
Cranberry Twp., PA 16066 
Phone: 724-316-0721 
Fax: 724-772-7889 
email: [EMAIL PROTECTED] 

 

 


**
This message contains information that is confidential and proprietary to FedEx 
Freight or its affiliates.  It is intended only for the recipient named and for 
the express  purpose(s) described therein.  Any other use is prohibited.
**

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Command line switches aren't recognized

2007-06-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Look at folder options and then file types. Check pl to insure that
Open has something like:
 
 

  If you have any problems or questions, please let me know. 

 Thanks. 

  Wags ;) 
David R Wagner 
Senior Programmer Analyst 
FedEx Freight 
1.408.323.4225x2224 TEL 
1.408.323.4449   FAX 
http://fedex.com/us 

 




From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
DC Brian
Sent: Friday, June 15, 2007 13:35
To: perl-win32-users@listserv.ActiveState.com
Subject: Command line switches aren't recognized


Hi. First of all, I am a total newbie to Perl, so forgive my
ignorance. I am using someone else's script here; let's call it foo.pl.
 
Without going into too much detail about the code or whether it
works correctly, let's just say that we have two near identical WinXP
PC's with identical versions of ActivePerl installed. Running the script
on the first PC from the Windows command line works fine, accepting
arguments and functioning accordingly in the manner of foo.pl -f, for
example, but the same exact script on the second PC with the same
version of perl installed does not seem to accept when I run foo.pl -f.
It's as if it just doesn't recognize any flags, switches, or other
options after foo.pl is called.
 
Assuming the code within foo.pl is correct, is there anything
else that would cause this sort of behavior? I am truly stumped. Thanks.




Be a better Globetrotter. Get better travel answers
 from
someone who knows.
Yahoo! Answers - Check it out. 


**
This message contains information that is confidential and proprietary to FedEx 
Freight or its affiliates.  It is intended only for the recipient named and for 
the express  purpose(s) described therein.  Any other use is prohibited.
**

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: How do I know where my Perl script is running?

2007-05-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
  





From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
John Townsend
Sent: Tuesday, May 15, 2007 08:33
To: perl-win32-users@listserv.ActiveState.com
Subject: How do I know where my Perl script is running?




Here's my situation: 

My script is executed by a larger system, from some abitrary
directory. How can I tell from which directory my Perl script was
executed?

I guess I'm looking for something like pwd from UNIX. 


  $0 holds the name of the file executing your script. It appears as
fully qualified name.
I don't think the cwd will give you what you want as regards the
script being executed. ( In fact I know it won't) Use $0.

   Wags ;) 
David R Wagner 
Senior Programmer Analyst 
FedEx Freight 
1.408.323.4225x2224 TEL 
1.408.323.4449   FAX 
http://fedex.com/us 

 

 


**
This message contains information that is confidential and proprietary to FedEx 
Freight or its affiliates.  It is intended only for the recipient named and for 
the express  purpose(s) described therein.  Any other use is prohibited.
**

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Regular expression question

2006-08-01 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Title: Regular expression question



From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
Cai, Lucy (L.)Sent: Monday, July 31, 2006 17:21To: 
Cai, Lucy (L.); perl-win32-users@listserv.ActiveState.com; 
perl-unix-users@listserv.ActiveState.com; 
[EMAIL PROTECTED]; 
[EMAIL PROTECTED]Subject: Regular 
_expression_ question

I have a file such as: 
My $file = "c:\temp\zips\ok.txt"; 
How can I split the $file to get the only 
path: 
My $dir = "c:\temp\zips"; My $file = "ok.txt"; 
Thanks in advance! 
Lucy  
Better to use File::Basename which will break it out for you. Comes 
as part of std Perl.
Wags ;) 
**
This message contains information that is confidential and proprietary to FedEx Freight or its affiliates.  It is intended only for the recipient named and for the express  purpose(s) described therein.  Any other use is prohibited.
**
 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Finding partly duplicated records

2006-05-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Thanks for the replies so far. I am going to respond to this one for
> all of them up to now.
> 
> This approach is very good for the problem with only two data elements
> on a line, but it
> seems to require that I know the duplicate entries when I write the
> code.
> I can only guess that the posters left finding the duplicates as an
> 'exercise for the reader',
The thing you do is define the hash and provide a counter as an 
element, so by going through the hash you know whether there is more than one 
per either machine or IP.
Something like:

$machines{$wrkkey}[0]   # equal counter
$machines{$wrkkey}[1]   .= $ipaddrr . q[;] ;#now you have the 
ipaddr as ; separated list and  can either print spaced across or down ot 
whatever.

Can do the same for the ipaddr and machines.

Now you can loop through either hash:

foreach my $machinekey (sort keys %machines ) {
next if ( $machines{machinekey }[0] < 2 );
# now can print out or whatver 
   }
duplicate the code for the Ipaddr sort and print

Wags ;) 
> not realizing that at this point, this reader's brain is totally
> fubar. 
> 
> 
> When I use data::dumper I find this (only for the first HOA (that is
> right isn't it, HOA?))
> 
> $VAR1 = 'm003ws';
> $VAR2 = [
>   '192.168.20.6',
>   '192.168.20.10'
> ];
> $VAR3 = 'm009ws';
> $VAR4 = [
>   '192.168.20.12'
> ];
> 
> More data left off for the sake of the poor, suffering electrons.
> 
> Once I have the data structure I just need to print anything that has
> more than one value in the array.
> I am going back to the O'Reilly books to try to figure it out.
> 
> More to come, I am sure.
> 
> Thanks,
> Dan
> 
> -Original Message-
> From: [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 08, 2006 15:42
> To: perl-win32-users@listserv.ActiveState.com; King, Dan
> Subject: Re: Finding partly duplicated records
> 
> How about something like this:
> 
> my %machines = (); # List of machines with their IPs my %ipaddrss =
> (); # List of IPs with their machines
> 
> # We assume the db is a flat file and that the file # is already
> opened. We also assume that the fields # are separated by whitespace
> (as per your example).
> while (my $line = ) {
>chomp($line);
> 
># Split the record by whitespace
>my ($host, $ip) = split(/\s+/, $line);
> 
># Save the ip in the machine's record
>if (exists $machines{$host}) {
>push(@{ $machines{$host} }, $ip);
>} else {
>$machines{$host} = [ $ip ];
>}
> 
># Save the host in the ip's record
>if (exists $ipaddrss{$ip}) {
>push(@{ $ipaddrss{$ip} }, $host);
>} else {
>$ipaddrss{$ip} = [ $host ];
>}
> }
> 
> 
> At the end you'll have 2 hashes, one containing a list of machines and
> the IPs that belong to each one, and the other containing a list of
> IPs and the machines they belong to.  I am assuming that you want to
> find the duplicate records and store them to use them for something. 
> If you just want to count how many times they occur then its
> different. 
> 
> To access the stored duplicates, just do something like this:
> 
> # Output all the IPs belonging to $host
> my $host = 'm001ws';##DAN## I don't know the
> names of the duplicates.
> foreach my $ip ( @{ $machines{$host} }) {
>print $ip;
> }
> 
> # Output all the hosts belonging to $ip
> my $ip = '192.168.20.2';
> foreach my $host ( @{ $ipaddrss{$ip} }) {
>print $host;
> }
> 
> I hope this helps!
> 
>  -dZ.
> 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


**
This message contains information that is confidential and proprietary to FedEx 
Freight or its affiliates.  It is intended only for the recipient named and for 
the express  purpose(s) described therein.  Any other use is prohibited.
**


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Sort not fixing order in equivalent subsequences

2006-05-05 Thread Wagner, David --- Senior Programmer Analyst --- WGO



    I don't believe you want to rely 
upon the order, butr add the extra sort to for the key so you know and do not 
leave it to the current setup and with the next release 
changes.
 
Wags ;)

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]On Behalf Of 
  Joe DiscenzaSent: Friday, May 05, 2006 08:12To: 
  perl-win32-users@listserv.ActiveState.comSubject: Sort not fixing 
  order in equivalent subsequences
  Hello all,
   
  I can't find anything in the doc about whether Perl's 
  sort function maintaining the order in equivalent subsequences. Suppose I have 
  an array of hashrefs that looks like this:
   
  {name => 'a', status => 0}, {name => 'b', status 
  => 1}, {name => 'c', status => 1}, {name => 'd', status => 
  0}
   
  and I sort { $a->{'status'} <=> 
  $b->{'status'} }
   
  Should I expect the result (order of the names) to 
  always be ('a', 'd', 'b', 'c'), or could it be, for example, ('d', 'a', 'b', 
  'c') (i.e., could two entries with the same status value change relative 
  order)?
   
  Joe
   
  Joseph Discenza, Senior Programmer/Analystmailto:[EMAIL PROTECTED]Carleton 
  Inc. http://www.carletoninc.com574.243.6040 
  ext. 300Fax: 574.243.6060
**
This message contains information that is confidential and proprietary to FedEx Freight or its affiliates.  It is intended only for the recipient named and for the express  purpose(s) described therein.  Any other use is prohibited.
**
 
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Easy One

2006-05-01 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Real simple,
> 
>   I have a string, "$a" for arguments sake, that contains a single
> word.  The word will always have exactly 8 characters in it, most
> likely something like "ABCD1234".  I need to split this up into two
> strings ($b & $c), the first string needs to contain all the
> characters before the first number in the word ("ABCD" in this
> example), the second string needs everything after, and including,
> the first number in the word "1234" in this example.
> 
>   Now, substr() would be a walk in the park, except for the fact
> that I can't guarantee the first number will always be in the fifth
> position ... it might come in any position between 3 and 7.  How would
> YOU go about doing this?  Inquiring minds want to know.
Stay away from the $a and $b ( sort magic variables ).
if there must be at least one alpha, then

if ( /^(\D+)(\d+)/ ) {
$alphapart   = $1;
$numericpart = $2;
if ( (length($alphapart) + length(Numericpart) != 8 ) {
 # report length differences since the lengths of alpha and 
numeric are not 8
 }
 }
Wags ;) ps If truly only alpha then could replace\D+ with [a-z]+ and add i for 
ignore case.

> 
> Bill in Brooklyn
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Replace Leading Spaces

2006-04-07 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Using a regex, I want to replace each leading space-character with a
> corresponding zero-character on a one-to-one basis. For an example
> string:
> 
> My $string = ' 259.00 ';
> 
> Note that I don't want to change the trailing space character. The
> resulting string would look like:
> 
> '0259.00 '
> 
> The total length of the string would remain the same after the replace
> operation.
> 
> I'm just having a total brain-fade on this one.
It was brain fade here also, but finally found one way:

#!perl

use strict;
use warnings;

$_ = '  259.00 ';
print $_ . "\n";

s/^(\s+)/sprintf "%s", q[0]x length($1)/eg;
print $_ . "\n";
Output:
  259.00
00259.00

hth

Wags ;)
> 
> Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis
> MO - USA Central Time Zone
> 636-755-2652 fax 636-755-2503
> 
> [EMAIL PROTECTED]
> www.nisc.coop
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Efficiency

2006-04-05 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ng, Bill wrote:
> That's incorrect though, since your output shows two copies of  aacs
> and brbt ...
> 
> Bill
> 
> -Original Message-
> From: Wagner, David --- Senior Programmer Analyst --- WGO
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 05, 2006 5:02 PM
> To: Ng, Bill; perl-win32-users@listserv.ActiveState.com
> Subject: RE: Efficiency
> 
> #!perl
> use strict;
> use warnings;
> 
> my @list = ("aacs1110", "brbt4332", "rtxa4320", "aacs2000",
> "brig5621", "brbt5220", "nbvc"); my ($mykey, $mypriorkey) = (q[],
> q[]); my @finallist = ();
> 
> foreach $mykey (sort { $a->[1] cmp $b->[1] ||
>$b->[2] <=> $a->[2]
>   }
> map{[$_, /^(.{4})(.{4})/ ]}
> @list) {
> next if ( $mykey->[0] eq $mypriorkey);
> push(@finallist, $mykey->[0]);
> $mypriorkey = $mykey;
need to be:
next if ( $mykey->[1] eq $mypriorkey);
push(@finallist, $mykey->[0]);
$mypriorkey = $mykey->[1];

Sorry about that.
Output is then:
aacs2000
brbt5220
brig5621
nbvc

Wags ;)

>  }
> print join("\n", @finallist);
> 
> Output:
> aacs2000
> aacs1110
> brbt5220
> brbt4332
> brig5621
> nbvc
> 
> A few more lines, but I like to be able to read the lines.
> 
> Wags ;) ps Only one pass through the data.



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Efficiency

2006-04-05 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Okay,
> 
>   Here's what I've come up with:
> --
> @list = ("aacs1110", "brbt4332", "rtxa4320", "aacs2000", "brig5621",
> "brbt5220", "nbvc");
> @list = sort @list;
> 
> foreach $item (@list) {
>   $itemPref = substr($item, 0, 4);
>   $itemVers = substr($item, 4);
> $h{$itemPref} = $itemVers; }
> 
> foreach $pref (keys %h) {
>   push (@finalList, $pref . $h{$pref}); }
> --
> 
> Okay ... 8 lines of code (not counting empty lines) ... anyone got
> anything else?
> 
> Bill
> 
> 
#!perl
use strict;
use warnings;

my @list = ("aacs1110", "brbt4332", "rtxa4320", "aacs2000", "brig5621",
"brbt5220", "nbvc");
my ($mykey, $mypriorkey) = (q[], q[]);
my @finallist = ();

foreach $mykey (sort { $a->[1] cmp $b->[1] ||
   $b->[2] <=> $a->[2]
  }
map{[$_, /^(.{4})(.{4})/ ]}
@list) {
next if ( $mykey->[0] eq $mypriorkey);
push(@finallist, $mykey->[0]);
$mypriorkey = $mykey;
 }
print join("\n", @finallist);

Output:
aacs2000
aacs1110
brbt5220
brbt4332
brig5621
nbvc

A few more lines, but I like to be able to read the lines.

Wags ;) ps Only one pass through the data.
> 
> 
> -Original Message-
> From: Ng, Bill
> Sent: Wednesday, April 05, 2006 3:19 PM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: Efficiency
> 
> Since Efficiency seems to be the topic of the day,
> 
>   My situation, I have an array filled with 8-character strings, a
> few thousand of them.  First 4 chars are letters, last 4 are numbers.
> Examples - abcd1234, zyxw9876, etcc.  The letters portion is a
> prefix, the numbers is a version.  In my list, there are instances of
> the same prefix with different versions.
> 
>   What's the easiest way for me to either clean up the existing
> array to remove all but the latest versions of each prefix, or create
> a new array with the same info?  Focus is on least amount of code,
> I'm not going for outright speed.  No modules.  I've got it working
> now but I'm running nested foreach loops and an if statement ... not
> efficient at all.
> 
> Example:
> 
> @myArray = ("aacs1110", "brbt4332", "rtxa4320", "aacs2000",
> "brig5621", "brbt5220", "nbvc")
> 
> The code would give me an array that contained everything except
> aacs1110 & brbt4332 since both have been superseded.
> 
> Bill
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Efficiency

2006-04-05 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Since Efficiency seems to be the topic of the day,
> 
>   My situation, I have an array filled with 8-character strings, a
> few thousand of them.  First 4 chars are letters, last 4 are numbers.
> Examples - abcd1234, zyxw9876, etcc.  The letters portion is a
> prefix, the numbers is a version.  In my list, there are instances of
> the same prefix with different versions.
> 
>   What's the easiest way for me to either clean up the existing
> array to remove all but the latest versions of each prefix, or create
> a new array with the same info?  Focus is on least amount of code,
> I'm not going for outright speed.  No modules.  I've got it working
> now but I'm running nested foreach loops and an if statement ... not
> efficient at all.
> 
> Example:
> 
> @myArray = ("aacs1110", "brbt4332", "rtxa4320", "aacs2000",
> "brig5621", "brbt5220", "nbvc")
> 
Sort in descending order(either the whole item or you could sort the 
first four ascending and the numeric in descending order) and only use the 
first four for whether you take it or bypass the data.

Wags ;0


> The code would give me an array that contained everything except
> aacs1110 & brbt4332 since both have been superseded.
> 
> Bill
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Regex Needed

2006-03-24 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hello,
> 
>I am looking for help on a regex that examines strings such as
> 
> "xxxN yyy sssNNN"
> "xxxN yyyNyyy sss"
> "xxxN yyyNyyy ssN"
> 
> and returns only the sss part?  N is always a numeral, and s is always
> alphabetic.
> 
> Here is what I have so far as an example. I believe there is an
> eloquent way to do this in a single regex.
> 
> my (
>   $string,
>   $prefix
>  );
> 
> $string = "MBH1 WELL PIT050";
> ($prefix) = $string =~    # I want $prefix to
> equal PIT 
if it is really of that format then /\s(\D+)\d+$/ is one shot which 
looks for a space followed by NON Numeric and then alpha and then end of line 
or data.

Wags ;)
> 
> Thank you.
> 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Reg Expression Help

2006-03-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO



 

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]On Behalf Of 
  Scott PurcellSent: Thursday, March 23, 2006 12:05To: 
  Perl-Win32-Users@listserv.ActiveState.comSubject: Reg _expression_ 
  Help
  
  Hello,
   
  I have a regular _expression_ in 
  which I am ensuring the user enters some valid characters for our 
  system.
  Currently the _expression_ is 
  so:
  '^[a-zA-Z0-9-_. ]+$' 
  '^[a-zA-Z0-9-_.\]\[ ]+$'
  Wags 
  ;)  Meaning, a user can enter 
  a-z or A-Z or 0-9, dashes, underbars or periods and space. 
  
   
  I have a problem now, because they 
  actually are going to allow users to enter a ‘[‘ or a ‘]’ This is stumping me. 
  How can I incorporate the possibility of having a [ or ] in the user 
  input?
   
   
  Thanks,
  Scott
   
   

***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: How to best replace one string with another in a text file

2006-02-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hello,
> 
>   I want to open a text file, look for a specific string, replace it
> with a new string, and write the line out to another file. For lines
> not containing the specific string, I want to write out as is.
> 
> I was wondering if it is possible to do it with a map or splice or
> grep command rather than a foreach loop.
> 
The real question is how large a file are you going to work with? If in 
millions or less, then could read into variable, chg and writeout to new file. 
if in gigabytes, then what you are doing is fine. 

Why go through $infile and not just do while (  ).  Now you can 
go against $_ . Though you are chomp then write without the return?

Wags ;)
> Perhaps, I should be looking at some executable that replaces one
> string with another within a file?
> 
> I have resorted to a foreach loop.
> 
> Here is a snippet of my code:
> 
>$currnodename = "AMACHINE";
>$oldnodename = "BMACHINE";
>$infile = "$ENV{FT}\\qld\\$msg.qli";
>$outfile = $ENV{TEMP} . "\\$task.tmp";
> 
>open (INFILE, "<$infile") || die "Can not open $infile";
>open (OUTFILE, "+>$outfile") || die "Unable to open
>$outfile"; while ($inline = )
>   {
>chomp $inline;
>$inline =~ s/$oldnodename/$currnodename/g;
>print OUTFILE $inline;
>   }
>close INFILE;
>close OUTFILE;
> 
> 
> Thank you
> 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Re: Tri-grams?

2006-02-22 Thread Wagner, David --- Senior Programmer Analyst --- WGO



Unclear in that are you saying? Is a__ where _ is a space is valid or can 
three spaces be valid? So are you working with only alpha and spaces or alpha, 
numbers and spaces?
 
Wags ;)

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]On Behalf Of 
  amit hetawalSent: Wednesday, February 22, 2006 
  12:09To: $Bill LuebkertCc: 
  perl-win32-users@listserv.ActiveState.comSubject: Re: Re: 
  Tri-grams?
   On Wed, 22 Feb 2006 $Bill Luebkert wrote :>amit hetawal 
  wrote:>> >> > Hello All,> >  I 
  needed some logic behind the code for text analysis. its like i have> 
  > to calculate the frequency of the each of the tri-grams present in 
  a> > given piece of text> > i.e i need a way to get the 
  number of occurence of 't' follwoed by 'he'> > for the word 'the' in 
  whole of the text.> >> > for text : ' hello how are you 
  '> > i need to get occurences of 'h' follwed by 'el' then 'e' 
  follwed by 'll'...> > and so on for each of the words present if a 
  space is present then it is> > considered as a type of character 
  only...> > Can you please help me with this...> > I was 
  able to do it for bigrams where i had only 2 characters and used 2> 
  > d arrays...but for 3 charcters i am still lost...> > Can 
  anybody help me with this...>>I would just make a hash and walk 
  the string char by char using substr.>You could make it more generic if 
  3 isn't the only ossible length - I>just checked each char to make sure 
  it wasn't a space rather than adding>a second length 
  loop.>>use strict;>use warnings;>use Data::Dumper; 
  $Data::Dumper::Indent=1; $Data::Dumper::Sortkeys=1;>>$_ = ' 
  hello how are you hello ';>>my %hash;>my $len = length 
  $_;>for (my $ii = 0; $ii < $len; ++$ii) {>     
   my $char = substr $_, $ii, 1;>      next if $char 
  eq ' ';>      my $char2 = substr $_, $ii+1, 1;> 
       next if $char2 eq ' ';>      my 
  $char3 = substr $_, $ii+2, 1;>      next if $char3 eq ' 
  ';>     
   ++$hash{$char.$char2.$char3};>}>print 
  Data::Dumper->Dump([\%hash], 
  [qw(\%hash)]);>>__END__>>Result:>>$\%hash 
  = {>  'are' => 1,>  'ell' => 2,>  
  'hel' => 2,>  'how' => 1,>  'llo' => 
  2,>  'you' => 1>};>Hello BillThanks 
  for your help...i got the initial part running but now i have so read the 
  text from a large text file havin all the sentences and special characters and 
  in that i have to get the trigrams working and not only for the above text 
  ...can you please suggest how should i format the file and access the hash 
  values which i store for all of the whole text ...a tri gram with 'ab_' 
  will also work since i have to consider the space as a character 
  ...too..please help :(thanks.. 

***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Some Help please

2006-02-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hi,
> I am calling a script with in a script and pass a parameter to it. The
> recieving script won't see the passed
> parameters.
> 
> here is what I am doing:
> 
> #defiend in the calling script
> my $termPort = 'port1';
> 
> system  'xterm -bg yellow -fg black -rightbar -hold -T "TEST" -e perl
> /home/my-dir/test.pl $termPort';
> 
if those are really single quotes, then there will be no expansion of 
$termPort and you would see $termPort as the param into test.pl. Need to change 
from the single quotes

Wags ;)
> then test.pl won't see the passed parameter - 'port1'
> 
> I know I am doing something wrong - please help.
> 
> SH
> 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Testing for Directories

2006-02-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> What is the easiest method to detect whether or not a directory
> exists? I will need to create the directory/subdirectory if it is not
> already present. The file test -d does not seem to do the trick. Is
> there a quick and low-overhead method of doing this without actually
> trying to open the directory first?
When you say -d does not work, why do you say that? Are you sure you 
are pointing to the right directory holding the directory you are looking for? 
You may need the whole name if you have not done a chdir.  I use if ( ! -d 
 ) { create dirctory} in a number of scripts.

Wags ;) 
> 
> Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis
> MO - USA Central Time Zone
> 636-755-2652 fax 636-755-2503
> 
> [EMAIL PROTECTED]
> www.nisc.coop
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Sort question

2005-12-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hi Guys,
>   I have an array of values. How can I sort these values that has
> a non numeric character [ _ ] in it? What I did was parse the numbers
> before the "_" character and then perform a number short on those
> value, but there must be an easier way? Any help is greatly
> appreciated. 
> 
> 55_20051202
> 56_20051203
> 57_20051204
> 101_20051205
> 59_20051206
> 10_20051207
> 61_20051208
> 62_20051208
> 63_20051208
> 64_20051209
> 65_20051209
> 66_20051210
> 67_20051211
> 68_20051212
> 69_20051213
> 70_20051214
One approach( Sorts by Date first aand then by the first set of digits ):
#!perl

use strict;
use warnings;

foreach my $MyData ( sort { $a->[2] <=> $b->[2] ||
$a->[1] <=> $b->[1]
   }
 map{[$_, split(/\D/, $_)]}
 
) {
print $MyData->[0];
 }
 
__DATA__
55_20051202
56_20051203
57_20051204
101_20051205
59_20051206
10_20051207
61_20051208
62_20051208
63_20051208
64_20051209
65_20051209
66_20051210
67_20051211
68_20051212
69_20051213
70_20051214

Output:
55_20051202
56_20051203
57_20051204
101_20051205
59_20051206
10_20051207
61_20051208
62_20051208
63_20051208
64_20051209
65_20051209
66_20051210
67_20051211
68_20051212
69_20051213
70_20051214


***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: cd the cmd shell from perl (as can be done from bat file)

2005-10-27 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hello,
> 
>   When a .bat file with just the line:
>   cd c:\some\where
>   is executed from the Windows cmd shell, then
>   when the .bat file terminates, the directory
>   of the shell would have changed to c:\some\where.
> 
>   How do I get the same effect after running a perl script?
> 
You can't. YOu are effecting the enviorment of the Perl script and it 
all goes away when the script stops.

Wags ;)
>   (See http://www.xs4all.nl/~waterlan/ for a more complex
>shell change directory program.)
> 
>   Thanks,
> 
>   --Suresh
> 
> 
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Regex

2005-09-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> I thought this was working, but my logs just showed a case where it
> seems not to do what I want. 
> Why does:
> $OK_body=($body=~/library\s*?card\D*?(\d{7})\D/i) ;
> Not become true when $body contains:
> Library Card: 0240742
> 
> Just possibly there's some dodgy html or something in the original
> that doen't make it through to my logs, but right now I'm perplexed 

You state that there must be a NON numeric at end of line. I would have 
\D* or \D*$.
Wags ;)


***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: help with getting file stats

2005-07-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> I am trying to get the file stats
> I found this code in ch8 of perl cookbook
> ( $dev, $ino, $mode, $nlink,
>   $uid, $gid, $rdev, $size,
>   $atime, $mtime, $ctime,
>   $blksize, $blocks )   = stat($filename)
> 
> and read the man page for stat  and  perlfunc but cant  seem to get a
> simple program to get the file stats
> after reading the man page for stat I thought my problem might be
> that I need to use fstat since the file may be open
> but that doesnt seem to work either
> 
> any suggestions would be appreciated.
> my simple test program:
> 
> 
> #!/usr/local/bin/perl
> 
> 
> use File::stat;
> 
> 
> 
> my $dir_ctr = 0;
> my $file_ctr = 0;
> 
> 
> my $dir = "/home/lorid/wrccpics";
> 
>   print "Opening $dir \n";
> 
>   opendir DH, $dir  or die "Can't open the current dir $!\n";
>   while($file = readdir(DH)){
> 
> if(-d "$dir/$file"){
>   print "\n Dir: $file \n";
>   $dir_ctr++;
> }
> elsif(-e "$dir/$file"){
>   print "\nFile: $file \n";
>  ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
> $mtime, $ctime, $blksize, $blocks ) = stat($file);
If you look at the -d and -e you will see that it is concatenating the 
dir and file. You are only giving it the file and it does not exist.  You will 
need to either use the same setup of $dir/$file or you could do a chdir against 
the $dir and then the $file should work.

Wags ;)
>   print "\n $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
> $atime,Mtime: $mtime,\n Ctime:$ctime,\n $blksize, $blocks\n";
>   $file_ctr++;
> }
> 
>   }
> 
> print "\n";
> print "number of directories: $dir_ctr";
> print "\n";
> print "number of files: $file_ctr";
> 
> print "\n";
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Test if a string is a number?

2005-06-29 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hi folks,
> 
> I have a seemingly simple problem, but I can't find a satisfying
> solution.  I have a function which tests to see if a value represents
> what I want to call "true".  Here's a simplified version:
> 
> if ($val =~ /true/i || $val =~ /t/i || $val != 0) { return 1; }
> else { return 0; }
> 
if ( $val =~ /^\d+$/ and $val ) {
return 1;
 }else {
return 0;
 }
Can you have + or - within (as -2) or how about decimal point(is 12.1) 
then you would need to address this also.
Looks like you are after positivie integer without sign, but that is only from 
what you have presented.


> The text might be numeric or not.  If it is numeric, I want to accept
> anything but zero as true.  But, if I run this on a textual non-true
> value, such as "false", I get:
> 
>   Argument "false" isn't numeric in numeric ne (!=) at ...
> 
> The code works, but I don't want to get the warning (I'm using
> 'warnings').  So, how can I test to see if it's a numeric value,
> before I try to use it as one?  I tried using int() to convert it,
> but that gives the same warning.
> 
> Any ideas?  Thanks.



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: list acting up

2005-05-31 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Has anyone else been getting kicked off the list over and over again?
> I keep getting suspended for "too many bounces" but all my other mail
> seems to be getting here just fine.  It's just everything from
> ActiveState that is causing problems.  Now if I don't get any traffic
> for a couple days I know to go see what's wrong.  Do they have the
> servers set to ultra finicky mode or what...

Never any real problmes with AS, but a few others I have trouble with.  
I have one face which the world sees, but the return email is a different one.  
This has caused me to be able to receive all emails, but on some lists that is 
all I can do because it will always come back and say I am not part of the 
list.  Have talked w/ different list moderators, but have not been able to 
clear it up.

Wags


***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: regex and map()

2005-05-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Im trying to sort out why the last line in the routine tokenizer()
> fails to strip off the trailing double quote for all but the last
> token. 
> 
> AFAICT, none of the tokens have any newlines - so I'm at a loss as to
> why it does not do what is expected - (this function is originally
> from the DICT server Jiten which I'm trying to use under Win32 - this
> problem seems to stop the server from finding the proper results
> since it misinterprets the request from the client. I've also
> reworked the initial tokenizer regex and it now seems to do what is
> needed for the strings I have seen up till now.)
> 
> TIA
> Arnold
> ===
> # Test program to test the tokenizer for jiten
> 
> use strict;
> use warnings;
> sub tokenize;
> 
> my $t;
> my @tokens = ();
> @tokens = tokenize '"define" "*" "admin" "admin" "admin"';
> foreach $t (@tokens) {
> print "$t\n";
> }
> #
> # Other
> sub tokenize {
>my $line = shift;
>my @tokens;
># this _should_ decompose a line into it's individual 'tokens', but
># fails for a line such as 'DEFINE "*" "admin"
># it lumps the last two tokens into one
># original line
>#  while($line=~s/(\".+\"|\S+)\s*/push @tokens,$1;'';/e) { ; }
># my attempts at fixes - seems to work so far
>while($line=~s/ (  # handle plain words - no quotes
>(\S+\s+)   #   one or more 'word' char followed
I think you are foretgetting that \S+ hits " along with the letters, 
etc.
I switched the first and second around and got the following output:
[C:/Common] aapl004w
*1*: "define" "*" "admin" "admin" "admin"  <-- My print of what is coming in
<"define";"*";"admin";"admin";"admin">   <-- What is the @tokens w/in the sub
define  < Your printed output after the sub call.
*
admin
admin
admin

Wags ;)

>   #   by one or more non-word char
>   |   # or handle quoted strings,
>(\"\S+\")  #   quote + one or more of any 'word'
>   #   char followed by a trailing quote
>   # this will NOT handle any quoted
>   #   strings containing spaces or tabs
>)
>\s*# followed by 0 or more
>   #   whitespace chars = [ \t\n\r\f]
>  /push @tokens,$1;'';
>  /ex)# evaluate => execute the push
> { ; } # do nothing loop
> 
># this is supposed to strip off the leading and trailing " from
>each # token but fails for all tokens with quotes except the last
>one; # it strips the leading quote but leaves the trailing quote
>for all # but the last one
>return map{s/^\"//;s/\"$//;$_;} @tokens;
> }
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: FTP modules

2005-04-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Does anyone running Perl on Windows recommend a module for FTP?  I
> have tried Net::FTP::Common, but I can't get it to work and there
> isn't much in the way of documentation.  If you have some sample code
> that retrieves a file from an FTP site, it would be really helpful
> for me to see it.  Thanks!
use Net::FTP. There are examples there and it is easy enough to use.
Wags ;0
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: General question.

2005-04-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hello, all!
> 
> Is there any serious usage of Perl for Windows?
> 
> Here, in Moscow, I know quite few programmers who used to develop
> using Perl (under UNIX). And I doubt they still do. 
> 
> As for me, I find Perl quite handy and useful. And what they've done
> in PDK is amazing I guess. But I use it on my own, "for fun". And
> still I can't see the place of Perl among the other
> languages/platforms. Nobody here can I guess.   
> 
> So, let us start our little survey, shall we? ;) First question:
> 
> Why do YOU use Perl for Windows?
1)  Work on MVS, but don't have access to Perl under MVS. Download 
a number of files and process under Perl to use in a more user firendly setup.
2)  Until I had to move to a Sun box, I ran a whole series of 
scripts which worked off trigger files and send in the neighborhood of 50k+ 
emails a month internally on probably around a hour a day of processing.
3)  Assist other developers on a regular basis of taking data and 
generating into another format for Sql queries or reformatting data in 
preparation of being loaded into another database ( MS Access )

I use it for all things and have yet to find anything else that is as 
useful and quick to respond to a users need.

Wags ;)
> 
> Thanks in advance,
> Artem A. Avetisyan.
> 
> P.S.
> THIS IS NOT A COMMERCIAL ACTION!! I'm just interested ;)
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Running Perl script without a command window

2005-04-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> I'm running a perl script that checks the viability of a server.  I
> have the script scheduled to run every 5 minutes.  That means every
> five minutes I have a command window flash on the computer as the
> script is being run.  Is there any way to keep this command window
> from comming up?  The script sends an email if there is server
> failure so I don't need to see any direct output from the script.
How are you running this script: Scheduler or ??

Wags ;) 
> 
> Thanks in advance for your answers.
> 
> - Dan.



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Comparing strings

2005-04-11 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> I am working with huge ASCII text files and large text fields.
> 
> As needs and wants have changed, I will be reprocessing data we have
> already gone through to see if more records can be extracted.
> 
> I will need to compare strings to ensure that records I am inserting
> into our SQL Sever 2000 database are not duplicates of records already
> there.
> 
> I have come up with two ways:
> 
> (1) use string length (number of characters a string holds):
> 
> $length = length($name);
> 
> If both strings are identical in length, I have a duplicate and would
> cease processing.
> 
> (2) compare strings (or 200-characer substrings thereof) directly:
> 
> if ( $str1 eq $str2 )
> {
> 
> }
> 
The string compare should not be that big a thing.  I would believe 
that you would have duplicate lengths since the size of your field you are 
talking about is only 200 characters.

Use Benchmark if you have questions on what you are doing and you can 
see the time ( wallclock and amount of cpu time ) required to do a certain 
action.

Wags ;)
> 
> Does this sound sane to you folks? If anyone has a better way, don't
> be shy. 
> 
> -- Craig
> 
> 
> ---
> avast! Antivirus: Outbound message clean.
> Virus Database (VPS): 0515-0, 04/11/2005
> Tested on: 4/11/2005 2:22:59 PM
> avast! - copyright (c) 1988-2004 ALWIL Software.
> http://www.avast.com
> 
> 
> 
> ___
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Zip Enlightenment

2005-01-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Title: Message



    
    use 
Archive::Zip
 
Doc is sufficient and works very well for me.
 
Wags ;)
-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]On Behalf Of Gardner, SamSent: Friday, January 21, 2005 13:53To: 
'Perl-Win32-Users@listserv.ActiveState.com'Subject: Zip 
Enlightenment
Anyone know how to 
zip files in perl?  I tried downloading Tie::gzip, but found the 
documentation a bit obtuse (which normally wouldn't stop me, but when I tried 
implementing it I received errors stating I couldn't "modify a constant item in 
a tie").  I'd prefer a perl method over a third-party (i.e., command-line 
WinZip) method, mostly because I'd like to learn to do it and don't want to have 
to worry about making sure the right version of WinZip and whatever add-on it 
needs are installed.  Also because I'd like to learn to do it.  Otherwise, I'll just have to write my thing in Java, and that would be 
annoying.
 
Any advice 
appreciated. . .  
 


 
Sam GardnerGTO Application DevelopmentKeefe, 
Bruyette & Woods, Inc.787 7th Avenue, 4th FloorNew York, NY 
10019(212) 887-6753kbw.com[EMAIL PROTECTED] 
"For thousands more years the mighty ships tore 
across the empty wastes of space and finally dived screaming on to the first 
planet they came across - which happened to be the Earth - where due to a terrible miscalculation of scale the entire battle fleet was accidentally swallowed by a small dog." - HHG
This communication is confidential and is intended solely for the 
addressee. It is not to be forwarded to any other person or copied without the 
permission of the sender. Please notify the sender in the event you have 
received this communication in error. This communication is not an offer to sell 
or a solicitation of an offer to buy any securities discussed herein. Keefe, 
Bruyette & Woods, Inc. makes no representation as to the accuracy or 
completeness of information contained in this communication. 

 

***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Win32 process auto-restart on error/crash or kill

2004-12-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hi all,
> 
> how do i automatically get a script to restart itself on error/crash
> or kill? 
> 
> I tried $SIG{INT}, but that only works with Ctrl-C, in a console.
> 
> Lets say i were to kill the process using the Task Manager ("end
> process"). How do I get the script to automatically restart?
> 
> 
> Thanks in advance for all your help.
> 

Would need to be setup as some type of service. I have ot done, but 
have read on this list and others the ability to do it. There are a couple of 
methods- one from ActiveState and I think one from David Roth.

Sorry can't help more, just know that it should be able to be done.
Wags ;)

> Jeremy A.
> 
> 
> 
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: string to time

2004-11-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> given a date string something like
> 
> 11/03/2004 09:30:27
> 
> Is there a Perl mod that will turn this into peril's time() in
> seconds from day zero?
> 
> Thanks
You would need to parse the data which you could do in two steps:
#   Assumes you date/time is in $_
@MyWorka = split (/\D/, $_);
#
# Now date and time should be in @MyWorka as
#[0]: 11
#[1]: 03
#[2]: 2004
#[3]: 09
#[4]: 30
#[5]: 27

Now you should be able to feed into timelocal and have your seconds.

Wags ;)


***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Perl OO

2004-09-29 Thread Wagner, David --- Senior Programmer Analyst --- WGO



    For anyone to help, we will need to see a snippet of 
code to get an idea otherwise I don't think you will get a lot of help. Give the 
group something to work with.
 
Wags ;)
-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]On Behalf Of Bharucha, NikhilSent: Wednesday, September 29, 2004 
10:42To: [EMAIL PROTECTED]Subject: 
Perl OO

I am taking a stab at writing an OO 
Perl Module.  The constructor sets a to a hash I pass to it.  Problem 
is when I call a method after the new method and attempt to retrieve the 
contents of the hash I get nothing.  I know my spelling of the hash 
variable is not off so it’s not simply that it doesn’t exist.  I am using 
the latest perl dev kit and active perl.  
 
Nick
 
 

***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: comparing srtings

2004-06-29 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> I am trying to Compare 2 strings for an if statement in an admin
> script.  $slurp is an entire file, and $file is a name.
> what i would like to do is compare the 2, basicly saying if this =
> that do this otherwise do this. i have the if statement and stuff
> right i just need help with the compare.
> 
> 
> 
> $slurp =~ /"defaultusername"="(.+)"/i;
> $usr = $1;
> print "printing the value of the test var: $usr\n";
> if ($file = $usr){
This is assigning $usr to $file and if $file ture then print.  What you are 
realy trying to do is string compare which would be eq.  To do a numeric compare 
reguires ==.

So
if ( $file eq $usr ) {
  # true
   }else {
  #false
   }

Wags ;)

>print "username: $file;
> 
> 
> -Nex6



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Chop!

2004-06-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Greetings,
> 
> Suppose  I have a string like
> $sequence = [sas];
> How can I get rid of the leading and trailing brackets and just have
> $sequence = sas;
> 
$sequence =~ s/\[([^]]+)\]/$1/g;
  This will remove it.
Wags ;)
> One way I thought of was :
> chop($sequence);
> reverse($sequence);
> chop($sequence);
> reverse($sequence);
> 
> This doesnt seem very clever. Can someone please help ?
> 
> Thanks,
> Suchindra
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



  Any questions and/or problems, please let me know.

  Thanks.

Wags ;)
Int: 9-8-002-2224
Ext: 408-323-4225x2224



***
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: parsing large file for character usage

2004-06-01 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Can anyone seem to think of a less memory intensive way of doing this
> (besides chopping the file up into smaller chunks -- which is my next
> step unless I receive a better option?
> 
> The txt file is 335MB.
> 
> The column and row delimiter can change, but needs to be an "odd
> mutli-char delimiter" due to the nature of the what the fields can
> contain (just about anything)..
> 
> Saturday morning I started this and it's consumed 591MB of memory so
> far and is still split-ting the file into @text_array (my box has
> 512MB RAM and a 1GB page file -- bumped it up prior to starting this
> script). 
> 
> Needless to say, the script is paging (as I knew it would), and I was
> hoping that it would be done after the long weekend, but it isn't... 
> :( 
> 
> Any pointers?
> 
> Code follows.
> 
> print "script started\n";
> open (FILE,"C:\\thisfile.txt") || die "File open error\n";
> print "file opened\n";
> @text_array = split(/\|\|\~\|\|\~\|\|/,);
Why read the whole file into memory? Do your split, then charcters into 
ordinals and you should be flying if done this way. By reading the whole thing into 
memory, it seems like your are just beating yourself to death when there is no real 
need for it.

Read a line, split, get char to ordinal. You are also working too hard on 
getting the characters. do a 
split( //, $WordVar) it will return each character one at a time and you can go from 
there. I guess the real question is why an ordinal when you are using a hash and could 
just as easily use the character as the key vs the number?

Just some thoughts.

Wags ;)
> print "array parsed (count = ".scalar(@text_array).")\n";
> 
> close (FILE);
> 
> print "file closed\n";
> foreach my $line (@text_array) {
>   $x++;
>   $y++;
>   if ($x> 1000) {
> print ".";
> $x=0;
>   }
>   my @columns = split(/\|\|\~\|/,$line);
>   foreach $col (@columns) {
> my $col_len = length($col);
> for my $pos (0..($col_len - 1)) {
>   my $char = substr($col,$pos,1);
>   my $ord_char = ord($char);
>   $hash{$ord_char} = $hash{$ord_char} + 1;
> }
>   }
> }
> 
> foreach $ord_char (sort {$a <=> $b} keys %hash) {
>   print $ord_char." (".chr($ord_char).") - ".$hash{$ord_char}."\n";
> }
> 
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



  Any questions and/or problems, please let me know.

  Thanks.

Wags ;)
Int: 9-8-002-2224
Ext: 408-323-4225x2224



***
This message conatains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
***


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Convert string Lenght to 3 Hex Values

2004-05-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Greetings perlers,
> 
> new PSQ for you, so please bear with me. I'd like to convert the
> lenght of a string into 3 Hex Values, eg.
> if length($str) == 5 it would print 00 00 05
> 

You can use sprintf and %x along with a size, though I am thinking you want it 
broken out in 2 char bytes, but you want the value $str and not really the length.  If 
you provided a liitle input or a real example of what you are trying to do, I believe 
we could be of better assistance.


Wags ;)
Int: 9-8-002-2224
Ext: 408-323-4225x2224



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Incorrect time being outputted ( off by 8 hours )

2004-04-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
$Bill Luebkert wrote:
> Wagner, David --- Senior Programmer Analyst --- WGO wrote:
>>  I have looked at the problem machine(XP Professional) and looked at
>> two others (one running xp prof and one w2k). They both come back
>> with the correct time.  The time on the machine is correct, but for
>> 0927 PDT I get 1627 PDT. Now I get the incorrect error whether I use
>> MKS Kornshell or MS command prompt.
>> 
>>  I have tried TZ=PDT, but this seems to have no effect.
>> 
>>  I sent this to Beginner's list, but got no response which helped.
>> 
>>  Any ideas and/or suggestions would be greatly appreciated.
>> 
>>   Thanks.
>> 
>>  ps I have done the simplest of scriptsperl -e "print
>> scalar(localtime)".
> 
> Have you tried 'PST8PDT' ?  Should work without a TZ though.  Are
> you in PT or another zone and using PT ?
> 
> If that doesn't work, show your exact script and exact output along
> with expected output.

Sorry to be so slow, but wanted to check things out.  When I changed it to 
PST8PDT, then it worked. But your comment that it should work without the TZ. So went 
and checked my other machine.  It did not have it ( though it was AS 5.8.2 build 808 
while my notebook is AS 5.6.1 Build 635), so maybe something had changed Perl wise. So 
went ahead and removed, re-booted and it worked fine without the TZ.  So that is the 
way I will keep it.

Again thanks for the time, $Bill.

Wags ;)
Int: 9-8-002-2224
Ext: 408-323-4225x2224



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Incorrect time being outputted ( off by 8 hours )

2004-04-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO

I have looked at the problem machine(XP Professional) and looked at two others 
(one running xp prof and one w2k). They both come back with the correct time.  The 
time on the machine is correct, but for 0927 PDT I get 1627 PDT. Now I get the 
incorrect error whether I use MKS Kornshell or MS command prompt.

I have tried TZ=PDT, but this seems to have no effect. 

I sent this to Beginner's list, but got no response which helped.

Any ideas and/or suggestions would be greatly appreciated.

  Thanks.

ps I have done the simplest of scriptsperl -e "print 
scalar(localtime)".

Wags ;)
Int: 9-8-002-2224
Ext: 408-323-4225x2224




**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Array Hash Reference Confusion

2004-04-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> [EMAIL PROTECTED] wrote:
>> I'm having another senior moment, apparently, as the following shows:
>> 
>> my %DW_AutoSearch = ( "0x" => [ "Off", "On",  "Off", "Off" ],
>>   "0x0004" => [ "Off", "Off", "On",  "Off" ],
>>   "0x0005" => [ "Off", "Off", "Off", "On"  ],
>>   "0x0006" => [ "On",  "Off", "Off", "Off" ]
>> ); 
>> 
>> my $value = "0x0005";
>> my @outs = @DW_AutoSearch{$value};
> 
> You want
> 
> my @outs = @$DW_AutoSearch{$value};
Close, but I get an error as you have it, but get the right values when set 
like

my @outs = @{$DW_AutoSearch{$value}};
Wags ;)
> 
> You have to get the scalar value, $DW..., before you dereference
> it with the leading @.
> 
> Good luck,
> 
> Joe
> 
> ==
>   Joseph P. Discenza, Sr. Programmer/Analyst
>mailto:[EMAIL PROTECTED]
> 
>   Carleton Inc.   http://www.carletoninc.com
>   574.243.6040 ext. 300fax: 574.243.6060
> 
> Providing Financial Solutions and Compliance for over 30 Years
> * Please note that our Area Code has changed to 574! *
> 
> 
> 
> 
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Send Hex values and ASCII Values over a TCP Socket

2004-03-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Hello perlers,
> 
> I'm trying to send tome information over a TCP Socket, but I have to
> send the length of the package as Hex, and the rest as ASCII. Could
> someone explain me how to do that please? I've converted the length
> to Hex but it always sends everything as ASCII. Here's the code. it's
> a very simple program.
> 
> - code 
> use IO::Socket::INET;
> $remote_host = '127.0.0.1';
> $remote_port = 3050;
> $socket = IO::Socket::INET->new(PeerAddr => $remote_host,
> PeerPort => $remote_port,
> Proto=> "tcp",
> Type => SOCK_STREAM)
> or die "Couldn't connect to $remote_host:$remote_port : $!\n";
> $trama = "text information";
> print $socket length($trama); # This is what I need to send in
> Hex. print $socket $trama;
  printf $socket "%x", length($trama);

Wags ;)

> $answer = <$socket>;
> close($socket);
> print $answer;
> --- end of code ---
> 
> thanks in advanced.


  Any questions and/or problems, please let me know.

  Thanks.

Wags ;)
Int: 9-8-002-2224
Ext: 408-323-4225x2224



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Using RTF within email tto Outlook

2004-03-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO

I have asked this question, but received no clear cut reply on how to do this( 
I belive it is possible ), but usnure how to accomplish the task. Within Outlook you 
can have Rich Text as an email type.  I can write the message to a file and place the 
extension .rtf as part of the file and Word will open it correctly.  I can take that 
same file, select all and copy into an email msg which will make it a rich text 
message.

Where it is unclear to me and no one has been able to provide an example is 
how to generate the right mesage setup using Sendmail, Sender or  to make it come 
up in mail as a rich text email without attachments.

Has anyone done this and if so, can I see the snippet of code which pulls it 
together and sends as rich text?

  Any questions and/or problems, please let me know.

  Thanks.

Wags ;)
Int: 9-8-002-2224
Ext: 408-323-4225x2224




**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Windows not passing args. in @ARGV - why not???

2004-03-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO



I need some help 
with a dumb problem I've got:For some reason, arguments from the Windows 
cmd.exe command line are no longer being passed into my Perl scripts via 
@ARGV.Used to work fine.I tried removing Perl. Reinstalled (ActiveState) Perl (5.8.3.809-MSWin32-x86.msi) (on XP). No help!Anyone 
have any ideas?I have noticed of late that when you do file 
assoications which one has under windows, it is not setup correctly.  Under 
folders and File Types, for perl and Run command, it should look 
something like:
 
perl.exe "%1" %*
 
    If it does not, then change it as such and you should get 
your arguments.  If it already looks like that, then need a snippet of your 
code so we can help.
 
  Any questions and/or problems, please let me know. 
  Thanks. 
Wags ;) Int: 9-8-002-2224 
Ext: 
408-323-4225x2224 
 

**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Regex matching of patterns in variables

2004-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO

hey all,

Scratchin' my head on this one for a couple of hours now, looking at camels. sheep and 
other documentation creatures to no avail.  I'm trying to match a pattern that's 
already (must be) in a variable like so:

$var = "coyote";
while () {
  if ($_ =~ /$var/i) {
print $_ . " matches\n";
};
  };

great - this works until I come to 

$var = "Wile E. Coyote";

and fails to match.  Is there a way to do this?

Why do you say it fails. Here is a small script which mataches:

use strict;

my $var = "Wile E. Coyote";
while () {
  chomp;
  
  if ($_ =~ /\Q$var\E/i) {  # should use \Q \E to tell the regex to not use any of the 
special characters w/in
# the regex.  The . would be allow E? as a hit: 
Wile E? Coyote.
print $_ . " matches\n";
};
  };

__DATA__
The Coyote was here.
He is not here!!
Returns the coyote.
Then Wile E. Coyote returns here.

tia,
Glen
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: subroutine name

2003-12-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
It is the caller subroutine.  I use it for printing start and stop times for 
particular subs. So the print sub references who called him by something like:

#!perl -w

sub a {
&c;
$caller = (caller(0))[3];
$caller =~ s/.*:://;
print "0 I am $caller\n";
 };

sub b {&c};
sub c {
  my $caller = (caller(1))[3];
  $caller =~ s/.*:://;
  print "called by $caller\n";
  $caller = (caller(0))[3];
  $caller =~ s/.*:://;
  print "1 I am $caller\n";
}

a;
b;

chomp(my $res = );
outputs:

called by a
1 I am c
0 I am a
called by b
1 I am c

A starting point. Only gets you started.

Wags ;)

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Eckart Uhlig
Sent: Friday, December 19, 2003 12:41
To: [EMAIL PROTECTED]
Subject: subroutine name


Hi all,
is there a way to determine the name of the current called subroutine? I
don't want to print out the subroutine's name explicitly, I'm hoping for
a 'magic' variable/ function or something like that, which I can pass to
a plain printout function. In the perlvars manpage I haven't found
anything.


# code snippet begin 
sub anySubfunc1
{
Print_func_name($magic_var)
# doing something 
}

sub anySubfunc2
{
Print_func_name($magic_var)
# doing something 
}

sub Print_func_name
{
my ($tmpname)[EMAIL PROTECTED];
print "\nprocessing sub: $tmpname";
}
# code snippet end 

Thanks in advance.
Eckart 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: File Monitoring

2003-12-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Subject: File Monitoring
> 
> 
> I've searched quite a bit for the illusionary AdvNotify and I'm
The writer of AdvNotify just seemed to disappear. At least any list that I was 
on, no one an inkling what happened. I used the AdvNotify and it was very slick and I 
wish someone would take it and make it happen again, so it could be supported.  I 
heard of the ChangeNotify ( the list will correct if wrong, but that is at David 
Roth's site, I think.) The way I understood ChangeNotify is that you had to have a 
list of what existed and work from that. The AdvNotify worked in that it let you know 
whether it was an add or delete. He somehow set in a wait state ad only fired off when 
something happened in the dir it was monitoring.  I used it for a little over 2 years 
and it worked like a charm.

Wags ;)
> unable to find it anywhere. It seems the second choice from the
> mailing list archive is ChangeNotify - again it seems to be quite
> invisible. Is there a new module out that can perform these tasks, or
> someone that knows where I can find the two above modules?
> 
> Jacob
> 
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Trying to install Perl on XP Professional -- getting dialog error 2755, 110

2003-12-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Sorry to be so slow in responding. What happened was that I was working with 
XP for the first time and made a security change and I did it at the wrong place. So 
basically ended up with no real access to the machine. Ended up having to have the 
machine rebuilt.

I just a few minutes ago retried and everything worked as it should when it 
came to installing Perl on the machine.  Just as I would have expected.

So thanks to each who responded, but as usual the real enemy was me!

Wags ;)
[EMAIL PROTECTED] wrote:
> Subject: Trying to install Perl on XP Professional -- getting dialog
> error 2755, 110
> 
> 
>   I have never had problem w/ installing Perl until I tried to install
> on XP Professional. I have tried both 5.6.1.635 and 5.81.807 and both
> fail with the same error.  
> 
>   I took a look on www.microsoft.com and it talks about .NET install
> and a problem w/ a temp folder being encrypted, but I have checked
> the temp folder where I am installing from and it is not encrypted.  
> 
>   The error dialog given is:
> 
>   Internal Error 2755, 110
>   c:\TEMP\ActivePerl-5.6.1.635-MSWin32-x86.msi
> 
>   System was just created last week. It is XP Professional Version
> 2002 Service Pack 1 w/ 504 meg of memory. 
> 
>   Any ideas or where I should be looking?
> 
>   Thanks!
> 
> Wags ;)
> 


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Seemingly simple???

2003-12-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Subject: Seemingly simple???
> 
> 
> Hello,
> 
> I have a small problem, which at first seems simple, but has proven
> to be a bit of a hair puller. 
> 
> A collegue and I are importing some windows formatted ascii files
> (onto our linux systems) and extracting certain string data.  Simple
> enough.  However, our problem is that some of the string data is
> terminated with what appears to be a windows carriage return..looks
> like this:
If Windows eol then it is hex d followed by hex a, so you would need to change 
da to \n.  What you could do is, ftp the data and it should handle the changes or open 
the file then do binmode(FILE) and then you chop twice and rewrite the output using 
std \n as part of the write.

Wags ;)
> 
> somestring^M
> anotherstring^M
> 
> I tried chop(), but it does not seem to recognize that character.
> 
> Any suggestions?
> 
> Thanks,
> Dominic
> 
> 
> 
> 
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: newline...be gone

2003-10-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote:
> Subject: newline...be gone
> 
> 
> Greetings,
> 
> I have a question that probably easy to many...
> 
> How can I get rid of the newline at the end of $line
> (which transfers to $remainder after splitting)?
If it is not off your system and you are getting the data from Unix, then 
their end of line and the end of line for Windows are different. So when you do chomp, 
chomp uses the variable $/ and what it has for doing the chomp. Otherwise if win to 
win, does not make sense. Chomp works like a champ at what it does.

Wags ;)
> 
> foreach $filename (@filelist) {
> open(INPUT,"$filename");
> foreach $line () {
>   chomp($line);
>   my ($gene,$remainder) = split(/\t/,$line,2);
>   chomp ($remainder);
>   $genedex{$gene} .= "$remainder\t";
> }
> }
> 
> 
> I've tried substituting, chomping, but the newline
> remains.  It's gotta be something obvious...
> 
> Thank you very much,
> David
> 
> __
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Using scientific notation as a numeric value within a CVS file?

2003-09-30 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Hanson, Rob wrote:
> Unless you need something specific, you can use them as is since
> those are valid numbers in Perl...
> 
> print "9.12e-002" * 1; # prints 0.0912
> print "9.12e-002" * 2; # prints 0.1824
> print "9.12e-002" + 100; # prints 100.0912
> 
> These all give correct answers.  Did you need to convert them back to
> the e-notation?
> 
> Rob
No. Just didn't think it would be so simple. But that is Perl.  

Thanks for the help.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Reg Expression missing last char?

2003-09-17 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Capacio, Paula J wrote:
> I am using $1 and $2 to retain data from a matched regular expression.
> I expect $1 to contain the KEY ID and $2 to contain USER NAME, but $2
Pauls, If you put a slash between $1 and $2, you will find out that it is not 
doing what you think. You will find that $1 is getting everything but depending on the 
line except for the last character. Since you use .* then this will always be 
satisified with nothing in $2.  From what I can see, you should be able to do 
something like along with changing the print:

if ($line =~ /DSS  p.+\].{1}(\S+).{1}(.+)/) {
print "Expression matched and retained: \{$1\}/\{$2\}\n\n";

which will give output:

*DSS  pair 1024/1024 [VI---] 0x2BEAF881 American Family Insurance
Expression matched and retained: {0x2BEAF881}/{American Family Insurance}

 DSS  pub  2048/1024 [-] 0x8E5DAD1A operator2<[EMAIL PROTECTED]>
Expression matched and retained: {0x8E5DAD1A}/{operator2<[EMAIL PROTECTED]>}

 DSS  pub  3072/1024 [-] 0xBE71303F another/americanfamily <[EMAIL PROTECTED]>

Expression matched and retained: {0xBE71303F}/{another/americanfamily <[EMAIL 
PROTECTED]>}

 DSS  pub  1024/1024 [-] 0xB04F7DAA swisscow
Expression matched and retained: {0xB04F7DAA}/{swisscow}

 DSS  pub  2048/1024 [-] 0xAA2F4ABA SLM <[EMAIL PROTECTED]>
Expression matched and retained: {0xAA2F4ABA}/{SLM <[EMAIL PROTECTED]>}

May not be completely correct, but shoudl give you a start.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Using Perl to send Text messaging to Mobile Phone

2003-09-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I looked on Activestate site and found a Python script, but nothing from Perl. 
Also looked on CPAN, but nothing stood out or I am using the wrong words in search.

Anyone done it? I am attempting to go to ATT WireLess. I have a running 
application, but want to have a separate process checking that it is up and working. 
If it goes down, I want to send a text message to my phone.

Thanks.

Wags ;)



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for 
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Where am I going wrong with OLE and MS Word?

2003-09-02 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Brad Smith wrote:
> I have written a little app, where I would like to dynamically create
> a directory of resource providers, using Perl OLE and Word10.  I would
> like the directory to contain:
> 1.  A full page color graphic
> 2.  Table of Contents
> 3.  Contents:  each resource provider listed on a page, separated by a
> page break.
> 
> Each of these aspects I have successfully performed, individually.
> Where I am having my problems is in setting ranges for different
> formatting.  For instance, the first page, the cover art should bleed
> to the edges.  Then, a page break, then the Table of Contents, with 1"
> borders all the way around, page break, followed by the resource
> provider listings, each separated by a page break and formatted w/ 1"
> borders.
> 
> I begin by using 'PageSetup' to set all margins to 0" (for full
> bleed). Then, I add the InlineShape to the first page.  Everything
> works to that point.  Now, I would like to reset the page borders to
> 1" all around and begin adding the Table of Contents and other text. 
> Unfortunately, every time I adjust the PageSetup parameters, ALL the
> margins are reset, negating the 0" margins I had established for the
> cover art. 
> 
> I have read every archived email re: OLE and Word, combed my Office
> Developer's Guide book (VBA), searched Google for anything available,
> but the examples I have found do not address multiple page margins
> within a single document.
I do not have Word 10, but in Word 9 when you are on the setup page, there is 
an entire document or from this point forward as regards the margins.  I assume you 
are getting the whole document and what you need after the first Pagesetup is to use 
from thie point forward for any others which follow.

Not much help, but at least a little input.

Wags ;)
> 
> Below is the code I have written so far.  Is there anyone out there
> who has fond experiences with OLE automation of Word who can help me
> through this?  Thanks in advance.
> 
> use Win32::OLE;
> use Win32::OLE::Const 'Microsoft Word';
> 
> my($outputFile) = "c:/check_this_file.doc";
> 
> my($WordApp) = Win32::OLE -> new('Word.Application', 'Quit');
> $WordApp-> {Visible} = 1;
> $WordApp -> Documents -> Add;
> 
> $PageSetup=$WordApp->ActiveDocument->PageSetup;
> $PageSetup -> {LeftMargin}  = $WordApp -> InchesToPoints(0);
> $PageSetup -> {RightMargin} = $WordApp -> InchesToPoints(0);
> $PageSetup -> {TopMargin}   = $WordApp -> InchesToPoints(0);
> $PageSetup -> {BottomMargin}= $WordApp -> InchesToPoints(0);
> 
> $coverart="c:/find-out_directory_cover.jpg";
> $InsertCover=$WordApp->Selection->InlineShapes-
>> AddPicture({FileName=>$coverart});
> $InsertCover=$WordApp->Selection-
>> InsertBreak({Type=>wdPageBreak});
> 
> $PageSetup2=$WordApp->ActiveDocument->PageSetup;
> $PageSetup2 -> {LeftMargin}  = $WordApp -> InchesToPoints(0.75);
> $PageSetup2 -> {RightMargin} = $WordApp -> InchesToPoints(0.75);
> $PageSetup2 -> {TopMargin}   = $WordApp -> InchesToPoints(0.75);
> $PageSetup2 -> {BottomMargin}= $WordApp -> InchesToPoints(0.75);
> 
> $WordApp->Selection->Font->{Size} = '12';
> $WordApp->Selection->TypeText( "Let's try some text in here to see
> what happens." );
> $WordApp->ActiveDocument->SaveAs({FileName=>$outputFile,
>   FileFormat=>wdFormatDocument});
> $WordApp->ActiveDocument->Close();
> $WordApp->Quit();
> 
> Brad Smith
> 
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Regex Help Needed

2003-09-02 Thread Wagner, David --- Senior Programmer Analyst --- WGO



    I wanted to use tr but was uanble to accomplish the 
task that way. So I used regex like the following:
 
use strict;
 
my %MCTWW = qw(m -1 e -1 v -1 q -1 g -1 n -1);my $MyCharsToWorkWith = 
\%MCTWW;
 
$_ = '--mepqgn ';
 
if ( ! /-{1,2}(\S+)/ ) {    printf "Expecting a hyphen 
or two floowed by non space, but did not get a hit.\n";    
printf "Data: <%-s>\n", $_;    printf "Correct and rerun.\n";    exit(1); }my $MyData = 
lc($1);my $MyMiss = 0;my $MyOrigData = $MyData;
 
foreach my $MyChar (keys %{$MyCharsToWorkWith}) {    
$MyCharsToWorkWith->{$MyChar} = ( $MyData =~ s/$MyChar//g 
);    $MyMiss++ if ( ! $MyCharsToWorkWith->{$MyChar} ); }
 
if ( $MyMiss ) {    printf "Not all characters were 
present in passed data. I had $MyMiss misses.\n";    printf 
"Data was %-s and invalid data was %-s\n", $MyOrigData, $MyData; }else 
{    printf "All necessary characters were 
present.\n"; }
 
From your description they should only appear once, doesn't matter sequence. I believe it could be a starting place.
 
Wags ;)

  -Original Message-From: Dax T. Games 
  [mailto:[EMAIL PROTECTED]Sent: Tuesday, September 02, 2003   10:26To: Perl UsersSubject: Regex Help 
  Needed
  I have a list of characters.  I need to get 
  a list of all possble sequences of these characters for example.  
  
   
  I have a string that consists of '-mevqgn' I need 
  to pattern match any combination of 'mevqgn' with a preceding - or 
  --.
   
  Right now this is what I am doing but it is very 
  ugly and difficult to come up with the combinations and it makes my brain 
  hurt!:
   
   if ($LS_Val =~ 
  /-{1,2}(mevqgn|   
  emvqgn|evmqgn|evqmgn|evqgmn|evqgnm|   
  veqgnm|vqegnm|vqgenm|vqgnem|vagnme|   
  qvgnme|qgvnme|qgnvme|qgnmve|qgnmev|   
  gqmnev|gmqnev|gmnqev|gmneqv|gmnevq|   
  mgnevq|mngevq|mnegvq|mnevgq|mnevqg|   
  nmevqg|nemvqg|nevmqg|nevqmg|nevqgm|   
  envqgm|evnqgm|evqngm|evqgnm|evqgmn|   
  )/i) 
  {    #Do Something;
  }
      
   
  A subroutine that takes the string of 
  characters as an argument and then returns 1 on success and undef on fail   would be ideal for my purpose.
   
   
  Any help is appreciated.
   
  Dax

**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.





RE: Character Class Question

2003-08-04 Thread Wagner, David --- Senior Programmer Analyst --- WGO
steve silvers wrote:
> No... This is not the problem.. I wrote a small snippet to show the
> problem..
You will have to anchor in some way or otherwise you will get the H for HH. So 
depending on how you $a , the you could do ^(H|V|P|BI|B)$ or if if could be a space or 
some other character, then you could add another () like ^(H|V|P|BI|B)($| ) which says 
either whitespace or end of variable(or line).

Wags ;)
> 
> run this..
> 
> 
> 
> #/Perl -w
> 
> use strict;
> 
> my $a = 'HH';
> 
> # FULL DAYS
> if($a =~ /H|V|P|BI|B/) {
>   print qq(FULL - $a );
> 
> }
> # HALF DAYS
> if($a =~ /HH|HV|L/) {
>   print qq(HALF - $a );
> 
> }
> 
> It will print - "FULL - HH HALF - HH"
> 
> Why? And how do I make it so it only picks up on the half days in
> this case? 
> 
> Steve
> 
> 
> 
> 
> 
> 
> Now $a is passed from a select box so it's either HH (Half Holiday)
> or HV (Half Vacation).. If I use HH it will work, but when I use HV
> it still uses HH. Almost like it stops on the first H and is
> satisfied. 
> 
> 
>> From: Will of Thornhenge <[EMAIL PROTECTED]>
>> To: [EMAIL PROTECTED]
>> Subject: Re: Character Class Question
>> Date: Mon, 04 Aug 2003 12:06:26 -0700
>> 
>> The regex is mixing character classes and alternative phrases in a
>> confused way. 
>> 
>> 
>> steve silvers wrote:
>> 
>>> Could someone please make this a bit more clear for me. I'm getting
>>> not wanted results.. 
>>> 
>>> I have:
>>> 
>>> if($PAYCODE =~ /[L]|[H]|[HH]|[HV]/gi) {
>> 
>> 
>> This is more clear:
>> 
>>  /[LHV]{1,2}/gi
>> 
>> which would pick up every possible one or two letter combination.
>> 
>> But probably this is what's needed
>> 
>>  /L|H|HH|HV/gi
>> 
>> if those four alternatives are the only ones that should succeed.
>> 
>> I'm a little confused by the presence of the "g" modifier but
>> perhaps the snippet is too short to show what it is doing.
>> 
>> Hope that helps,
>> 
>> --
>> Will Woodhull
>> [EMAIL PROTECTED]
>> 
>> 
>> 
>>> 
>>> blabla...
>>> 
>>> }
>>> 
>>> The paycodes are selected via a select box so I have L and H and HH
>>> etc. I seems as thought the single H and double HH don't work quite
>>> as I want them to.. In the above piped search I want just each
>>> letter. do I need to specify start and end in each one like
>>> /[^L$]|[^H$] 
>>> 
>>> It seems like the single H will pick up when the double HH is
>>> selected.. 
>>> 
>>> Any ideas?
>>> Thanks in advance.
>>> Steve


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Unsure How To Automate

2003-06-27 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Peter Guzis wrote:
> 3) Use Win32::AdvNotify if you can find it
> 
> Peter Guzis
> Web Administrator, Sr.
> ENCAD, Inc.

Be careful on this path, since the author is not around any more ( disappeared 
or at least I have never heard what happened to him). I use it but it is a very static 
environment and if you have problems there is no source available unless someone has 
it and then I would love to get a hold of it.

So be warned of this path.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: get the complete path to a file

2003-03-27 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Olaf Seywald wrote:
> Hello,
> 
> I want to "find" (like in unix) files with the complete path. How can
> I do this.
> 

Here is a starting portion for you:
#!perl -w

use File::Find;

# calls wanted() for each file found

find(\&wanted, 'topdirectoryyouwanttostartat');

sub wanted
{
   # check to see if the file exists, could be
   # used instead to skip binary files, or whatever.
   return if ( -d $_);  # if directory bypass
   return if ( ! /0\.pl$/i );  # I wanted only to see files which ended in 0.pl as 
part of their
 # name.
 # you put what you want to do her
   # $File::Find::name is the full path
   printf "%-s\n", $File::Find::name; # I am just printing the files I found

}

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Hiding STDIN (keyboard) while typing

2003-03-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Gregory, Carlton wrote:
> Good Day All,
>   I was wondering if anyone has previously run a Perl script that
> hides the STDIN from being printed to the STDOUT (console window)
> while typing?
> 
> As in when getting prompted for a password.
> 
> Is there a Console module maybe Win32::Console?
> 
perldoc -q password

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: blanks from hell!

2003-02-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO



    You might try:
 
    system("secondapp $switches \"$filelist[$i]\"")
    which should make the second argument the filename regardless of whether 
it has spaces or not.
 
Wags ;)
 

  -Original Message-From: Steve 
  [mailto:[EMAIL PROTECTED]]Sent: Saturday, February 15, 2003 
  09:43To: 
  [EMAIL PROTECTED]Subject: blanks from 
  hell!
  I am having hell with blanks in file and 
  directory names.  I have an application that gets a list of files (using 
  opendir/readdir) then runs a second perl application (perlapp 
  binary) on them, one by one.  So the absolute path/filename from the list 
  is passed to the second app as an argument, as in system("secondapp $switches 
  $filelist[$i]")
   
  This works great unless there are blanks embedded 
  in $filelist[$i].  In that case, when secondapp 
  runs, $ARGV[1] is truncated at the first blank so obviously it can't 
  open the file.  Do I have to escape the blanks in @filelist before 
  starting these calls?
   
  tiaSteve
   
   

**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.





RE: Interacting With Exchange..

2003-01-30 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Barlow, Neil wrote:
> Hi experts,
> 
> I am trying to write an inbox monitoring script that will monitor an
> inbox on exchange and alert if there are any new mails.
> I have been looking at Mail::POP3Client and Mail::POP3Client and these
> modules do successfully connect but the count and delete commands do
> not seem to return accurate information in regards to the number of
> mails and successfully deleting the mail.
> 
> Is there a module in existence for interacting with Exchange?
> I have included my code below in case there is a problem with my code.
> 
> 
> use Digest::MD5;
> use Mail::POP3Client;
> 
> $mail_server = "...";
> $user = "...";
> $pwd = "...";
> 
> my $pop = new Mail::POP3Client(
> HOST => $mail_server,
> USER => $user,
> PASSWORD => $pwd,
>   );
> 
> $pop->Connect();
> $number = $pop->Count();
> print "Here is the number of unread mails... $number\n";
> 
> for ($i = 1; $i <= $pop->Count(); $i++)
> {
>   foreach ( $pop->Head( $i ) )
>   {
>/^(From|Subject):\s+/i and print $_, "\n";
>   }
>   print "\n";
>   $pop->Delete($i);
>   my $test = $pop->Count();
>   print "Number now.. $test\n";
> }
> 
> $number = $pop->Count();
> $pop->Close();
> print "   Here is the number of unread mails... $number\n";
> 
> 
Neil,
  I tried this and got the same thing.  SO I went and did some research in
the docs.  You might want to add some debugging to your code.  I added DEBUG
=> 1 and I am unable to get the right user setup.  You don't need the
'$pop->Connect();' since you are doing the connection as part of the new.

  So maybe someone out there can explain what it is searching for when they
ask for user? With debug it complains about unknown user name or bad
password. I have a tried a number of different ids to to no avail. 

  I would like to know what is needed?

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: What happens when Perl hits a ctrl-z in a text file?

2003-01-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Howard Maher wrote:
> I am getting inconsistent results when my perl scripts hit a ctrl-z
> character (old DOS eof marker) in various text files that I am
> reading.  
> 
> Sometimes Perl skips to a seemingly random spot further in the file
> (very unexpected) and continues reading in lines, and then sometimes
> it just dies right there (expected).  I've watched both behaviors
> occur in the Visual Debugger from AS.   
> 
> Can someone tell me why this behavior occurs?
> 
> TIA,
> Howard Maher
Sounds like you have a combination of binary and ascii data, so if
that is true, bthen you need bindmode against the file. If you don't do
this, when it hits those binary cahacters depending upon what they are, they
can cause your script to do unexpected things.

Wags ;)


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Perl Recursive

2003-01-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO



    I had one using File::Find. The only thing it does not 
do is create new directory in the base directory.  I made up a folder name 
called junker(change to what you need) and created that.  
Hopefully a starting point.
  
 
#!perl -w
 
use File::Find;$diff = 0;get_time();
 
my $MyStartTime = sprintf "%02d:%02d:%02d-%02d/%02d/%02d", $hour, $min, 
$sec, $YearModulo, $mon, $mday;
 
printf "Please enter starting directory: ";$x = 
;chomp ($x);$GlblCrtCnt = 
0;find(\&getdir,$x);printf "Number of Directories created: %5d \n", 
$GlblCrtCnt;get_time();
 
my $MyEndTime = sprintf "%02d:%02d:%02d-%02d/%02d/%02d", $hour, $min, 
$sec, $YearModulo, $mon, $mday;
 
printf "\nStart Time: %-s\n", $MyStartTime;printf "End   
Time: %-s\n\n", $MyEndTime;   print "program 
completed";chomp(my $Inp = );
 
sub getdir {    return if (/\.{1,2}$/ 
);    return if ( ! -d );    return if ( 
/junker$/i );    printf "Dir: %-s\n", $File::Find::dir . '/' 
. $_;    # $File:Find::dir gives you 
the base path    # 
$_  
gives you the current directory    my $MyNewDir = $_ . 
'/junker';    if ( ! -d $MyNewDir ) 
{   if ( mkdir( $MyNewDir ) ) 
{
      
$GlblCrtCnt++;
    }else{
  warn "Unable 
to create directory $MyNewDir: $!";
    } 
}}
 
sub get_time {    $diff = $diff * 
86400;    
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time - 
$diff);    $mon++;    $diff = 
0;
    undef $wday;
undef $yday;
undef $isdst;    $YearModulo = 
$year % 100;     }  # end of 
get_time^-- End of script here
 
Wags ;)
 

  -Original Message-From: Xcomb 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, January 03, 2003 
  04:56To: 
  [EMAIL PROTECTED]Subject: Perl 
  Recursive
  Yeah
  well this is my home directory /home/xcomb   
  what i would like to do it to go all the subdirectories of that home 
  directory that has many folders and in each folder to create Trash folder 
  untill it reaches the end of subdirectory  
  i know it has something to do with a loop statement but can't figure out on 
  my own or find source on internet 
  ThanksThis mail was 
  sent by UebiMiau 2.5 ___ 
  Perl-Win32-Users mailing list [EMAIL PROTECTED] To 
  unsubscribe: 
http://listserv.ActiveState.com/mailman/mysubs

**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.





RE: Convert int to bitstring

2002-12-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Title: Convert int to bitstring



    Here is one using printf and you could use 
sprintf:
 
$_ = "255.255.255.224";
 
foreach ( split(/\./, $_ ) ) {    printf "%b\n", 
$_; } 
Output:
1110
 
Wags ;)

  -Original Message-From: Bullock, Howard A. 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, December 18, 
  2002 10:26To: 
  [EMAIL PROTECTED]Subject: Convert int to 
  bitstring
  I want to convert int(255) to a string of 8 ones (). I have been trying to 
  use unpack, but am missing something basic I think.
  I was also playing with the following with less than successful results. What am I 
  doing wrong? One guess was the the @mask elements are string values and 
  the bitwise operation are not performing as I 
  initially expected.
  $mask = "255.255.255.224";
  @mask = split(/\./,$mask,4);
  $mymaskval = 
  ($mask[0]<<24)|($mask[1]<<16)|($mask[2]<<8)|$mask[3];
  $setbits = unpack("%32b*", 
  $mymaskval);
  I have read the unpack docs but did not 
  see references to the "%" 
  and "*" 
  in "%32b*". 
  Can someone explain this as well.
  Howard A. 
  Bullock
  Global IT Infrastructure
  717-810-3584
  

**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.





RE: sorting version numbers

2002-12-02 Thread Wagner, David --- Senior Programmer Analyst --- WGO
uncertain how you were getting the data, but here is one shot:

my @MyData = qw(4.0.0.10 4.0.0.9 4.0.1.0);
foreach my $MyKey(sort {$b->[1] <=> $a->[1] ||
$b->[2] <=> $a->[2] ||
$b->[3] <=> $a->[3] ||
$b->[4] <=> $a->[4]   } map{[ $_ , split(/\./, $_)
]} @MyData) {
   printf "%10s\n", $MyKey->[0];
 }

This will have the first entry through being the highest version. Assumes
numeric only input.

Wags ;)

-Original Message-
From: Christopher Hahn [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 13:33
To: Perl win32 email list ([EMAIL PROTECTED])
Subject: sorting version numbers



Hello,

I am wondering what the perl-best-practice approach to sorting version
numbers might be.

I am looking at strings like "4.0.0.10", "4.0.0.9", "4.0.1.0", etc
and I need to determine the "highest", in this case 4.0.1.0.

Previous experience suggests splitting each of these into a list of numbers
and then comparing two "versions" by comparing each component number
until a winner is found.

Is there an existing (semi-built-in?) solution to this problem?

TIA for any pointers?

Christopher

-- 
There are only 10 types of people in the world:
Those who understand binary and those who don't.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: executing plx -- seems to be a common problem

2002-10-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO

Know that it is for pm/pl, but would have to ask someone from AS if
plx is the std.  I don't know.

Wags ;)

-Original Message-
From: Josh Zeckser [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 11, 2002 20:48
To: [EMAIL PROTECTED]
Subject: RE: executing plx -- seems to be a common problem


Any idea how to make ActivePerl set this on install? Maybe it should be put
into the source tree?

Josh Zeckser
Digitizing
[EMAIL PROTECTED]
503-419-5036
http://www.nobeltec.com


-Original Message-
From: Wagner, David --- Senior Programmer Analyst --- WGO
[mailto:[EMAIL PROTECTED]]
Sent: Friday, 11 October, 2002 12:09 pm
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: executing plx


To verify that you have the correct setup, you start Windows
Explorer. Then select:
View, Options, File Types
Within FIle Types, move down until you find the correct Perl (ie,
PLX). 
Then move into edit and you should have 'Run' and edit the 'Run'.

'Run' should look something like:

perl.exe "%1" %*

Your perl.exe may be fully qualified, but it needs the "%1" and %*
to pull script being executed("%1") and Arguments(%*).

Wags ;)


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 11, 2002 11:23
To: [EMAIL PROTECTED]
Subject: executing plx


Hello all:

A simple problem no doubt - I have a new server that may not have
been configured properly for perl scripts. We are running some scripts as 

xxx.plx PARAMETER

from the NT 4 command line. However, the script does not pick up the
PARAMETER even if I specifically run it as:

perl.exe xxx.plx PARAMETER

I am sure this is something to do with associations but am not sure
how windows knows to use perl if it encounters .plx as our other machines do
this fine but with no association set up for .plx

Can anyone help with this?

thanks in advance
peter ward



>  


_
This message may contain privileged information. If you have received this
message by mistake, please keep it confidential and return it to the sender.

Although we have taken steps to minimise the risk of transmitting software
viruses, the EBRD accepts no liability for any loss or damage caused by
computer viruses and would advise you to carry out your own virus checks. 
The contents of this e-mail do not necessarily represent the views of the
EBRD.
__

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Regexp with 0

2002-09-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Title: Regexp with 0



    Change to an if:
 
    
if ( CARACTER[$i] =~ /^(a|b|1|0)/g; 
) {
    #true
 }else {
    # false
 }
 
Wags ;)

  -Original Message-From: "Muñoz O, Normann   (Valparaíso)" [mailto:[EMAIL PROTECTED]]Sent: Friday,   September 06, 2002 14:36To: 
  [EMAIL PROTECTED]Subject: Regexp with   0
  Hi, I have a question: 
  I get from STNDIN a string, for each caracter I 
  check if it belong to a predifined  group, the problem is that the   caracter '0' is in that group'. As 0 es false, the match doesn't consider 
  it.
  ¿How can I do that so the match take it as a 
  caracter an not as false? 
  CARACTER[$i] =~/^(a|b|1|0)/g; 
  Thanks. 
  ATTE: 
  Normann Muñoz Oyarzún. Administrador de Sistemas El Mercurio de Valparaíso S.A.P. 264188 - 204189 [EMAIL PROTECTED] 

**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.





RE: Weird behavior of this mailing list

2002-05-02 Thread Wagner-David
Title: RE: Weird behavior of this mailing list



    Running Outlook + exchange also.
 
Wags ;)

  -Original Message-From: Peter Eisengrein 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, May 02, 2002 
  10:33To: 'Harikrishnan Bhaskaran'; 
  '[EMAIL PROTECTED]'Subject: RE: Weird 
  behavior of this mailing list
  Looking at all the replies to that email, it would appear that 
  you and David Wagner have the same issue. 
  > -Original Message- > 
  From: Harikrishnan Bhaskaran [mailto:[EMAIL PROTECTED]] 
  > Sent: Wednesday, May 01, 2002 17:04 > To: '[EMAIL PROTECTED]' > Subject: Weird behavior of this mailing list > > > 
  Hi, > > May be it is may 
  mailer (outlook + exchange), but sometimes > when I 
  send a reply, the subjects gets changed a little bit > usually a single space or so by the time it reaches me back 
  > via the mailing list. For example, just minutes 
  ago > I replied to a message for mod_perl and the 
  subject has > an extra space after the last word 
  'installation', but before > the '?'. Now if I look 
  at my Sent Items, I have the subject > correctly. 
  This messes up the (already poor) threading given > 
  by outlook. I have seen this once before too. Is this a problem 
  > at my end, or has anyone else seen this before? 
  > > -- > Hari > > 
  ___ > 
  Perl-Win32-Users mailing list > 
  [EMAIL PROTECTED] > To 
  unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 
  > 


RE: Question

2002-04-18 Thread Wagner-David
Title: Question



    When you use double guotes, then what perl sees 
in
    
, "c:\text1.txt" is c:text1.txt vs c:\text1.txt  

 
    
You need to use double slashes("c:\\text1.txt", single quotes then it won't do a 
translation, so 'c:\text1.txt' would be correct or you can change the backslash 
to a forward slash(ie, "c:/text1.txt") would work correctly.
 
Wags 
;)

  -Original Message-From: Thiago Burin 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, April 18, 
  2002 10:24To: 
  [EMAIL PROTECTED]Subject: 
  Question
   Hi, 
   First of all, I would like to say  I am 
  a beginner. 
   Well, I have had a problem with the "open" 
  function. I wrote the following code: 
    --   open in , "c:\text1.txt" or 
  die "error reason: $!\n"; 
   I intended to open an existing file to write 
  on it. However, whenever I run this code an error message appear: "Invalid 
  Argument". I have tryied lots of changes in the code, but they weren't 
  successfull! Could anybody help me? Is it a library problem?
   Thanks, 
     Thiago 



RE: reverse of substr?

2002-04-16 Thread Wagner-David

Let the perl do the work. Do a search once
#!perl -w
use strict;

my $string="some text here 00 and some more here";
# the zeros start at 25
my @integers = (1, 12, 123, 1234, 12345, 123456, 1234567, 12345678,
123456789, 1234567890);
my $first ;
my $last ;
if ( $string =~ /^(.+)\d{10}(.+)/ ) {
   $first = $1;
   $last  = $2;
 }else {
   printf "Expecting a string with 10 digits of zero, but did not find it!\n";
   printf "Data received:\n%-s\n", $string;
 }
 
foreach my $integer (@integers) {
printf "%-s%10d%-s\n", $first, $integer, $last;
}
^- script ends here

Output:
some text here  1 and some more here
some text here 12 and some more here
some text here123 and some more here
some text here   1234 and some more here
some text here  12345 and some more here
some text here 123456 and some more here
some text here1234567 and some more here
some text here   12345678 and some more here
some text here  123456789 and some more here
some text here 1234567890 and some more here

Wags ;)

-Original Message-
From: Matthew Musgrove [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 16, 2002 10:03
To: Wang, Pin-Chieh; [EMAIL PROTECTED]
Subject: RE: reverse of substr?


> Now, Is there a way to move interger value (2 digit or 10 digit or some
> where in between)
> into a fixed string location (say 15th position) and the interger is right
> justified.

Here's a simple example:
--
#!/usr/bin/perl -w
use strict;

my $string="some text here 00 and some more here";
# the zeros start at 25
my @integers = (1, 12, 123, 1234, 12345, 123456, 1234567, 12345678,
123456789, 1234567890);

foreach my $integer (@integers) {
my $len = length($integer);
if ($len < 10) {
for(my $i = $len; $i < 10; $i++) {
$integer = " ".$integer;
}
}
my $first = substr($string, 0, 15);
my $last = substr($string, 25);
my $newstring = $first.$integer.$last;
print "$newstring\n";
}
--

Matthew Musgrove

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Weird problems w/ PPM occuring

2002-03-15 Thread Wagner-David

Just to make sure, I went and made changes and did set save. Checked before 
going out and the changes are there, but when I come back in, they are gone.

I have an older version of MKSToolKit, but I have had no problems in the past 
doing installs, etc.  I even went to the comand prompt and still after the save and 
coming back into ppm, it is all gone.  I don't see an error message or anything.

Just continued to be baffled??
Wags ;)

-Original Message-
From: Wagner-David 
Sent: Friday, March 15, 2002 09:38
To: 'Edward G. Orton'; 'Perl Win32'
Subject: RE: Weird problems w/ PPM occuring


Yes. I did set save.
Wags ;)

-Original Message-
From: Edward G. Orton [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 09:35
To: Wagner-David; 'Perl Win32'
Subject: Re: Weird problems w/ PPM occuring


- Original Message -
From: "Wagner-David" <[EMAIL PROTECTED]>
To: "'Perl Win32'" <[EMAIL PROTECTED]>
Sent: Friday, March 15, 2002 12:25 PM
Subject: Weird problems w/ PPM occuring


> I did a verify yesterday and did a load of some modules which
needed to be updated. Now each time I go into PPM all my set
info is gone. I have no repositories, etc.
>
> I am running w2k, AS Build 623 5.6.0 I know it is older, but
it does what is needed for my work.  I did not update ppm.
>
After you made changes to ppm's setup, did you do a 'set save' ?

ego
Edward G. Orton, GWN Consultants Inc.
Phone: 613-764-3186, Fax: 613-764-1721
email: [EMAIL PROTECTED]
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Weird problems w/ PPM occuring

2002-03-15 Thread Wagner-David

Yes. I did set save.
Wags ;)

-Original Message-
From: Edward G. Orton [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 09:35
To: Wagner-David; 'Perl Win32'
Subject: Re: Weird problems w/ PPM occuring


- Original Message -----
From: "Wagner-David" <[EMAIL PROTECTED]>
To: "'Perl Win32'" <[EMAIL PROTECTED]>
Sent: Friday, March 15, 2002 12:25 PM
Subject: Weird problems w/ PPM occuring


> I did a verify yesterday and did a load of some modules which
needed to be updated. Now each time I go into PPM all my set
info is gone. I have no repositories, etc.
>
> I am running w2k, AS Build 623 5.6.0 I know it is older, but
it does what is needed for my work.  I did not update ppm.
>
After you made changes to ppm's setup, did you do a 'set save' ?

ego
Edward G. Orton, GWN Consultants Inc.
Phone: 613-764-3186, Fax: 613-764-1721
email: [EMAIL PROTECTED]
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Weird problems w/ PPM occuring

2002-03-15 Thread Wagner-David

From a command prompt I ran ppm genconfig which gives me:

[D:/CurrWrka/00CommonPerl/03aaplxxx] ppm genconfig

2,1,0,0


http://www.ActiveState.com/cgibin/PPM/ppmserver.pl?urn
:/PPMServer" NAME="ActiveState Package Repository" SUMMARYFILE="fetch_summary"/>

Compress-Zlib;Archive-Tar;Digest-MD5;File-CounterFile;Font-AFM;
HTML-Parser;HTML-Tree;MIME-Base64;URI;XML-Element;libwww-perl;XML-Parser;SOAP-Li
te;PPM;libnet;libwin32


This seems close though the Roth repository was there.

From the same prompt if I go back into ppm and type set it is as in the 
original email.

Just some more info.

Wags ;)

-Original Message-
From: Wagner-David 
Sent: Friday, March 15, 2002 09:25
To: 'Perl Win32'
Subject: Weird problems w/ PPM occuring


I did a verify yesterday and did a load of some modules which needed to be 
updated. Now each time I go into PPM all my set info is gone. I have no repositories, 
etc.

I am running w2k, AS Build 623 5.6.0 I know it is older, but it does what is 
needed for my work.  I did not update ppm.

Any ideas on what might be going on?

Here is the output from a set w/in ppm:

Commands will not be confirmed.
Temporary files will not be deleted.
Case-sensitive searches will be performed.
Package installations will not continue if a dependency cannot be installed.
Tracing info will not be written.
Screens will not pause.
Query/search results will not be verbose.
Current PPD repository paths:

My std setup was:

Commands will be confirmed.
Temporary files will be deleted.
Case-insensitive searches will be performed.
Package installations will not continue if a dependency cannot be installed.
Tracing info will be written to ppm.log.
Screens will not pause. 
Query/search results will be verbose.
Current PPD repository paths:   
Roth
ActiveState

Any ideas what might be going?

Wags ;)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Weird problems w/ PPM occuring

2002-03-15 Thread Wagner-David

I did a verify yesterday and did a load of some modules which needed to be 
updated. Now each time I go into PPM all my set info is gone. I have no repositories, 
etc.

I am running w2k, AS Build 623 5.6.0 I know it is older, but it does what is 
needed for my work.  I did not update ppm.

Any ideas on what might be going on?

Here is the output from a set w/in ppm:

Commands will not be confirmed.
Temporary files will not be deleted.
Case-sensitive searches will be performed.
Package installations will not continue if a dependency cannot be installed.
Tracing info will not be written.
Screens will not pause.
Query/search results will not be verbose.
Current PPD repository paths:

My std setup was:

Commands will be confirmed.
Temporary files will be deleted.
Case-insensitive searches will be performed.
Package installations will not continue if a dependency cannot be installed.
Tracing info will be written to ppm.log.
Screens will not pause. 
Query/search results will be verbose.
Current PPD repository paths:   
Roth
ActiveState

Any ideas what might be going?

Wags ;)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Win32::AdvNotify as a Service

2002-02-15 Thread Wagner-David

I haven't tried it as a service, though I have been using it for about 5 
months on a quiet workstation. I find if I don't get all of my processes running 
first, it will cause some of the processes (not all) to not start.  I have to stop my 
script and after everything is up and running, then
restart my script.  I sent messages requesting help, but never heard a word back. I 
continue to use, but must be wary.  I looked at Dave Roth's Change script, but seemed 
like more work than necessary for looking at files which change.

Just some FYI.

Wags ;)

-Original Message-
From: Lewis, Alvin [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 06:50
To: '[EMAIL PROTECTED]'
Subject: Win32::AdvNotify as a Service


Hi,

Has anyone tried coding from Amine's Win32::AdvNotify extension into a WinNT service?
I have been playing with this module (V1.31) and have been unable to get it to work as 
a service.  My script runs fine  from a command console but hangs when I try to 
install 
it as a service using Dave Roth's Win32::Daemon extension.  The offending line seems 
to be the
thread creation:

my $thread1 = $WatchDir->StartThread(Directory   => "f:\\atlasdata\\",  
Filter   =>  DIR_NAME|FILE_NAME,
WatchSubtree =>  Yes ) ;


I'm using ActiveState build 626
Win32::api version 0.01
Win32::daemon version 0.2002.01.15

I'm using a very simple script (provided by Dave Roth) to install a service 
and I added these lines at the top:

# -#

use vars qw( $VERSION );
use Getopt::Long;
use File::Path;
use Win32;
use Win32::Daemon;
#use Win32::ChangeNotify;
use WIN32::NetResource;
use Win32::Perms;
use Win32API::File 0.08 qw( :Func );

use Win32::AdvNotify qw(FILE_NAME DIR_NAME LAST_WRITE INFINITE Yes No All 
%ActionName %ActionColor %EventName);

my $WatchDir = new Win32::AdvNotify;


my $thread1 = $WatchDir->StartThread(Directory   => "c:\\temp",  
Filter   =>  DIR_NAME|FILE_NAME,
WatchSubtree =>  Yes ) ;


# -#

The service starts OK when they are commented out but hangs with:

'Error 2186: The service is not responding to the control function'

when they are put back in!

Is there some reason your module can't work from a service?

Any suggestion would be greatly appreciated.

Cheers,
Al Lewis
PPG Industries
Lake Charles, LA  

337-708-4768


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Regex Help Please!

2002-01-10 Thread Wagner-David

Nice. Really!
Wags ;)

-Original Message-
From: dolljunkie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 11:09
To: [EMAIL PROTECTED]
Subject: Re: Regex Help Please!


A less elegant (perhaps) solution, but effective, no matter how many rows /
values:

while(<>) {

s/\r//g; # I hate that carriage return
chomp;

next if(!/^.*<\!--/); # skip non-matching lines

my @values;

my $ts = $1 if(s/<\!--\s*(.*?)\s*-->//);
my($ts1,$ts2) = split(/\s*\/\s*/,$ts);

while(s/(.*?)<\/row>(.*)/$2/g) {
my $row = $1;
while($row =~ s/\s*(.*?)\s*<\/v>(.*)/$2/g) {
push(@values,$1);
}
}

my $val_str = join(', ',@values);
print("$ts1, $ts2, $val_str\n");
}

on input:
  NaN
 NaN 
  59
 6000700

returns:
2002-01-08 09:35:00 Eastern Standard Time, 1010500500, NaN, NaN
2002-01-08 09:35:00 Eastern Standard Time, 1010500500, 59, 6000, 700


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Regex Help Please!

2002-01-10 Thread Wagner-David

I worked from the data you provided. What can the data really look like?  
Provide some other and will make mod to handle(hopefully).

Wags ;)

-Original Message-
From: Ron Hartikka [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 10:49
To: 'Gordon Brandt'; [EMAIL PROTECTED]
Subject: RE: Regex Help Please!


Works but not if you have more or fewer than 2 values in a row.
Do you?


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Wagner-David
> Sent: Thursday, January 10, 2002 1:31 PM
> To: 'Gordon Brandt'; [EMAIL PROTECTED]
> Subject: RE: Regex Help Please!
>
>
>   Here is a simplistic approach. May want more edits, but is
> a starting place.
>
>   Placing the data for testing under DATA:
>
> while (  ) {
>chomp;
>next if ( /^\s*$/ );   # bypass blank lines
>if ( /^  (.+) <\/v>
> (.+) <\/v><\/row>/ ) {
>   printf "%-s, %-s, %-s, %-s\n", $1, $2, $3, $4;
> }else {
>   printf "No hit on data:\n%-s\n", $_;
> }
>
>  }
> __DATA__
> 
>  NaN  NaN 
> 
>  6.00e+001  6.90e+001 
> ^--- Script ends here
> Output:
>
> 2002-01-08 09:35:00 Eastern Standard Time, 1010500500, NaN, NaN
> 2002-01-08 09:40:00 Eastern Standard Time, 1010500800,
> 6.00e+001, 6.90e+001
>
>   Wags ;)
>
> -Original Message-
> From: Gordon Brandt [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 10, 2002 10:17
> To: [EMAIL PROTECTED]
> Subject: Regex Help Please!
>
>
> I am trying to come up with a script to convert this output from
> RRDTool DUMP to a format which lends itself to import into Excel
> 97.  Unfortunately, I am just getting started with Perl and do
> not have a clear enough grasp of how to configure this so that it
> strips out the unwanted parts and formats
> it correctly.  I would like to be able to feed a file into this
> script, and then receive a comma delimited formatted file as output.
>
> Can anyone point me in the right direction?  I have the O'reilly
> camel book, but when I read the section on Regex, I feel like an idiot! :(
>
> Input file:
> |
>
> (misc header information I want to delete)
>
> #This is how the data I want to pull out is formatted
> 
>  NaN  NaN 
> 
>  6.00e+001  6.90e+001 
>
> |---
>
> Output wanted is:
> 2002-01-08 09:35:00 Eastern Standard Time, 1010500500, NaN, NaN
> 2002-01-08 09:40:00 Eastern Standard Time, 1010500800,
> 6.00e+001, 6.90e+001
>
> |--
>
> Thanks in advance.
>
> Gordon
> --
>
> ___
> 1 cent a minute calls anywhere in the U.S.!
>
> http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&u
rl=http://www.getpennytalk.com



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Regex Help Please!

2002-01-10 Thread Wagner-David

Here is a simplistic approach. May want more edits, but is a starting place.

Placing the data for testing under DATA:

while (  ) {
   chomp;
   next if ( /^\s*$/ );   # bypass blank lines
   if ( /^  (.+) <\/v> (.+) <\/v><\/row>/ ) {
  printf "%-s, %-s, %-s, %-s\n", $1, $2, $3, $4;
}else {
  printf "No hit on data:\n%-s\n", $_;
}

 }
__DATA__
  NaN  
NaN 
  
6.00e+001  6.90e+001 
^--- Script ends here
Output:

2002-01-08 09:35:00 Eastern Standard Time, 1010500500, NaN, NaN
2002-01-08 09:40:00 Eastern Standard Time, 1010500800, 6.00e+001, 
6.90e+001

Wags ;)

-Original Message-
From: Gordon Brandt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 10, 2002 10:17
To: [EMAIL PROTECTED]
Subject: Regex Help Please!


I am trying to come up with a script to convert this output from RRDTool DUMP to a 
format which lends itself to import into Excel 97.  Unfortunately, I am just getting 
started with Perl and do not have a clear enough grasp of how to configure this so 
that it strips out the unwanted parts and formats
it correctly.  I would like to be able to feed a file into this script, and then 
receive a comma delimited formatted file as output.

Can anyone point me in the right direction?  I have the O'reilly camel book, but when 
I read the section on Regex, I feel like an idiot! :(

Input file:
|

(misc header information I want to delete)

#This is how the data I want to pull out is formatted
  NaN  
NaN 
  
6.00e+001  6.90e+001 

|---

Output wanted is:
2002-01-08 09:35:00 Eastern Standard Time, 1010500500, NaN, NaN
2002-01-08 09:40:00 Eastern Standard Time, 1010500800, 6.00e+001, 
6.90e+001

|--

Thanks in advance.

Gordon
-- 

___
1 cent a minute calls anywhere in the U.S.!

http://www.getpennytalk.com/cgi-bin/adforward.cgi?p_key=RG9853KJ&url=http://www.getpennytalk.com



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Regex for comma substitution

2001-12-21 Thread Wagner-David

>From the Cookbook:

sub commify {
my $text = reverse $_[0];
$text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
return scalar reverse $text;
}
  Pass it the number and it will pass back a comma delimited number.

Wags ;)
-Original Message-
From: Dirk Bremer [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 21, 2001 13:18
To: perl-win32-users
Subject: Regex for comma substitution


I am looking for a regex to be used for comma substitution for numbers, i.e. the regex 
would transform:

999 = 999
   = 9,999
9 = 99,999
99   = 999,999
999 = 9,999,999, etc.

I tried s/(\d{3})/,$1/g, but for certain numbers it leaves a leading comma, i.e. 
99 = ,999,999. Please advise.

Dirk Bremer - Systems Programmer II - AMS Department - NISC
636-922-9158 ext. 652 fax 636-447-4471




___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Seeking Date routine to calculate number of whole Months for two dates

2001-12-02 Thread Wagner-David

I apologize to the list for not being clear. When you view a problem from a 
certain perspective, you give what you think is clear and in this case it was not.

What I wanted was given date: 12/1/01 and new date, say: 1/2/02, would give 1. 
If it had been 12/31/01, then zero.  Like I said after the post from Sisyphus, that I 
was after just whole integer months. I was looking at calculating epoch seconds and 
all this, but this seemed to be getting
more complicated that I needed. So just using integer arithmetic after verifying dates 
are good, you would have something of form: 1011201 and 1020102 which after doing 
calculation, would be 1. (calucation involves a simple routine to use year, month and 
day)

Sorry for not being more specific(though unfortuantely I thought I was :( ).

Wags ;)
  
-Original Message-
From: Carl Jolley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 02, 2001 11:50
To: Sisyphus
Cc: 'Perl Win32'
Subject: Re: Seeking Date routine to calculate number of whole Months
for two dates


On Sun, 2 Dec 2001, Sisyphus wrote:

> Seems to me that you would then first have to define what you mean by a
> 'whole month'.
>
> Consider the period 2000-01-07 (7th Jan.) to 2000-02-27 (27th Feb). Do you
> want that reported as zero whole months (because no full calendar month lies
> in that period), or 1 whole month (because more than 4 weeks has elapsed)?
>
> If it's the former, then, in the general case, it would be a matter of
> parsing the date and performing some simple arithmetic.  Subtract the
> earlier date's "month" number from the later date's "month" number and then
> subtract 1. Add this to the difference in years multiplied by 12. ( Hope
> that's right.) There may already be a wheel that does this - but it would
> probably be far quicker and easier to make your own, than it would be to
> find this wheel :-)
>
> If it's the latter then it really comes back to clarifying exactly what is
> meant by a 'whole month' - 4 weeks? - a twelfth of a year ? - 30 days ? -
> some mixture of calendar months and  a time period?.
>

Or, since I don't seem to be hearing a coherent definition of what he
means by "whole months" perhaps he can give several different date pairs,
tell the "whole month" difference between them and explain why and then
we can see what he means by a "whole month" difference.

 [EMAIL PROTECTED] 
 All opinions are my own and not necessarily those of my employer 

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Regular expression help

2001-11-29 Thread Wagner-David

Here is a start:
if the needs to numeric and the format stated, then change the 
s/^(\d+)(\d{4})(\d{5})$/$1-$2-$3/ to 

if ( s/^(\d+)(\d{4})(\d{5})$/$1-$2-$3/ ) {
 }else { 
   #error of sometype
   }
#!perl -w
while (  ) {
   chomp;
   s/^(\d+)(\d{4})(\d{5})$/$1-$2-$3/;
   printf "%-s\n", $_;
 }
__DATA__
1006326869812
563296853235993
35968322963568389
^- Script ends here

Output:
1006-3268-69812
563296-8532-35993
35968322-9635-68389

Wags ;)
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 29, 2001 12:32
To: [EMAIL PROTECTED]
Subject: Regular expression help


I need help creating a regular expression to do the following.

I have the following numbers:

1006326869812
563296853235993
35968322963568389

and it needs to be broken up like this

1006-3268-69812
563296-8532-35993
35968322-9635-68389

Notice the second group of numbers is always 4 places and the last group is
always 5 places.

I'm stumped and not to good with RE's. Any pointers would be great.

Rob
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Sort Hashes

2001-11-15 Thread Wagner-David

Hashes by their very nature have no defined way in which you pull them out.  I 
know that on one of the lists there was some type of module which would tie the keys 
to how they were inputted. Unforunately I don't have it.  Depending on what you are 
trying to do, you could use an array where
you would have [0][0] = Nombre [0][1] = p_nombre, etc If doing search, then combo of 
both array for order and has for getting at the data.

I took a quick look using ppm looking for hash and around 21 items came up. 
Try it( search hash ) and maybe there is one that will be what you are after.

Wags ;) 

-Original Message-
From: Mauricio Lairet P. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 15, 2001 18:51
To: [EMAIL PROTECTED]
Subject: Sort Hashes


Hi!

First I want ot thak you for your soon responses.

Now I have a new problem. Now with hashes. I have the following hash table
and I would like it to be printed in the same oreder it is created but when
I print it, it changes the order I put in the hash. How can I make this hash
table to print in the same estict order that I have in the hash?

   %datos=(
'Nombre' => 'p_nombre',
'Dirección' => 'p_direccion',
'Ciudad' => 'p_ciudad',
'Estado' => 'p_estado',
'País' => 'p_pais',
'Código postal' => 'p_codigopostal',
'Teléfono' => 'p_telefono',
'Correo-e' => 'p_email'
)

Thank you in advance,
Mauricio

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: How to go out from for loop if found some restrictions?

2001-11-15 Thread Wagner-David

If after you find a restriction and want to get out, then use:
last;

Wags ;)
-Original Message-
From: Mark Remesnitskiy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 15, 2001 12:30
To: [EMAIL PROTECTED]
Subject: How to go out from for loop if found some restrictions?


Hi,



when I doing some check with for loop, and found restrictions, I want to leave loop 
before it finished.

This is my script:





$bRestrict = 1;



for ($i2 = 3; (($i2 <= ($#Record - 1)) or ($bRestrict == 0)); $i2++) { #Cheking 
multyword Names

#for ($i2 = 3; ($i2 <= ($#Record - 1)); $i2++) { #Cheking multiword Names



open (DEBUG, '>>c:\\mydocu~1\\Perl\\Temp\\debug.txt') or die "Can't open 
debug.txt.\n";

print (DEBUG "Title $i2 is $Record[$i2]\n");

print (DEBUG "There is $#Record elements in record\n");

print (DEBUG "Checked to $_\n");

print (DEBUG '$bRestrict is : ' . "$bRestrict\n");

close (DEBUG);





if ($Record[$i2] =~ m/$_/) { #Found restrictions



$bRestrict = 0;



open (DEBUG, '>>c:\\mydocu~1\\Perl\\Temp\\debug.txt') or die "Can't 
open debug.txt.\n";

print (DEBUG '$bRestrict is : ' . "$bRestrict\n");

print (DEBUG 'found restriction for: ' . "$Record[$i2]\n\n");

close (DEBUG);







} #End of restrictions found





} # End of Cheking multiword Names



if ($bRestrict == 0) {last;}



Logic "or" doesn't work for me in "for" clause, without "or" it run whole loop after 
restrictions found.



Thanks,



Mark

___

Visit http://www.visto.com.

Find out  how companies are linking mobile users to the 

enterprise with Visto.



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Multi column sort

2001-06-05 Thread Wagner-David

Here is a shot using map.

Wags ;)
=

#!perl -w

foreach my $MyKey (sort {$a->[2] cmp $b->[2] || $a->[3] cmp $b->[3]} 
   map{ [$_, split(/\|/,$_)]} ) {
   printf "%-s", $MyKey->[0];
 }   
__DATA__
1|Animals|Dogs
2|Animals|Cats
3|Beach|Babes
4|Beach|Hunks
5|Sports|Football
6|Sports|Hockey
7|Advertisement|General
8||Ships
9||Cars
^-- Code ends here
Output:
9||Cars
8||Ships
7|Advertisement|General
2|Animals|Cats
1|Animals|Dogs
3|Beach|Babes
4|Beach|Hunks
5|Sports|Football
6|Sports|Hockey
-Original Message-
From: Troy Sniff [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 16:26
To: [EMAIL PROTECTED]
Subject: Multi column sort


I want to perform a multi column sort using one field and then the next.

Example, lets say I have a datafile that looks like:

1|Animals|Dogs
2|Animals|Cats
3|Beach|Babes
4|Beach|Hunks
5|Sports|Football
6|Sports|Hockey
7|Advertisement|General
8||Ships
9||Cars

I want to split on the | and sort by the second column and then by the
third.

My result should come out as:

8||Ships
9||Cars
7|Advertisement|General
2|Animals|Cats
1|Animals|Dogs
3|Beach|Babes
4|Beach|Hunks
5|Sports|Football
6|Sports|Hockey

You'll notice the second column is sorted and then after that the third
is sorted.

I haven't performed this kind of sort so any help is appreciated.

Troy


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Percentages

2001-06-04 Thread Wagner-David

Here is one way:

   printf "%7.2f%-s\n", ( ($MyNum/$MyDen)*100 ), '%';
output:

Please enter numerator: 5
Please enter denominator: 10
  50.00%
Please enter numerator: 34
Please enter denominator: 450
   7.56%

Wags ;)
-Original Message-
From: Mark Bergeron [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 04, 2001 11:19
To: [EMAIL PROTECTED]
Subject: Percentages


Hello group,
Could someone please show me an example of how to take say

$number = $this_number/$that_number
$formatted = $coolcheck=~ $number

and have $formatted produce a result in 00% insted of the raw number
(..) and it's remainder.

Thanks as always,
Mark Bergeron
/~_. _ | _ _  _  _ 
\_/|(_||| | |(_)| |
 _|
___
GO.com Mail
Get Your Free, Private E-mail at http://mail.go.com


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: How to find the same string ?

2001-04-28 Thread Wagner-David

Here is one shot
while ( /\s(\S+@\S+)\s/g ) {
   print "$1\n" ;
 }

Output:

[EMAIL PROTECTED]
[EMAIL PROTECTED]

-Original Message-
From: BMA TRADING ltd. [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 28, 2001 10:04
To: [EMAIL PROTECTED]
Subject: How to find the same string ?


Hi.
Is it possible to find the same string on the same line using RegEx?
Eg. I have a line of text( read from a file)

$_=' [EMAIL PROTECTED] is one and [EMAIL PROTECTED] is next mail';

(it is on the same line)
and I would like to extract both emails.
If I use 

print "$1\n" if /\s(\S+@\S+)\s/;

I will get the first email only.Is there any solution to get all emails 
(substrings) from one line?
Thank you for help.

Ladislav
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: CSV sorting

2001-04-25 Thread Wagner-David

As part of the sort process which uses a,b for comparsion, you switch to b,a
that is:

Asending:   Descending:
$a <=> $b   $b <=> $a

If desire is for alphanumeric, then use cmp in place of <=>

Wags ;)

-Original Message-
From: Walsh, Keith [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 15:42
To: '[EMAIL PROTECTED]'
Subject: CSV sorting


Hello all:

I have what I hope is a very simple question.  In the script that I
am writing I create a csv file that includes certain information I take out
of some logfiles.  The first column is the date, the second the time and the
third an NT user account.  My question is this, is there anyway that after I
create this file to sort by column a, then b, then c in a descending order?
There must be some way right?  Any help would be greatly appreciated.

Thank you.

***
Keith Walsh
IT Security Technology
281.681.6605




**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.


www.mimesweeper.com
**
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



[ole] Any way to force an Excel file to be opened readonly

2001-04-18 Thread Wagner-David

I am processing files to re-write in PDF. I am running through the
files, but they have the setup where it wants you to open in read only and
asks to open read only unless you need to update.  

Can I do this in OLE and get it to open readonly?

Thanks. 

Wags ;)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Using OLE to do conversion of Excel books to PDF

2001-04-11 Thread Wagner-David

I am trying to help another group within our company to convert a
large number of Excel files to PDF.  I tried to record a macro to see the
variables I would go through and translate into Perl. When I select from
Menu 'Create Adobe PDF...', nothing shows up in the macro.

So, how does one do something like that?  Here is the code I am
starting with.  It loops through a directory looking at files which end in
.xls.  Then it looks at sheets and displays all named sheets which are not
named 'SHEETd+ where d is one or more digits'.

Also trying to determine if more than one page per worksheet, since
if multiple pages PDF will squeeze everything on to one page. (as part of
the macro I went to preview, that is all it shows. How would one if he can,
see the number of pages in the x of y pages)

Thanks.

Wags ;)

---

Code starts here:
#!perl -ws
#
#

use Win32::OLE qw(in);
$progw  = $0;
$progw  =~ s/.+[\\\/]//;
$prog   = sprintf"%-8s: ", $progw;

$diff = 0;

get_time();
printf "${prog}  %-20s: %02d:%02d:%02d\n", 'Excel OLE St', $hour, $min,
$sec;

my $excel = Win32::OLE->GetActiveObject('Excel.Application') ||
Win32::OLE->new('Excel.Application' , 'Quit' );

get_time();
printf "${prog}  %-20s: %02d:%02d:%02d\n", 'Excel OLE En', $hour, $min,
$sec;

my $MyExcelFile = '';
my $WorkingLoc  = 'd:\VK 675\100';
chdir("$WorkingLoc") || die "Unable to change to Tariffs Directory
$WorkingLoc: $!";

get_time();
printf "${prog}  %-20s: %02d:%02d:%02d\n", 'Find Valid Sheets OLE St',
$hour, $min, $sec;

my $MyFileCnt = 0;
my $MySheetCnt = 0;

while ( 1 ) {   
   $MyExcelFile = <*.xls>;
   last if ( ! defined $MyExcelFile );
   my $JustFile = $MyExcelFile;
   $MyFileCnt++;   
   $MyExcelFile = $WorkingLoc . "\\" . $MyExcelFile;
   
   my $book = $excel->Workbooks->Open("$MyExcelFile");
   printf "File: %-s\n", $JustFile;
   my $HitSheet = '';
   foreach my $sheet (in $book->Worksheets) {
   $HitSheet = $sheet->Name if ( $HitSheet eq '' );
   next if ( $sheet->Name =~ /^Sheet\d+$/i );
   printf "  Worksheet %s\n", $sheet->Name;
   $HitSheet = 'ValidNamedSheet';
   $MySheetCnt++;
}
   printf "  Worksheet %s\n", $HitSheet if ( $HitSheet ne 'ValidNamedSheet'
);
   $book->Close;
 } # looping through directory displaying active WorkSheet(s)

printf "${prog}  Counts:  Files- %6d  Sheets- %6d\n", $MyFileCnt,
$MySheetCnt;

get_time();
printf "${prog}  %-20s: %02d:%02d:%02d\n", 'Find Valid Sheets OLE En',
$hour, $min, $sec;

 sub get_time {
$diff = 86400 * $diff;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time -
$diff);
$mon++;
$YearModulo = $year % 100;
$diff = 0;

undef $wday;
undef $yday;
undef $isdst;

 }  # end of get_time

#



Code ends here:


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: best way how to remove CRLF \n ....

2001-03-22 Thread Wagner-David

 If only concerned about cr/lf then chomp($value) will remove if there
otherwise will leave alone.
Also could do tr/.;'<>//  Add others you want to truly remove non alpha
numeric values.

Wags ;)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 21, 2001 03:45
To: Active State
Subject: best way how to remove CRLF \n 


Hi all !

Please could somebody tell me how can I remove characters like 
#10 #13  \n  from the string.It means all characters what are not 
alfanumerical.

Thanks 

Marian
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: stat problems

2001-03-12 Thread Wagner-David

File::stat is placing the output into $dev as an anonymous array I believe.
If I access your data as

foreach ( @$dev ) {
   printf "%-s;", $_;
 }

I think the above is giving you the data you want.

Wags ;)
>  -Original Message-
> From: Riva [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, March 12, 2001 11:55
> To:   [EMAIL PROTECTED]
> Subject:  stat problems
> 
> In the code below, I'm trying to store the information returned by stat in
> several variables.  When I run it, I get:
> 
> file c:\test\ftest5.pl updated at Mon Mar 12 12:09:09 2001
> File::stat=ARRAY(0xca9848)
> 
> This seems to indicate that the variables aren't being populated with
> stat's
> data. Any idea how/why stat works in this manner?
> 
> TIA!
> 
> 
> ---
> use strict;
> 
> use File::stat;
> use Time::localtime;
> 
> my ($date_string, $myfile);
> $myfile='c:\test\ftest5.pl';
> 
> $date_string = ctime(stat($myfile)->mtime);   #atime=last access,
> mtime=last
> modify, ctime=last inode change
> print "file $myfile updated at $date_string\n";
> 
> my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
> $atime,$mtime,$ctime,$blksize,$blocks);
> ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
> $atime,$mtime,$ctime,$blksize,$blocks) = stat($myfile);
> 
> print $dev, ":", $ino, ":", $mode, ":", $nlink, ":", $uid, ":", $gid, ":",
> $rdev, ":", $size, ":",  $atime, ":", $mtime, ":", $ctime, ":", $blksize,
> ":", $blocks;
> 
> ---
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> .
> __
> FREE Personalized Email at Mail.com
> Sign up at http://www.mail.com/?sr=signup
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: [Perl-win32-users] Adding items to an array

2001-03-12 Thread Wagner-David

What you getting is out of the first 'if' where you find 'sticky
tag' and fld 3 is NOT EQUAL to (none) then you are placing in stickytag what
is in fld 3 and then concatenating the value into stickytags{$FileName}.
This is not an array, but a HASH.  

What would be helpful is the data you are processing becuase your
code is doing exactly what it appears it should be doing.

Wags ;)

-Original Message-
From: Fauzi Ashurex [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 06, 2000 17:40
To: Perl-Win32-Users Mailing List
Cc: Fauzi Ashurex
Subject: [Perl-win32-users] Adding items to an array


Hello,

I have an array that I'm adding to it every time I see an item, but it is
not adding it's appending to the array?
+
$MyTag = Beta;
if ((/^   Sticky Tag:/) && ($Fld[3] ne '(none)')) {
  $StickyTag = $Fld[3];
  $StickyTags{$FileName} .= $StickyTag . ' ';
}

chop $StickyTags{$FileName};

if ($StickyTags{$FileName} ne "$MyTag") {
print"\n";
printf "%s %s %s\n", $FileName, 'Tag:',
$StickyTags{$FileName};
printf "%s %s\n", '   ', $File_Path;
   printf "%s %s %s %s\n",'   ','## File not on local
Branch, attached to' ,
 
$StickyTags{$FileName} ,'Branch ##';
  }

The problem is, the StickyTags{$FileName} gets the file correct, but it
keeps adding to the $StickyTag 

the first time it finds a tag it records the file and the Tag "   foo
NotMyTag"
the second time it finds a tag it prints " foo NotMyTag NotMyTag"
and The third is "foo NotMyTag NotMyTag NotMyTag"


does anyone has a clue?

Thanks-fma
___
Perl-win32-users mailing list
[EMAIL PROTECTED]
http://listserv.activestate.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



How to read Outlook Address Book looking at Global Addresses?

2001-03-12 Thread Wagner-David

Since you can't select and copy from the address window, is there a
way using OLE to look for a particular email and read its contents and
display, so you can copy w/o having to write it down?

Thanks.

Wags ;)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: making a script die if not run "-w"?

2001-03-02 Thread Wagner-David

You can set it, but if you know about perl, then they can unset it
also at any point in their script.
Just  FYI.

Wags ;)

-Original Message-
From: Bennett Haselton [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 02, 2001 10:23
To: [EMAIL PROTECTED]
Subject: RE: making a script die if not run "-w"?


This is what I wanted, to enforce it -- this works, thanks!  (And I'm
reading perllexwarn.html to get a handle on the better ways of doing
this...)

-Bennett

At 01:49 PM 3/2/01 -, [EMAIL PROTECTED] wrote:
>I couldn't infer if you just wanted to check if -w was used, or if you
>want to turn it on yourself.
>
>If you want to enforce it, you can add the BEGIN block to your global file.
>HTH
>
>perl warn.pl   # Note the lack of the -w
>
>BEGIN {
>   $^W=1;
>}
>
>my $x=1;
>my $x=1;
>-
>produces 
>   "my" variable $x masks earlier declaration in same scope at warn.pl
>line 6.
>
>The same code runs without any warnings if you remove the BEGIN block.
>
>> -Original Message-
>> From:Bennett Haselton [SMTP:[EMAIL PROTECTED]]
>> Sent:Friday, March 02, 2001 2:04 AM
>> To:  [EMAIL PROTECTED]
>> Subject: making a script die if not run "-w"?
>> 
>> I have a bunch of files all part of the same project and they all use
>> "require" to include one "global" file that sets up certain variables
>> which
>> are needed by all project files, and things like that.
>> 
>> Is there something I can put into the global file to check if a script is
>> being run "-w", and if not, quit immediately?  Other than a hack like
>> deliberately inserting a statement that won't compile if you run it -w.
>> 
>>  -Bennett
>> 
>> [EMAIL PROTECTED] http://www.peacefire.org
>> (425) 649 9024
>> ___
>> Perl-Win32-Users mailing list
>> [EMAIL PROTECTED]
>> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>___
>Perl-Win32-Users mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>
>

[EMAIL PROTECTED] http://www.peacefire.org
(425) 649 9024
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: sendmail

2001-02-15 Thread Wagner-David

It is not part of the auto install from AS.

you can install using ppm:

ppm install Mail-Sendmail

The current status of Modules available and how installed is at

http://www.activestate.com/Products/ActivePerl/status.html

-Original Message-
From: Sharon Tiroff [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 15, 2001 12:15
To: '[EMAIL PROTECTED]'
Subject: sendmail


I am new to Perl CGI Script and installed ActivePerl to my NT machine
last week. 
I would like to send two automatic e-mails out after the user clicks the
submit button. In my readings I understand that I need SENDMAIL on my
box. Should ActivPerl installed this on my machine? I have searched the
drive where I installed ActivePerl and SENDMAIL has not been found.

Thanks,

Sheri
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Regex Help

2001-01-31 Thread Wagner-David

I tried this and it seemed to work:

my $InputLine = '(! SUBSTR(DB.USER1,2,5)="9") .AND.
(LEFT(DB.USER1,1)<"1") .AND. (ALLTRIM(DB.OUNCEWT)>"2")';
my $InputLine1 = '(! SUjSTR(DB.USER1,2,5)="9") .AND.
(LEFT(DB.USER1,1)<"1") .AND. (ALLTRIM(DB.OUNCEWT)>"2")';
my $Str = '(! SUBSTR(DB.USER1,2,5)="9") .AND. (LEFT(DB.USER1,1)<"1")
.AND. (ALLTRIM(DB.OUNCEWT)>"2")';

if ( $InputLine =~ /\Q$Str\E/io ) {
   print "Found the string in InputLine!!\n";
 }else {
   printf "No hit: InputLine:\n%-s\nSearch:\n%-s\n", $InputLine, $Str;
 }

if ( $InputLine1 =~ /\Q$Str\E/io ) {
   print "Found the string in InputLine1!!\n";
 }else {
   printf "No hit: InputLine1:\n%-s\nSearch:\n%-s\n", $InputLine1, $Str;
 }

running on win2000 and AS623.

Wags ;)

-Original Message-
From: Dirk Bremer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 15:03
To: perl-win32-users
Subject: Regex Help


I have a complicated string:

(! SUBSTR(DB.USER1,2,5)="9") .AND. (LEFT(DB.USER1,1)<"1") .AND.
(ALLTRIM(DB.OUNCEWT)>"2")

that I want to search for and them replace. I have tried this with no luck:

if ($InputLine =~ /\(\! SUBSTR\(DB\.USER1,2,5\)\=\"9\") \.AND\.
\(LEFT\(DB\.USER1,1\)\<\"1\"\) \.AND\. \(ALLTRIM\(DB\.OUNCEWT\)\>\"2\"\)/io)

I have also tried this with no luck:

if ($InputLine =~ /\(ALLTRIM\(DB\.OUNCEWT\)/io)

In the last example, I get a regex error about unbalanced paranthesis. I
would really like to assign the whole string to a scalar:

$Str = "\(\! SUBSTR\(DB\.USER1,2,5\)\=\"9\") \.AND\.
\(LEFT\(DB\.USER1,1\)\<\"1\"\) \.AND\. \(ALLTRIM\(DB\.OUNCEWT\)\>\"2\"\)"
if ($InputLine =~ /$Str/io)

I welcome your suggestions.

Dirk Bremer - Systems Programmer II - AMS Department - NISC
636-922-9158 ext. 652 fax 636-447-4471




___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



  1   2   >