perl help with - if exists
Hi All,
I would like to know how to have if else block if am using if exists to check whether an entity is available in hash Code:
#! /opt/third-party/bin/perl |
Hi,
Instead of saying: print "$_\n" if exists $fileHash{$_}; You can also say: if (exists $fileHash{$_}) { print "Yep, it exists!\n"; } Which makes adding an else part easy: Code:
if (exists $fileHash{$_}) { |
Yes Definitely! :)
Thanks a lot for the help! I should have the habit of structured learning. :) |
All times are GMT -5. The time now is 06:47 AM. |