in reply to A problem with using the split command
Change the line to read:
and it should work correctly.foreach my $pwd (split(/\\/,'\foo\foo1\foo2')) { ...
Update: The following code (as per above, but with an output):
produces the following output.foreach my $pwd (split(/\\/,'\foo\foo1\foo2')) { print $pwd, "\n"; }
Notice the extra blank line at the beginning? This occurs because of the initial leading slash in the string to split. You'll likely want to take that into concideration.__OUTPUT__ foo foo1 foo2
|
---|