Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Extracting System Info

by wine (Scribe)
on Jul 23, 2001 at 17:00 UTC ( #98999=note: print w/replies, xml ) Need Help??


in reply to Re: Extracting System Info
in thread Extracting System Info

In this case, you treat /proc/pci per line. Perhaps you would like to read the file by records, like:

# example of a full record Bus 0, device 0, function 0: Host bridge: Intel Unknown device (rev 3). Vendor id=8086. Device id=7190. Medium devsel. Master Capable. Latency=64. Prefetchable 32 bit memory at 0xe6000000 [0xe6000008].

If so, you only need to make a slight modification to MZSanford code:

use strict; my @devices; undef $/; foreach (split /\n\s\s\b/, <DATA>) { # you now have the whole record in $_ # do with it as you please } <snip>

- Good luck

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2023-03-27 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (65 votes). Check out past polls.

    Notices?