Does anyone know why the following is happening? A solution/workaround would be greatly appreciated!


I have a simple perl program which loops through a file, line by line -- eg:


open FOO,"..."
while (<FOO>)
{
printf $_;
}

my file looks like this:


abc
%abc
abc

etc.


When I run the program, it seems as though Perl attempts to replace '%' with a a variable reference -- for example, the output often looks like this:


abc
0bc
abc

or

abc
0.000000000bc
abc



I've tried replacing '%''s before the printf, but this doesn't work -- the variable expansion seems to occur when the line is assigned to $_


Any thoughts?


Thanks!



Jeff.

- The integrity of the transmitted information in this email is not guaranteed by Desjardins Securities, which accepts no liability for any damage caused by its fraudulent alteration. This email is confidential and is intended for the sole use of the recipient or authorized representative of the recipient. Any person who receives this email by mistake shall immediately notify the sender and destroy it. Any other use of the information therein is strictly prohibited. Desjardins Securities reserves the right to monitor all communications sent by e-mail through its networks. Instructions related to operations sent by e-mail will not be accepted. In no way does this notice limit other more restrictive warnings that may have been sent to you by Desjardins Securities.

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to