in reply to problem with subroutine and passing hash

You need more whitespace , use perltidy

Don't use prototypes , you don't need'em ( see Modern Perl about that). Instead of  sub getDetails() { ... write this  sub getDetails { ...

You need more subroutines

Main( @ARGV ); exit( 0 ); sub Main { my( $file ) = @_; my $locomotion = SlurpLocomotion( $file ); TableExpel( $outfile, $locomition ); } sub TableExpel { ... my ( $do, $re, $mi ) = getDetails( $locomotion ); ... }

You're using $host as a regular expression. It might not matter with your current data , but don't treat $var as a regular expression unless it is a regular expression. Escape it. Use quotemeta (  /^\Q$var\E/ ).

Your program doesn't compile, its incomplete and you're missing sample input -- in short, its impossible to debug.

If all you want to debug is getDetails, like Basic debugging checklist teaches, dump\@_ some sample data from getDetails and post a short representative portion ( How do I post a question effectively? ).