develooper Front page | perl.beginners | Postings from December 2002

Need help converting/sorting date field from within a Perl scrip t

Thread Previous | Thread Next
Wendy Stewart
December 24, 2002 10:37
Need help converting/sorting date field from within a Perl scrip t
Message ID:

Help!!   I'm a new Perl user and have devloped my first Perl script to
extract fields from a Remedy form into a CSV file to be ftp'd elsewhere.  I
need to sort each record on Modified-date before writing to my output file.
The Modified-date format is in absolute time
(ie:  12/24/2002 7:17:13 PM).  Here's a partial extract of my script:

# The criteria is supposed to included everything modified in the past 1
# which equates to the current time - (60 seconds * 60 minutes).

$SelectQualifier = (ars_LoadQualifier($ctrl, "$SCHEMA", "('Modified-date'
>=(\$TIMESTAMP\$ - 60*60) OR 'Create-date' >= (\$TIMESTAMP
\$ - 60*60))

%entries = ars_GetListEntry($ctrl, "$SCHEMA", $SelectQualifier, 0);
print LOGCHAN "\nError from GetListEntry: ", $ars_errstr;
$ModifiedDate        = ars_GetFieldByName($ctrl, "$SCHEMA",
$CreateDate          = ars_GetFieldByName($ctrl, "$SCHEMA", "Create-date");
$USSO_Num            = ars_GetFieldByName($ctrl, "$SCHEMA", "Formatted USSO
$Coordinator_name    = ars_GetFieldByName($ctrl, "$SCHEMA", "CKL_ISC");

# print out the data for each record.
#print ("\n about to enter loop\n");
foreach $entryKey (keys %entries) {
    %vals = ars_GetEntry($ctrl, $SCHEMA, $entryKey);
    printf(DATAOUT "%-15.15s", $vals{$CreateDate})        , ",";
    print DATAOUT $vals{$ModifiedDate}                    , ",";
    print DATAOUT $vals{$USSO_Num}                        , ",";
    print DATAOUT $vals{$Coordinator_name}                , ",";

# Log out of the server.

# Transfer the files to the OEP Host
sub FtpDataFile

Note:  I found reference to the following but don't know if it should be
incorporated into the script:   use Shell qw(sort);

Any help would be greatly appreciated.

Thank you,

Wendy Stewart

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About