Re: [NEW ANSWER] perlfaq5: How can I copy a file?

2005-01-03 Thread Tony Cook
On Mon, Jan 03, 2005 at 11:13:36AM -0800, _brian_d_foy wrote: > Index: perlfaq5.pod ... > +Use the File::Copy module. It comes with Perl and can do a > +true copy across file systems, and it does its magic in > +a protable fashion. s/protable/portable/

Re: perlfaq4: How can I remove duplicate elements from a list or array?

2005-03-31 Thread Tony Cook
On Thu, Mar 31, 2005 at 03:09:00PM -0600, _brian_d_foy wrote: > You can write this more briefly using a grep, which does the > same thing. > >my %Seen = (); >my @unique = grep { ! $Seen{ $elem }++ } @array; This should probably be: my %Seen = (); my @unique = grep { ! $Seen{ $_ }