From: Luke Saunders Date: Fri, 25 Apr 2008 16:27:03 +0000 (+0000) Subject: dir separators in pks no longer cause crash X-Git-Tag: v1.001002~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5f3da1e090bd12f346575c9672b24462528229b7;p=dbsrgits%2FDBIx-Class-Fixtures.git dir separators in pks no longer cause crash --- diff --git a/lib/DBIx/Class/Fixtures.pm b/lib/DBIx/Class/Fixtures.pm index 55f2341..753cb2b 100644 --- a/lib/DBIx/Class/Fixtures.pm +++ b/lib/DBIx/Class/Fixtures.pm @@ -568,7 +568,11 @@ sub dump_object { # write dir and gen filename my $source_dir = dir($params->{set_dir}, lc($object->result_source->from)); mkdir($source_dir->stringify, 0777); - my $file = file($source_dir, join('-', map { $object->get_column($_) } sort $object->primary_columns) . '.fix'); + + # strip dir separators from file name + my $file = file($source_dir, join('-', map { + ( my $a = $object->get_column($_) ) =~ s|[/\\]|_|g; $a; + } sort $object->primary_columns) . '.fix'); # write file my $exists = (-e $file->stringify) ? 1 : 0;