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!

whats the DIFFERENCE!!!!

Status
Not open for further replies.

VspecGTR3

Technical User
Feb 3, 2003
62
US
@vaibak = <FILE>;
print BAK &quot;@complete @varibak&quot;;
when i try to run this i get an error it says i need to write it this ways
print BAK &quot;@complete \@varibak&quot;;
whats the difference!!!!!!!!!!!!
 
print BAK &quot;@complete @varibak&quot;;
You are telling PERL to print the arrays and combine them within a set of quotes which is a logic error. This is probably what you want

@final = (@complete, @varibak);

print BAK &quot;@final&quot;;



print BAK &quot;@complete \@varibak&quot;;
This \ is escaping the @ which negates the array context making it legal
 
The problem is that you mispelled the variable in the print statement ('vaibak' vs 'varibak'). Perl doesn't recognize the variable but since it's inside a string it isn't a fatal error (if you're using strict), a warning is thrown because maybe you were just trying to print a literal '@'.

jaa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top