REQ: please me. "get data from line in Perl under Linux" TIA

please help to get the number of the following example line:

RX bytes:55313 (54.0 Kb) TX bytes:55313 (54.0 Kb)

i could filter this line from the ifconfig command, but how can i get
the bytes, "55313", from the line?
many thanx in advance

john
John [ Mo, 09 Mai 2005 19:06 ] [ ID #784751 ]

Re: REQ: please me. "get data from line in Perl under Linux" TIA

john wrote:
> please help to get the number of the following example line:
>
> RX bytes:55313 (54.0 Kb) TX bytes:55313 (54.0 Kb)
>
> i could filter this line from the ifconfig command, but how can i get
> the bytes, "55313", from the line?

Extract them by help of the m// operator.

perldoc perlop (where the m// operator is described)
perldoc perlretut (where you find more about regular expressions
in general including more extracting examples)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Gunnar Hjalmarsson [ Mo, 09 Mai 2005 19:40 ] [ ID #784752 ]
Perl » alt.perl » REQ: please me. "get data from line in Perl under Linux" TIA

Vorheriges Thema: DBI solaris 10
Nächstes Thema: howto list running processes with Perl?