On 12/14/10 Tue  Dec 14, 2010  9:18 AM, "Matt" <lm7...@gmail.com> scribbled:

> I am assigning a number of elements to an array like so:
> 
> my @new = `find /home/*/new -cmin 1 -type f`;
> 
> That works fine.  I would also like to append more lines to that array
> from here:
> 
> find /home/*/filed -cmin 1 -type f
> 
> How do I do that without losing whats in the array already?

Use the push function (untested):

  push( @new, `find /home/*/filed -cmin 1 -type f`);

Keep in mind that your array elements will have newlines:

  chomp(@new);

Note also that you can use Perl functions such as the built-in opendir and
readdir functions or the File::Find module to find files without resorting
to the use of separate processes and shell commands.



-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to