[perl] Can't print "$category[$i].dat or something\n";

Hi, I can't print array variable in the sentense.

print "$category[$i].dat  or something\n";

Some perl version can use, some can't.
How to solve it.

Thanks for advance.

Can you please explain what is meant by?

some perl version can use and some can't

What is your expected o/p, what is the i/p?

1 Like

my v5.10.0 built for MSWin32-x86-multi-thread can print those variable. But v5.8.8 built for i686-linux can't print.

It did ignore $category[$i] and print only

.dat  or something

Please post the rest of the perl program. May be its possible that there's indeed nothing in $category[$i].

1 Like

hi there,

Sorry. it's my fault.. It looklike my script process the windows text file .dat with CR/LF.

when upload to unix it doesn't strip CR. I have to upload .dat in ASCII mode and my script work very well.

Thanks

==Thread closed==