Re: anonymous array for loop

2013-03-10 Thread Brandon McCaig
On Sun, Mar 10, 2013 at 11:06:14AM -0400, Brandon McCaig wrote: > There is no array here. There are only lists. See perldoc > perldata. > > > List value constructors > > List values are denoted by separating individual values > > by commas (and enclosing the list in parentheses where

Re: anonymous array for loop

2013-03-10 Thread Brandon McCaig
Protip: you should stay on list for this. :) Cc'ing the list. On Sun, Mar 10, 2013 at 11:16:50AM +, John Delacour wrote: > On 09/03/2013 20:57, Brandon McCaig wrote: > >You cannot have anonymous arrays in Perl except by reference. > > What about this? > > for (split //, "abc") { > print

Re: anonymous array for loop

2013-03-09 Thread Brandon McCaig
On Sat, Mar 09, 2013 at 08:19:43PM -0600, Chris Stinemetz wrote: > I don't think that is true. > > Example being: > > #!/usr/bin/perl > use warnings; > use strict; > > use Data::Dumper; > > my $firstVar = "One"; > my $secondVar = "Two"; > > my @array; > push @array,[$firstVar, $secondVar]; >

Re: anonymous array for loop

2013-03-09 Thread Chris Stinemetz
On Sat, Mar 9, 2013 at 2:57 PM, Brandon McCaig wrote: > On Sat, Mar 09, 2013 at 07:24:37AM -0600, Chris Stinemetz wrote: > > Each anonymous array @files and @newFiles has 5 total elements. > > Just to nitpick, @files and @newFiles are not anonymous arrays. > They are just arrays. They have names.

Re: anonymous array for loop

2013-03-09 Thread Brandon McCaig
On Sat, Mar 09, 2013 at 07:24:37AM -0600, Chris Stinemetz wrote: > Each anonymous array @files and @newFiles has 5 total elements. Just to nitpick, @files and @newFiles are not anonymous arrays. They are just arrays. They have names. You cannot have anonymous arrays in Perl except by reference. Th

Re: anonymous array for loop

2013-03-09 Thread *Shaji Kalidasan*
---------- Your talent is God's gift to you. What you do with it is your gift back to God. --- From: Chris Stinemetz To

Re: anonymous array for loop

2013-03-09 Thread Chris Stinemetz
Never mind, I got it. I was over thinking it. I just created one anonymous array with the elements I wanted then used the following loop. foreach my $file (@files) { print join( "\t", @$file[0], @$file[1] ), "\n"; $ftp->put(@$file[0], @$file[1]) || die "can't put files: @$file[0] \t @$file[1

anonymous array for loop

2013-03-09 Thread Chris Stinemetz
Thank you in advance. Each anonymous array @files and @newFiles has 5 total elements. How can I alter this nested for so that just the unique elements are printed instead of each element twice? foreach my $file (@files) { foreach my $newFileName ( @newFiles ) { print join( "\t", @$file, @$ne