#!/usr/bin/perl -w use strict; my ($theVar, @theArray); # split unix or dos complete file path into tokens $theVar = 'c:\windows\sys\random\mysterious\but\critical.dll'; @theArray = split( /[\\:\/]/, $theVar ); print "@theArray\n"; $theVar = "/etc/rc/rc.d"; @theArray = split( /[\\:\/]/, $theVar ); print "@theArray\n";