--- a p <[EMAIL PROTECTED]> wrote:
> Hi,
Hi. =o)
> Today is my first day on Perl so please bear with me if this sounds
> stupid...
lol -- welcome aboard, and don't worry about it.
Just be sure to do this:
perldoc -t perl >tmp
and then look at tmp to see the things you can look at in more detail,
like perlfunc. Then
perldoc -t perlfunc >perlfunc
And look over perlfunc (or whatever you made).
For functions, the names of which you'll find in perlfunc, try
perldoc -f grep
which, for simplicity's sake, is probably the one you want right now,
though the Perl motto is TIMTOWTDI:
"There Is More Than One Way To Do It."
> How can I find out if an array contains a particular element stored
> in a certain variable ?
Reformatting your pseudocode (please don't take offense =o)
$TEST1 = "030";
@HOLDER = ("020", "040", "034", "056", "030");
> I need to find out if "030" is present in the array HOLDER
print "gotit\n" if grep /^$TEST1$/, @HOLDER;
However, you might also try a hash....
@HOLDER{ ("020", "040", "034", "056", "030") } = (1..5);
print "gotit\n" if $HOLDER{$TEST1};
read
perldoc perldata
And happy Perling. ;o]
=====
print "Just another Perl Hacker\n"; # edited for readability =o)
=============================================================
Real friends are those whom, when you inconvenience them, are bothered less by it than
you are. -- me. =o)
=============================================================
"There are trivial truths and there are great Truths.
The opposite of a trival truth is obviously false.
The opposite of a great Truth is also true." -- Neils Bohr
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/