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!

redirecting information in an array to a file 1

Status
Not open for further replies.

womp

Technical User
Apr 6, 2001
105
US
Hello,
I am trying to redirect information in an array to a file which looks like this:

open(FINAL_USER, "print @Final_user | > /tmp/Deleted_Users ");

I keep receiving "Unsuccessful open on filename containing newline at ./delete.pl line 107, <STDIN> line 5.
Deleted_Users: No such file or directory.

The line 107 is the snippet of code above.
How do I get this information into a file ?

Just to let you know I have been looking up other peoples "redirecting code snippets" and putting it into my own program
But, without success.
 
open(FINAL_USER, "> /tmp/Deleted_Users");
print FINAL_USER @Final_user;
close FINAL_USER;


Kind Regards
Duncan
 
If your array elements don't contain newlines and you want one element per line, you can modify that like so:
Code:
open(FINAL_USER, "> /tmp/Deleted_Users");
local $, = "\n";
print FINAL_USER @Final_user;
close FINAL_USER;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top