From:                   [EMAIL PROTECTED]
> I supose that the end result of:
> 
> for ($init_cnt=0;$init_cnt<=$#out_array_bin;$init_cnt++) {
>    $out_array_bin[$init_cnt] = "";
> }
> 
> and 
> 
> '@out_array_bin = ();' or 'undef @out_array_bin;'
> 
> is not the some, is it?

No it's not. 
Suppose the array looked like this:

        @out_array_bin = ( 'hello', 'world', 'this', 'is an array');

then after your code it will be like this:

        @out_array_bin = ( '', '', '', '');

while after mine it will be just

        @out_array_bin = ();

You can try it out like this:

        use Data::Dumper;
        $Data::Dumper::Indent = 0;
        $Data::Dumper::Terse = 1;

        @out_array_bin = ( 'hello', 'world', 'this', 'is an array');
        print "Original: " . Dumper([EMAIL PROTECTED]) . "\n";

        for ($init_cnt=0;$init_cnt<=$#out_array_bin;$init_cnt++) {
    $out_array_bin[$init_cnt] = "";
        }
        print "Yours: " . Dumper([EMAIL PROTECTED]) . "\n";

        @out_array_bin = ( 'hello', 'world', 'this', 'is an array');
        print "Original: " . Dumper([EMAIL PROTECTED]) . "\n";

        @out_array_bin = ();
        print "Mine(): " . Dumper([EMAIL PROTECTED]) . "\n";

        @out_array_bin = ( 'hello', 'world', 'this', 'is an array');
        print "Original: " . Dumper([EMAIL PROTECTED]) . "\n";

        undef @out_array_bin;
        print "Mine undef: " . Dumper([EMAIL PROTECTED]) . "\n";

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to