in reply to Re^3: problems parsing data
in thread problems parsing data
Well, at the risk of showing what little I know, I've added your suggestion and how have:
use lib qw(blib lib); #use strict; use warnings; use Getopt::Long; use Pod::Usage; use Data::Dumper; use Opsware::NAS::Client; my($user,$pass,$host) = ('a', 'b', 'localhost'); my $help = 0; my $ip = '10.226.1.52'; #my $ip = '$tc_device_ip$'; my $nas = Opsware::NAS::Client->new(); my $res = $nas->login(-user => $user, -pass => $pass, -host => $host, +-nosession => '0'); $res = $nas->show_deviceinfo(ip => $ip); unless ($res->ok()) { printf STDERR ("*** error: %s\n", $res->error_message()); exit(1); } my ($image) = map { /^SystemImage:\s*([^\n]+)/ ? $1 : () } $res->resul +t(); print("$image\n"); # flash:c3750-advipservicesk9-mz.122-46.SE.bin $nas->logout();
but am getting an error of: Use of uninitialized value in string at move_image.pl line 34 So, why can't I print $image, seems like a simple thing to do.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: problems parsing data
by ikegami (Patriarch) on Jul 15, 2010 at 21:41 UTC | |
by zonevbkr (Initiate) on Jul 16, 2010 at 00:23 UTC | |
by ikegami (Patriarch) on Jul 16, 2010 at 03:28 UTC | |
by zonevbkr (Initiate) on Jul 16, 2010 at 10:41 UTC | |
by ikegami (Patriarch) on Jul 16, 2010 at 14:44 UTC | |
|
Re^5: problems parsing data
by Anonymous Monk on Oct 12, 2011 at 14:38 UTC |