Thread: [Arsperl-users] handling ARWARN 1200
Brought to you by:
jeffmurphy
|
From: Paizo <pai...@gm...> - 2007-10-05 08:58:56
|
Hi listeners,
I'm making a perl script to check the presence of some kind of tickets.
Usually there are no tickets of this kind causing a ARWARN 1200.
I would like to handle this warning but i miss something....
$arwarn =3D "";
(%entries =3D ars_GetListEntry($ctrl, $ARSschema, $qual, 0, 0)) || ($arwarn=
=3D
$ars_errstr);
print "$arwarn\n"; # $arwarn is empty!
if ($arwarn=3D~ m/\ARWARN 1200/i)
{
ars_Logoff($ctrl) || exit 0;
exit 0;
}
what's wrong with that code?
Seems also that $arwarn is empty because it print nothing at all.
thank you for your time.
--=20
--------------------
A me cugin na volta xe nd=E0 dal geataro e el ga domand=E0 na coppetta trig=
usto
co i gusti seegheta, sarexe e schie co na fettina de poenta.
El geataro pena sentio che=E0 goduriosa scelta, el se ga messo subito el
pigiama de banane e el ghe ga messo in testa a corona de poegge medie e lo
ga fatto diventare Re dei Gelati Biricchini.
-----------------------
Confezione trigusto seegheta/sarexe/chie co pratico contenitore par e fete
de poenta, stile estat=E8 o quea dea ciocoeata
Altri gusti poe essere bigadini/kiwi/lasonil co socoi de vacca da tociare o
erbagatta/straciatella/calsina co coe de sorxe da tociare
------------
Rileggendo a firma diria che se poe puntare al mercato dei ghiaccioli col e=
l
gusto crema al diserbo e parafl=F9 ricoperta da una soffice crosta de pus c=
o
al posto del bacheto un termometro anale pratico pa misurarse a freve dopo
aver magn=E0 el geato (chi xe che no lo fa al giorno d'oggi?!?!). Garantite
scorese bitonali e solfeggi anali.
|
|
From: Alex A. <ale...@oi...> - 2007-10-05 14:07:26
|
Hi Paizo,
In the programs that I've written, I usually check the size of the
hash or array as opposed to checking for ARWARN 1200. I'll provide
two examples of how to do this. The first example is with a hash and
the second is with an array.
The first example is untested code that I put together by doing some
googling. The keys() function might be helpful. For example:
%entries = ars_GetListEntry($ctrl, $ARSschema, $qual, 0, 0);
$hash_size = keys(%entries);
if ($hash_size eq 0) {
print "ARWARN 1200: Nothing was found\n");
ars_Logoff($ctrl) || exit 0;
exit 0;
}
A lot of programs that I've written in the past use an array
instead of a hash and then branch based on the size of the array.
Partial code from an actual working program:
@entries = ars_GetListEntry($c, $s_ho, $q, 0, 0);
if ($#entries eq -1) {
print MAIL ("There are no $holdtypes.\n");
} elsif ($#entries eq 1) {
print MAIL ("There is one $holdtype:\n\n");
$entry_num = $entries[0];
&PrintHeader;
&PrintEntry($entry_num, $startorend, $holdtype);
} else {
$ent_num = ($#entries + 1) / 2;
print MAIL ("There are $ent_num $holdtypes:\n");
&PrintHeader;
for ($i = 0; $i <= $#entries; $i +=2 ) {
$entry_num = $entries[$i];
&PrintEntry($entry_num, $startorend, $holdtype);
}
}
Hope that helps!
Alex
On Fri, Oct 05, 2007 at 10:31:00AM +0200, Paizo wrote:
> Hi listeners,
>
> I'm making a perl script to check the presence of some kind of tickets.
> Usually there are no tickets of this kind causing a ARWARN 1200.
> I would like to handle this warning but i miss something....
>
>
> $arwarn = "";
> (%entries = ars_GetListEntry($ctrl, $ARSschema, $qual, 0, 0)) || ($arwarn =
> $ars_errstr);
>
> print "$arwarn\n"; # $arwarn is empty!
>
> if ($arwarn=~ m/\ARWARN 1200/i)
> {
> ars_Logoff($ctrl) || exit 0;
> exit 0;
> }
>
> what's wrong with that code?
> Seems also that $arwarn is empty because it print nothing at all.
>
>
> thank you for your time.
>
>
> --
> --------------------
> A me cugin na volta xe ndà dal geataro e el ga domandà na coppetta trigusto
> co i gusti seegheta, sarexe e schie co na fettina de poenta.
> El geataro pena sentio cheà goduriosa scelta, el se ga messo subito el
> pigiama de banane e el ghe ga messo in testa a corona de poegge medie e lo
> ga fatto diventare Re dei Gelati Biricchini.
> -----------------------
> Confezione trigusto seegheta/sarexe/chie co pratico contenitore par e fete
> de poenta, stile estatè o quea dea ciocoeata
> Altri gusti poe essere bigadini/kiwi/lasonil co socoi de vacca da tociare o
> erbagatta/straciatella/calsina co coe de sorxe da tociare
> ------------
> Rileggendo a firma diria che se poe puntare al mercato dei ghiaccioli col el
> gusto crema al diserbo e paraflù ricoperta da una soffice crosta de pus co
> al posto del bacheto un termometro anale pratico pa misurarse a freve dopo
> aver magnà el geato (chi xe che no lo fa al giorno d'oggi?!?!). Garantite
> scorese bitonali e solfeggi anali.
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Arsperl-users mailing list
> Ars...@ar...
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
--
O--------------O--O---------------------------------O
| Alex Agle \/ Systems Support Specialist III |
O---------------/\ Georgia Institute of Technology |
|(404)894-6165 //\\ ITS - Applications Support |
| Atlanta, GA //\/\\ alex.agle(@)oit.gatech.edu |
O------------O-\/\/-O-------------------------------O
|
|
From: Paizo <pai...@gm...> - 2007-10-12 07:38:07
|
Thank you Alex, that's help me :)
2007/10/5, Alex Agle <ale...@oi...>:
>
> Hi Paizo,
>
> In the programs that I've written, I usually check the size of the
> hash or array as opposed to checking for ARWARN 1200. I'll provide
> two examples of how to do this. The first example is with a hash and
> the second is with an array.
>
> The first example is untested code that I put together by doing some
> googling. The keys() function might be helpful. For example:
>
> %entries =3D ars_GetListEntry($ctrl, $ARSschema, $qual, 0, 0);
> $hash_size =3D keys(%entries);
>
> if ($hash_size eq 0) {
> print "ARWARN 1200: Nothing was found\n");
> ars_Logoff($ctrl) || exit 0;
> exit 0;
> }
>
> A lot of programs that I've written in the past use an array
> instead of a hash and then branch based on the size of the array.
>
> Partial code from an actual working program:
>
> @entries =3D ars_GetListEntry($c, $s_ho, $q, 0, 0);
> if ($#entries eq -1) {
> print MAIL ("There are no $holdtypes.\n");
> } elsif ($#entries eq 1) {
> print MAIL ("There is one $holdtype:\n\n");
> $entry_num =3D $entries[0];
> &PrintHeader;
> &PrintEntry($entry_num, $startorend, $holdtype);
> } else {
> $ent_num =3D ($#entries + 1) / 2;
> print MAIL ("There are $ent_num $holdtypes:\n");
> &PrintHeader;
> for ($i =3D 0; $i <=3D $#entries; $i +=3D2 ) {
> $entry_num =3D $entries[$i];
> &PrintEntry($entry_num, $startorend, $holdtype);
> }
> }
>
> Hope that helps!
> Alex
>
> On Fri, Oct 05, 2007 at 10:31:00AM +0200, Paizo wrote:
> > Hi listeners,
> >
> > I'm making a perl script to check the presence of some kind of tickets.
> > Usually there are no tickets of this kind causing a ARWARN 1200.
> > I would like to handle this warning but i miss something....
> >
> >
> > $arwarn =3D "";
> > (%entries =3D ars_GetListEntry($ctrl, $ARSschema, $qual, 0, 0)) ||
> ($arwarn =3D
> > $ars_errstr);
> >
> > print "$arwarn\n"; # $arwarn is empty!
> >
> > if ($arwarn=3D~ m/\ARWARN 1200/i)
> > {
> > ars_Logoff($ctrl) || exit 0;
> > exit 0;
> > }
> >
> > what's wrong with that code?
> > Seems also that $arwarn is empty because it print nothing at all.
> >
> >
> > thank you for your time.
> >
> >
> > --
> > --------------------
> > A me cugin na volta xe nd=E0 dal geataro e el ga domand=E0 na coppetta
> trigusto
> > co i gusti seegheta, sarexe e schie co na fettina de poenta.
> > El geataro pena sentio che=E0 goduriosa scelta, el se ga messo subito e=
l
> > pigiama de banane e el ghe ga messo in testa a corona de poegge medie e
> lo
> > ga fatto diventare Re dei Gelati Biricchini.
> > -----------------------
> > Confezione trigusto seegheta/sarexe/chie co pratico contenitore par e
> fete
> > de poenta, stile estat=E8 o quea dea ciocoeata
> > Altri gusti poe essere bigadini/kiwi/lasonil co socoi de vacca da
> tociare o
> > erbagatta/straciatella/calsina co coe de sorxe da tociare
> > ------------
> > Rileggendo a firma diria che se poe puntare al mercato dei ghiaccioli
> col el
> > gusto crema al diserbo e parafl=F9 ricoperta da una soffice crosta de p=
us
> co
> > al posto del bacheto un termometro anale pratico pa misurarse a freve
> dopo
> > aver magn=E0 el geato (chi xe che no lo fa al giorno d'oggi?!?!).
> Garantite
> > scorese bitonali e solfeggi anali.
>
> >
> -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems? Stop.
> > Now Search log events and configuration files using AJAX and a browser.
> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > _______________________________________________
> > Arsperl-users mailing list
> > Ars...@ar...
> > https://lists.sourceforge.net/lists/listinfo/arsperl-users
>
>
> --
> O--------------O--O---------------------------------O
> | Alex Agle \/ Systems Support Specialist III |
> O---------------/\ Georgia Institute of Technology |
> |(404)894-6165 //\\ ITS - Applications Support |
> | Atlanta, GA //\/\\ alex.agle(@)oit.gatech.edu |
> O------------O-\/\/-O-------------------------------O
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Arsperl-users mailing list
> Ars...@ar...
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
>
>
--=20
--------------------
A me cugin na volta xe nd=E0 dal geataro e el ga domand=E0 na coppetta trig=
usto
co i gusti seegheta, sarexe e schie co na fettina de poenta.
El geataro pena sentio che=E0 goduriosa scelta, el se ga messo subito el
pigiama de banane e el ghe ga messo in testa a corona de poegge medie e lo
ga fatto diventare Re dei Gelati Biricchini.
-----------------------
Confezione trigusto seegheta/sarexe/chie co pratico contenitore par e fete
de poenta, stile estat=E8 o quea dea ciocoeata
Altri gusti poe essere bigadini/kiwi/lasonil co socoi de vacca da tociare o
erbagatta/straciatella/calsina co coe de sorxe da tociare
------------
Rileggendo a firma diria che se poe puntare al mercato dei ghiaccioli col e=
l
gusto crema al diserbo e parafl=F9 ricoperta da una soffice crosta de pus c=
o
al posto del bacheto un termometro anale pratico pa misurarse a freve dopo
aver magn=E0 el geato (chi xe che no lo fa al giorno d'oggi?!?!). Garantite
scorese bitonali e solfeggi anali.
|