M
Mark Connell
Hello,
I am using a subroutine multiple times. Depending on the type of hash
I am sending to teh subroutine, I am trying to output different things
to a file. I was wondering how I can do this--I tried creating an if
statement using the name of 1 type of input to output a certain way,
and else for the other type of input... but I was unable to do this
correctly. If I have two diff hashes (ex %1 and %2) that will be used
in my subroutine, can I do something like inside the subroutine:
if (@_ eq %1) {print this}
elseif (@_ eq %2) {print this}
else {...}
That didnt work for me, but I was wondering if the idea was reasonable
or if I should try something different.
Thanks for you time
Mark
I am using a subroutine multiple times. Depending on the type of hash
I am sending to teh subroutine, I am trying to output different things
to a file. I was wondering how I can do this--I tried creating an if
statement using the name of 1 type of input to output a certain way,
and else for the other type of input... but I was unable to do this
correctly. If I have two diff hashes (ex %1 and %2) that will be used
in my subroutine, can I do something like inside the subroutine:
if (@_ eq %1) {print this}
elseif (@_ eq %2) {print this}
else {...}
That didnt work for me, but I was wondering if the idea was reasonable
or if I should try something different.
Thanks for you time
Mark