Ok guy I solved my problem. The correct line was: my @pippo = qx/ssh [EMAIL PROTECTED] sar -u 1 1|awk '\/\%usr \%sys \%wio \%idle\/ { getline ; printf "\%s \%s \%s \%s\\n", \$2, \$3, \$4, \$5 }'/ ;
I had problem because perl try to undertand what meant "@ and / and %..." Thank you Mauro ----- Original Message ----- From: "Mauro" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 14, 2004 1:39 PM Subject: Re: array assignement > That's ok Gunnar... > I wanted to say... > How can I tell to perl: "take all between qx/ and / without try to > understend what is written" or well "don't try to sobstitue anything between > qx/ and /"? > > Thank You > > ----- Original Message ----- > From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, October 14, 2004 12:19 PM > Subject: Re: array assignement > > > > Mauro wrote: > > > I want to assign to an array the output of operating system > > > command: /usr/bin/ssh [EMAIL PROTECTED] sar -u 1 1|awk '/%usr > > > %sys %wio %idle/ { getline ; printf "%s %s %s %s\n", $2, $3, > > > $4, $5 }' > > > How can I do it? > > > > Use backticks (or the qx// operator) to capture output in Perl from a > > system command. > > > > my @array = qx($command); > > > > > I have some problem because there are a lot of special character... > > > > Don't understand. > > > > -- > > Gunnar Hjalmarsson > > Email: http://www.gunnar.cc/cgi-bin/contact.pl > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > > > > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > <http://learn.perl.org/> <http://learn.perl.org/first-response> > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>