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

Re: Parse variables from @output

by Cisco_Dave (Novice)
on Nov 15, 2019 at 08:13 UTC ( #11108718=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/local/bin/perl
    ##
    ...
        $details{'Chassis'} = $1 if (/^Model number: (\S+)/i);
        print Dumper(\%details);
    }
    
  2. or download this
    $VAR1 = {};
    $VAR1 = {};
    $VAR1 = {};
    
  3. or download this
    $VAR1 = {
              'Main Memory' => '3981680',
    ...
              'Main Memory' => '65526K/8192K',
              'Chassis' => 'WS-C3550-48'
            };
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2021-10-20 23:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (82 votes). Check out past polls.

    Notices?