If you edit your node and put <CODE> ... </CODE> tags around the code then it will be far more legible and your <FILE1> and <FILE> expressions won't be interpeted as HTML tags.
At the same time, you should probably consider checking the return value from the open function. I realise that this is just an example, but people will copy and paste it, so you should make it as safe as possible.
--
<http://www.dave.org.uk>
European Perl Conference - Sept 22/24 2000, ICA, London
<http://www.yapc.org/Europe/>
| [reply] |
I see your point. Thank you :)
| [reply] |
Excuse me for my badly formatted reply.
I've missed to RTF.How To display...:>
Here the piece of code I suggest:
my $length;
open( FILE1, "string1" );
open( FILE2, "string2" );
$string1 = <FILE1>;
$string2 = <FILE2>;
map {
$a = substr($string1, $_, 1);
$b = substr($string2, $_, 1);
print "$b$a ";
} reverse(0 .. length($string1) - 1);
| [reply] |