ok, this is what I have changed.
AUTOLOAD; require 5.008; use strict; use warnings 'all'; use diagnostics; use Win32::OLE qw[in]; use threads; use threads::shared; use strict; my @up: shared; my @childs; my $child; my @down: shared; my @list = qw ( c:/winnt d:/perl ); for (@list){ push @childs, threads->create("process_path","$_");} for $child (@childs){ $child->join();} for my $info (@up){ print $info;}#I'll do some work here once I get results sub process_path{ my $path = shift @_; my $Details={}; my $fso = Win32::OLE->new( 'Scripting.FileSystemObject' ); my $FSize = $fso->GetFolder($path); my $Size = $FSize->size(); $Details->{path}=$path; $Details->{size} =$Size; push @up, $Details; }
and this what iget back in return.
C:\Scripts>threads1.pl Win32::OLE(0.1403) error 0x800a004c Win32::OLE(0.1403) error 0x800a004c in METHOD/PROPERTYGET "GetFolder" at C:\Scripts\threads1.pl line 3 +3 thread failed to start: Can't call method "size" on an undefined value + at C:\Scripts\threads1.pl line 34 (#1) (F) The entry point function of threads->create() failed for some +reason. in METHOD/PROPERTYGET "GetFolder" at C:\Scripts\threads1.pl line 3 +3 thread failed to start: Can't call method "size" on an undefined value + at C:\Scripts\threads1.pl line 34 (#1) (F) The entry point function of threads->create() failed for some +reason. Free to wrong pool 1a99e90 not 223f58 during global destruction.
I don't know what else to do to it! So, is this the end?

Cheers.

In reply to Re: Re: Starting multi-threading by blackadder
in thread Starting multi-threading by blackadder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.