Alain Vander Velde wrote:
@results=`at -l`;
Bien vu Alain ;-)
explication de l'autre Alain :
tu envoyais ton résultat non pas dans un tableau mais dans une variable
scalaire (place pour une seule ligne) : suivant le contexte de
réception, une commande peut générer un tableau, ou si le contexte est
scalaire, juste un chiffre qui est tout simplement le nombre de lignes
du tableau.
for (my $i=0; $i<@results; $i++) :
dans ce contexte où '$i<xxx' attend un chiffre xxx, @results produit ce
chiffre, c-à-d le count et on a en fait dans ton ex $i<3.
Bonne journée,
Alain
Thomas Silvestre wrote:
Salut la liste,
je sêche sur un truc qui doit être vraiment simple en perl.
J'aimerais faire un processing de l'output de "at -l" en perl.
Voici l'ouput de at:
[EMAIL PROTECTED]:~/tmp/MW/dev$ at -l
9 2006-01-20 00:00 a sys12
10 2006-02-13 01:00 a sys12
j'arrive à récupérer chaques éléments, mais seulement de la première
ligne:
my $atqo=qx/at -l/;
my($aJ,$aY,$aM,$aD,$aH,$aM)=( $atqo =~ m/(\d+).*(\d+)-(\d+)-(\d+)\
(\d+):(\d+)/ );
en fait je désire faire un tableau dans lequel je pourrai retrouver
ces valeurs mais je n'arrive pas à "boucler" dans la variable $atqo.
Y-a-t-il un avis éclairé sur la liste?
--
Thomas Silvestre
_______________________________________________________
Linux Mailing List - http://www.unixtech.be
Subscribe/Unsubscribe:
http://lists.unixtech.be/cgi-bin/mailman/listinfo/linux
Archives: http://www.mail-archive.com/linux@lists.unixtech.be
IRC: chat.unixtech.be:6667 - #unixtech
NNTP: news.gname.org - gmane.org.user-groups.linux.unixtech
--
" Do something for freedom every day "
* support Open Document Format :
please discover and use OpenOffice (gratis)
* or at least, install it as a converter from open format
to a proprietary one.
Please realize that proprietary formats are important tools
to reinforce a monopoly.
begin:vcard
fn:Dr Alain EMPAIN
n:EMPAIN;Alain
org:University of LIEGE;Euregio ALMA-Grid project
adr;quoted-printable:Avenue de l'H=C3=B4pital, 3;;BAT. B23 GIGA,;Liege 1;;B-4000;Belgium
email;internet:[EMAIL PROTECTED]
title:Bioinformatics
tel;work:+32 4 366 4497
tel;fax:+32 4 366 2917
tel;home:+32 85 51 2341
tel;cell:+32 497 70 1764
x-mozilla-html:FALSE
version:2.1
end:vcard
_______________________________________________________
Linux Mailing List - http://www.unixtech.be
Subscribe/Unsubscribe: http://lists.unixtech.be/cgi-bin/mailman/listinfo/linux
Archives: http://www.mail-archive.com/linux@lists.unixtech.be
IRC: chat.unixtech.be:6667 - #unixtech
NNTP: news.gname.org - gmane.org.user-groups.linux.unixtech