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:
and what I want to have happen is that I get a stringthat would be:
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:
Am I missing something for the whitespace in frount of "name:"?
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:"?