On Tue, May 31, 2011 at 05:06:57PM -0400, Uri Guttman wrote: > >>>>> "CD" == Chris Devers <cdev...@pobox.com> writes: > CD> On Tue, May 31, 2011 at 4:44 PM, Uri Guttman <u...@stemsystems.com> > wrote: > >> assign => sub { my $x = 'abc' ; $x = "qwerty/$x" }, > >> substr => sub { my $x = 'abc' ; substr( $x, 0, 0, > 'qwerty/') }, > > CD> The substr version doesn't look very readable or maintainable. > CD> You're teaching *beginners* to do things this way? > well, not teaching it. i offered an alternative and faster way to > prepend a string. some on the beginner's list are very capable of using > substr in all its forms. the OP actually looked up the docs and found > lvalue substr but i replied it shouldn't be used as 4 arg substr can do > the same thing and is much faster.
But it seems that the question wasn't about pre-pending strings, but about pre-pending directories. In which case the correct answer is "there's a module that handles all the cross-platform craziness for manipulating filenames". It's File::Spec. -- David Cantrell | http://www.cantrell.org.uk/david Guns aren't the problem. People who deserve to die are the problem. _______________________________________________ Boston-pm mailing list Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm