I didn't give enough context. My bad. The substitution does seem to work. Here's more context, and the error.
while ( @file ) {
s#l:\\Data\\([0-9]*)\\#D:\\Sites\\$1\\Data\\#i;
print;
}
@file is filled with many lines like so: my @file = <FILE>;
Here are the warnings:
Use of uninitialized value in print at foo.pl line 44.
Use of uninitialized value in substitution (s///) at foo.pl line 43.
Use of uninitialized value in substitution (s///) at foo.pl line 43.
-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday