Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Re: Extracting System Info

by Mantis (Initiate)
on Jul 23, 2001 at 17:14 UTC ( #99001=note: print w/replies, xml ) Need Help??

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

The machine is a standard Intel Pentium PC. The section of /proc/pci I am interested in, looks like this:-
Bus 0, device 15, function 0 Unknown class: Unknown vendor Unknown device (rev 1). Vendor id=135a. Device id=61. Medium devsel. Fast back-to-back capable. IRQ 9 Non-prefetchable 32 bit memory at 0x412000000 I/O at 0x2080 I/O at 0x2400 I/O at 0x2410 Blah.. Blah..
I am interested in seeking out devices with this vendor and device id and then getting just the I/O entires (just 2nd and 3rd though, not interested in the first. I tried the posted example but got:
Name "main::DATA" used only once: possible type at line 6 readline() on closed filehandle main::DATA at line 6..

Replies are listed 'Best First'.
Re:(3) Extracting System Info
by Cirollo (Friar) on Jul 23, 2001 at 17:30 UTC
    The stuff that he put after the __END__ line gets read into the filehandle called DATA. So, what you want to do is open up /proc/pci yourself (since you won't have the data embedded in your script.)

    Try putting this line before the while loop:
    open(DATA, '/proc/pci') or die "Can't open /proc/pci: $!";

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2023-03-31 13:38 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (75 votes). Check out past polls.