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

open(OUT, ($_[$count + 6]) not working

Status
Not open for further replies.

cbh35711

Programmer
Joined
Dec 12, 2005
Messages
28
Location
US
And i guess perl thinks it shouldn't work, but i do!
i want it to choose between like ">$file" and ">>$file" which are located within the array that i passed to it.
But it's giving me a comp error, this is the whole function:
sub save
{
$file = ($_[$count + 3]).$dateMod. ".txt";
open(OUT, ($_[$count + 6]);
print OUT ($_[$count];

}
It used to be like 20 lines, but i got annoyed so i'm trying to make it smaller. I'm passing in 3 arrays, that are pushed into one long one. Then just modifying $count to access the different arrays within the list.
So i guess my question is how can i make this work?

Thanks for any advice you may offer

Chris
 
Have you tried printing $_[$count + 6] to see what's in it? It's usually a good idea to check it since it probably does not contain what you think it should.

BTW: Your open and print statements seem to lack close brackets and so would cause a compilation failure.


Trojan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top