Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

matching regular expression help (newbie)

Status
Not open for further replies.

phoenix24x

IS-IT--Management
Apr 24, 2008
1
US
hello,

i am attempting to parse the path of a file into 2 variables.
here is the code:

$fullFilePath = "Q:\yes\iam\perl\newbie\file.txt";
$pathto,$file = substr($fullFile =~ m/(.*)\\(.*)/i);

print $pathto;
print $file;



the error is:
Not enough arguments for substr at Y:\pdf\test.pl line 2, near "m/(.*)\\(.*)/i)"

i was under the impression that each set of parans specified an argument. 2 arguments, 2 variables

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top