Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: A wrapper script for tmpwatch in Linux written in Perl

by bloonix (Monk)
on Jul 03, 2007 at 11:18 UTC ( [id://624640]=note: print w/replies, xml ) Need Help??


in reply to A wrapper script for tmpwatch in Linux written in Perl

system "/usr/bin/ssh $system->{host}#this part doesn't work, o+nly brings back reference";
of course! $system->{host} is a hash reference! you need
$system->{host}->{$host}
to access the hostname.

Replies are listed 'Best First'.
Re^2: A wrapper script for tmpwatch in Linux written in Perl
by wishartz (Beadle) on Jul 03, 2007 at 12:14 UTC
    I tried that and it doesn't work because it only enters that part of the if condition, if $host (the machine you are logged into at that time, which I have set with $host =`hostname`) doesn't equal $system->{host}
    if ( not $system->{host}{$host})
    I need to be able to dreference $system->{host} so it will come up with the name of the hostname, but I don't think that will work because the hostname is the key rather than the value. I think I might have to change my hash. Thanks for your help anyway.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://624640]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-25 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found