Hello
I am getting a strange error where I am trying to split a string into
an array. The string is a line obtained from doing a directory of a
disk. The error message is:
Reference to nonexistent group in regex; marked by <-- HERE in m/
Directory of C
:\Documents and Settings\Andrew\Application
Data\ActiveState\KomodoIDE\4 <-- HER
E .1/ at D:\Perl Scripts\remove_duplicate_files.pl line 56.
The line in where it happens is the line of code with the split.
Thanks,
Andrew
#
# Find all the files
#
@file_list = `dir c: /S`;
#
# Build the list of directories and files
#
$temp_index = 0;
$file_index = 0;
$directory_index = 0;
$dir_list_size = scalar(@file_list);
print $dir_list_size;
print "\n:";
while ($temp_index < $dir_list_size)
{
chomp @file_list[$temp_index];
print @file_list[$temp_index];
print "\n";
if (@file_list[$temp_index] ne "")
{
#
#
@parse_line = split(@file_list[$temp_index]);
# $line_size = scalar(@parse_line);
$line_size = 0;
if ($line_size > 0)
{
#print @parse_line[0];
#print "\n";
#
# Determine if this is a directory and if so add it to the
# directory array and increment the index
#
if (@parse_line[1] eq "Directory")
{
#$directory_list = @parse_line[1];
#$directory_index =$directory_index + 1;
#print "is a Directory\n";
}
else
{
##$actual_files[file_index] = @parse_line[0];
# $file_size[file_index] = @parse_line[4];
#$file_deleted[file_index] = 0;
#$file_index = $file_index + 1;
#print "not a directory \n";
}
}
}
$temp_index = $temp_index + 1;
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/