re: returning value from subroutine

2002-03-25 Thread Jeff 'japhy' Pinyan
On Mar 25, [EMAIL PROTECTED] said: >and a scalar like this >$hostname = qx(/usr/ucb/hostname); You'll want to chomp() $hostname! Output from the /usr/ucb/hostname command probably has a newline at the end of it; you'll need to remove it. >2. I want to be able to build a simple sub like this

re: returning value from subroutine

2002-03-25 Thread J . Hourihane
1. I want to be able to create a hostname => user hash table like this %hosts = ( sun1 => "bobby", sun2 +> "ronald", ) and a scalar like this $hostname = qx(/usr/ucb/hostname); 2. I want to be able to build a simple sub like this sub getname { print $getname{$hostna