[Chicago-talk] Why won't this work?

Richard Reina richard at rushlogistics.com
Wed Aug 1 06:56:00 PDT 2007

Hi all.  Does anyone know what I'm missing here?

#!/usr/bin/perl -w

my @arr = qw(a b c d);

foreach $def (@arr) {
        if ($def eq "b") {
             my $trash = shift  # get rid of (trash) b

print "@arr\n";

"b" does not get eliminated?

Thanks for any help.



Your beliefs become your thoughts.  Your thoughts become your words.  Your words become your actions.  Your actions become your habits.  Your habits become your values.  Your values become your destiny.  -- Mahatma Gandhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20070801/b35d950c/attachment.html 

More information about the Chicago-talk mailing list