Ok.. Thanks to everyone's help. Here is the script I ended up with. use Win32::AdminMisc;
$file = 'c:\temp\lurecover.txt'; open (OUT, ">>$file") || die "cannot append $file: $!"; my $pcnames = 'ACME0001'; for ( my $pcname = 0; $pcname<3000; $pcname++) { $lupath = "\\\\$pcnames\\admin\$\\W2HCM.INI"; print OUT "$pcnames "; $lu = Win32::AdminMisc::ReadINI( $lupath , "MS SNANT" , "Term" ); print OUT "$lu \n"; $pcnames++; } close (OUT) || die "can't close $file:$!"; -----Original Message----- From: Meneses, Alden Sent: Friday, March 12, 2004 12:59 PM To: [EMAIL PROTECTED] Subject: RE: How do I increment a alphanumeric value? Did anyone metion that you guys are good. I see my mistake. I didn't separate the 2 variables. I really need to read up on my programming. :) I will post my final script that everyone has generously helped me with. Thanks again. -----Original Message----- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 12:24 PM To: Meneses, Alden; [EMAIL PROTECTED] Subject: RE: How do I increment a alphanumeric value? Meneses, Alden wrote: > I must be doing something wrong with this script.... > > my $pcname = 'ACME0001'; > while ( $pcname < 5 ) { I believe it has to do the arithmetic < which is making ACME0001 into 0 which then gets added to 0. This is the code I used to verify it would work as stated: my $MyIds = 'ACME0001'; for(my $MyId=0;$MyId<1300;$MyId++) { printf "%s\n", $MyIds++; } Wags ;) > print "$pcname \n"; > $pcname++; > } > > I get these results > > ACME0001 > 1 > 2 > 3 > 4 > > -----Original Message----- > From: Wagner, David --- Senior Programmer Analyst --- WGO > [mailto:[EMAIL PROTECTED] > Sent: Friday, March 12, 2004 11:50 AM > To: James Edward Gray II; Meneses, Alden > Cc: [EMAIL PROTECTED] > Subject: RE: How do I increment a alphanumeric value? > > > James Edward Gray II wrote: >> On Mar 12, 2004, at 1:39 PM, Meneses, Alden wrote: >> >>> Suppose I have machines that are ACMExxxx >>> >>> I want to go from ACME0001 to ACME9999 >> >> How's this? > If you have it in a variable then you only need ++ to get to the next > item: > my $MyMachines = 'ACME0001'; > > # to get the next item > $MyMachines++; > > Seems to simple, but ran a test and it works just like that. > > Wag ;) >> >> foreach (1..9999) { >> printf "ACME%4d\n", $_; >> } >> >> James ********************************************************** 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. **************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>