in reply to Taking Keyboard Input from the command line

OxYgEn,
I am not exactly sure this is what you want, but this should get you started. You might also want to take a look at Getopt::Std
#!/usr/bin/perl use strict; use warnings; my @array = qw(foo bar blah asdf); if ( defined $ARGV[0] && defined $ARGV[1] ) { push @array , $ARGV[1] if $ARGV[0] eq 'add'; @array = grep {$_ !~ /^$ARGV[1]$/} @array if $ARGV[0] eq 'del'; } print "$_\n" for @array;
Cheers - L~R

Update: Corrected syntax error