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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with an Array

Status
Not open for further replies.

Haunter

Programmer
Jan 2, 2001
379
US
I have a perl program that uploads data from the users computer.
On the confirm upload page I want to feed back the information to the user of which file they just uploaded.

I am successful at doing this except the output does not have any "\" in the path name.

I use
@array=split (/\\/$filepath/);
print"@array";

my output look like this.

c: directory file

no "\" exist in the output.

I know there is a simple solution please help?
 
You broke $filepath on the backslash and then printed out the result. So if you had $filepath="c:\directory" then @array would = ("c:","directory"); When you print @array, it prints "c:"."directory" = "c:directory". If you want it to print "c:\directory" then print $filepath.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top