lensman: (Default)
[personal profile] lensman
But I didn't....

Talked to B on the phone for a bit, and then got on the computer to bang my head against some windows cmd, and perl code.....

I thought I had it too, but it's been a few years since I played with perl and the perl side of the scripts are not doing what I want...

Anyone want to take a stab at this???

What I'm getting is a temp file where I need to find the following line:
      name: Last, First M

and what I want to have happen is that I get a stringthat would be:
$fullname="First M Last"


Should be simple right??? Thats the last piece to go, but I was banging my head on getting the rest of the dang scripts to work together until 7am this morning, and the a tried to catch some shut-eye before comming to work....



Here's what I tried:
open (USERINFO, "\\\\$userserver\\$userdirectory\\$username\\Settings\\Personal\\user-info.txt") || die "Open: $!";
#define variable fullname in case it is not found in the file.
#$fullname="";

while (defined ($temp = )) {
	chomp($temp);
	if ($temp =~ /^      name:\b/) { #Continue searching until a line starting with "      name:" is found
		$temp =~ s/      name:\s+//;
		$firstname=substr($temp,rindex $temp,", "); #$firstname includes MI
		$tempname=substr($temp,0,rindex $temp,", ");
		$lastname=substr($tempname,0,-2);
		$fullname=$firstname." ".$lastname;
	}
}

Am I missing something for the whitespace in frount of "name:"?
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

lensman: (Default)
lensman

June 2012

S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 9th, 2026 12:49 am
Powered by Dreamwidth Studios