Re: [Arsperl-users] Performance problems
Brought to you by:
jeffmurphy
|
From: Paizo <pai...@gm...> - 2007-08-02 15:20:40
|
i tried the following:
foreach my $entry_id (sort keys %entries) {
my %entry =3D ars_GetEntry($ctrl, $ARSschema, $entry_id, @field_ids);
print "$field_ids[3]\n";# test: print number 3 the first clicle then
nothing
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =3D
gmtime($field_ids[3]);
$year +=3D 1900;
$mon +=3D 1;
if ($mday < 10) {
$timestamp_a =3D "0".$mday.q{/};
} else {
$timestamp_a =3D $mday.q{/};
}
if ($mon < 10) {
$timestamp_a .=3D "0".$mon.q{/}.$year." ";
} else {
$timestamp_a .=3D $mon.q{/}.$year." ";
}
if ($hour < 10) {
$timestamp_a .=3D "0".$hour.".";
} else {
$timestamp_a .=3D $hour.".";
}
if ($min < 10) {
$timestamp_a .=3D "0".$min.".";
} else {
$timestamp_a .=3D $min.".";
}
if ($sec < 10) {
$timestamp_a .=3D "0".$sec;
} else {
$timestamp_a .=3D $sec;
}
print "$timestamp_a\n\n"; #test: print 01/01/1970 00.00.03 in the firs=
t
cile then always 01/01/1970 00.00.00
$field_ids[3] =3D $timestamp_a;
print datafile join("|", @entry{@field_ids} ) . "\n";
}
hope its more clear.
2007/8/2, Clayton Scott <cla...@gm...>:
>
> On 8/2/07, Paizo <pai...@gm...> wrote:
> > i have another ( stupid question, still new to perl :| ) , if inside th=
e
> the
> > loop:
> > [ loop snipped ]
> > i want to convert some dates that are in seconds since 1970 to somethin=
g
> > like dd/mm/yyyy hh.mm.ss
> > if i try to read $field_ids[3] and always get "3" instead of the real
> > content :/
> > what i miss?
>
> Without more code, and data I really can't tell.
>
> If you want the value for a field in the form you more likely want to
> use the entry hash:
>
> $entry{'field_id'}
>
> If you want to inspect these data structures you can use the
> Data::Dumper module.
>
> use Data::Dumper;
> ....
>
> print Dumper \@field_ids;
>
> foreach my $entry_id (sort keys %entries) {
> my %entry =3D ars_GetEntry($ctrl, $ARSschema, $entry_id, @field_ids);
> print Dumper \%entry;
> print datafile join("|", @entry{@field_ids} ) . "\n";
> }
>
> --
>
> Clayton Scott
> cla...@gm...
>
> -------------------------------------------------------------------------
> 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.
|