Very confusing error. Doesn't make sense to me pls halb When I try to push a string to an array it doesn't work. Later the array is said to be empty. But I can print the string.

Someone didn't like my chants

#!/usr/bin/perl use warnings; use strict; use File::Find; use Parallel::ForkManager; my @toUnlink; #ARRAY THAT IS NAUGHTY my $maxProcs = 3; my $pm = new Parallel::ForkManager($maxProcs); foreach my $keySets (keys %chunked){ foreach ( @{$chunked{$keySets}} ){ my $pid = $pm->start and next; my $cychpTxtFile = $fileManifest{$encryptKey}.".txt"; #Im not +showing you the whole script, but this works if ( -e $cychpTxtFile ) { push @toUnlink, $cychpTxtFile; # WHY WONT YOU WORK! print $cychpTxtFile."\n"; #PRINTS TO THE SCREEN } $pm->finish; } print @toUnlink."\n"; # NADA } $pm->wait_all_children;
Here's the output
0 /Users/.../Desktop/cychip/cyto/Oligo/Oligo 2013/010613ES/010613ESA ABN +. CONTROL_(CytoScanHD_Array)_2012.cyhd.cychp.txt 0 /Users/.../Desktop/cychip/cyto/Oligo/Oligo 2013/010613ESA ABN. CONTROL +_(CytoScanHD_Array)_2012.cyhd.cychp.txt /Users/.../Desktop/cychip/cyto/Oligo/Oligo 2012/010613ESA ABN. CONTROL +_(CytoScanHD_Array)_2012.cyhd.cychp.txt /Users/.../Desktop/cychip/cyto/Oligo/Oligo 2012/milk/010613ESA ABN. CO +NTROL_(CytoScanHD_Array)_2012.cyhd.cychp.txt 0 /Users/.../Desktop/cychip/cyto/Oligo/Oligo 2012/eggs/010613ESA ABN. CO +NTROL_(CytoScanHD_Array)_2012.cyhd.cychp.txt /Users/.../Desktop/cychip/cyto/Oligo/Oligo 2012/coffe/010613ESA ABN. C +ONTROL_(CytoScanHD_Array)_2012.cyhd.cychp.txt

In reply to Push it real good, or don't by pimperator

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.