http://www.perlmonks.org?node_id=11104698


in reply to The error says the value is uninitialized, but it works anyway

A different solution AKA TMTOWTDI using Set::Scalar:

#!/usr/bin/env perl use strict; use warnings; use Test::More; use Data::Dump; use Set::Scalar; my @colors = qw(red green blue yellow pink purple brown); my @drop = qw(pink brown); my @expected = qw(red green blue yellow purple); my $colors = Set::Scalar->new(@colors); print qq(\@colors = ); dd @colors; print qq(\@drop = ); dd @drop; print qq(\@expected = ); dd @expected; $colors->delete(@drop); my @result = $colors->members; print qq(\@result = ); dd @result; is(@result, @expected, qq(Dropping members @drop from \@colors)); done_testing(); print qq(\@colors = ); dd @colors; __END__ Karls-Mac-mini:Desktop karl$ ./mizducky_02.pl @colors = ("red", "green", "blue", "yellow", "pink", "purple", "brown" +) @drop = ("pink", "brown") @expected = ("red", "green", "blue", "yellow", "purple") @result = ("purple", "red", "yellow", "green", "blue") ok 1 - Dropping members pink brown from @colors 1..1 @colors = ("red", "green", "blue", "yellow", "pink", "purple", "brown" +)

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help