Hi John
I think you need to tell us something more. You say you
my @parts = ("one", "two", "three");
substr($parts[1],0,0) = ".";
print "@parts";
works fine. (Unless you really /did/ miss the closing quote from 'three'?).
May we see a little more of your code?
Don't forget that, if $name doesn't contain any '.'s then $parts[1] _will_ be
uninitialized.
Cheers,
Rob
> -----Original Message-----
> From: John Way [mailto:[EMAIL PROTECTED]]
> Sent: 04 September 2001 17:08
> To: [EMAIL PROTECTED]
> Subject: Use of uninitialized value in concatenation (.) or string at
> mlknpvs.pm line 241
>
>
> I am running a script with -w and I keep getting multiple warnings like...
>
> Use of uninitialized value in substr at mlknpvs.pm line 240
> Use of uninitialized value in concatenation (.) or string at
> mlknpvs.pm line 241
>
> In this particular script I call a sub from mlknpvs.pm. I declared an array
> my @parts;
> and used "split" to load the array. Every time I use one of the elements, I
> get a warning similar to above.
> I have tried initializing it with numbers and strings
> my @parts = ("one", "two","three);
> and
> my @parts = qw(1 2 3);
> ....same messages!
>
> Is there someway to fix my code to eliminate these messages?
>
> Here is the partial code listing.....
>
> my (
> $base, #basename for $filename
> $dir, #path to $filename
> $ext, #file extension for $filename
> $name, #current filename in while loop
> @parts, #parts of current $filename ([0]=base,
> [1]=ext, [2]=version ext)
> $killCount #counter for number of files to delete
> );
>
> while ($name = readdir(DIR)) {
> $fileCount++;
> @parts = split(/\./,$name);
> substr($parts[1],0,0) = "."; #LINE 240
>
>
> John Way
> IS Professional
> Phone (864)503-2939
> Fax (864)503-2444
> Internal 246-2939
>
>
>
> **** Confidentiality Notice: *******************************************
> Privileged/Confidential information may be contained in this message
> and is intended only for the use of the addressee. Please advise
> immediately if you or your employer do not consent to Internet e-mail
> for messages of this kind. If you are not the addressee, or person
> responsible for delivering to the person addressed, you may not copy or
> deliver this to anyone else. If you receive this message by mistake,
> please notify the sender immediately by return e-mail. Thank you.
> ************************************************************************
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]