On 08.06.2010 14:21, Mayfield, Andy L. wrote:
I've not had any luck getting past the login on a Blackberry Storm.
Andy L. Mayfield
Sr. Protection& Control Technician
Alabama Power Company
Office: 205-226-1805
Cell: 205-288-9140
SoLinc: 10*19140
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:arsl...@arslist.org] On Behalf Of Joe D'Souza
Sent: Monday, June 07, 2010 5:58 PM
To: arslist@ARSLIST.ORG
Subject: Re: Mid-Tier
Works on an iPhone with a few limitations..
Joe
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:arsl...@arslist.org]on Behalf Of Mayfield, Andy L.
Sent: Monday, June 07, 2010 5:40 PM
To: arslist@ARSLIST.ORG
Subject: Mid-Tier
Has anyone had any luck running mid-tier on a mobile device?
I know I've asked this before, but I keep hoping someone will finally have
some success.
Andy L. Mayfield
Sr. Protection& Control Technician
Alabama Power Company
Office: 205-226-1805
Cell: 205-288-9140
SoLinc: 10*19140
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"
package ARSx::ImportArx;
use strict;
use ARS;
#use UTAN::Util qw( splitDelimited formatRowOutput );
#use UTAN::UniTree::Database::Connection;
use ARSx::ExportArx qw( fieldIdRanges );
use ARSx::EntryUtil qw( recursivePrint );
use WFdoc::BulkTransactionHandler qw( initBulkTransactionHandler
transactionIncr $BT_RUN $BT_END );
#use DBI;
use Exporter;
our @ISA = qw( Exporter );
our @EXPORT_OK = qw( importText importFile importLine importEntry
parseHeaderLine parseLine parseAttachDsc );
our $global_dbh;
our %HEADER_MAP = (
'FIELDS' => 'fieldName',
'DTYPES' => 'dataType',
'FLD-ID' => 'fieldId',
);
our $DEFAULT_MERGE_TYPE = 2048 + 1024 + 1;
# mergeType:
# 1 Generate an error
# 2 Create a new entry with the new entry id
# 3 Delete the existing entry and create a new on in its place
# 4 Update fields specified in the fieldlist in existing entry
# 1024+num above Allow NULL in required fields (not applicable for
Submitter, Status or Short-Description)
# 2048+num above Skip field pattern checking
our %FILTER_CACHE;
sub parseLine {
my( $ctrl, $form, $line, $aHeader, $hOpt ) = @_;
# print "\nparseLine( $ctrl, $form, $line, $aHeader, $hOpt )\n"; #
_DEBUG_
chomp $line;
my $error = '';
my @val = splitDelimited( $line );
print STDERR "\...@val <", join('|',@val), ">\n"; # _DEBUG_
my $num = scalar(@$aHeader);
print STDERR "\$num <", $num, ">\n"; # _DEBUG_
my %entry;
for( my $idx = 0; $idx < $num; ++$idx ){
my( $fieldDsc, $fieldId, $dataType ) = ( $aHeader->[$idx] );
if( ref($fieldDsc) ){
$fieldId = $fieldDsc->{fieldId};
$dataType = $fieldDsc->{dataType};
}else{
$fieldId = $fieldDsc;
$dataType = getFieldInfo( $ctrl, $form, 'dataType', -id
=> $fieldId );
}
$dataType = lc($dataType);
$dataType =~ s/_//g;
# print "$fieldId: $dataType\n";
if( $dataType eq 'char' || $dataType eq 'diary' ){
# print "\$val[\$idx] <$val[$idx]>\n" if $fieldId ==
536870918; # _DEBUG_
if( defined $val[$idx] ){
$val[$idx] =~ s/\\\\/\\/g;
$val[$idx] =~ s/\\r//g;
$val[$idx] =~ s/\\n/\n/g;
$val[$idx] =~ s/\\"/"/g;
}
}elsif( $dataType eq 'attach' ){
$val[$idx] = parseAttachDsc( $val[$idx], \$error, $hOpt
);
}elsif( $dataType eq 'currency' ){
$val[$idx] = parseCurrencyDsc( $val[$idx], \$error );
}
print "$fieldId: type = $dataType, size = ",
length($val[$idx]);
print ", val = $val[$idx]" unless lc($dataType) =~
/^(?:char|diary)/;
print "\n";
next if !defined $val[$idx] || $val[$idx] eq '';
$entry{$fieldId} = $val[$idx];
}
if( $error ){
errorHandler( $error, \%entry );
return undef;
}
return \%entry;
}
sub parseAttachDsc {
my( $attachDsc, $sError, $hOpt ) = @_;
return undef if ! $attachDsc;
my $hAttach;
if( $attachDsc =~ /^(\d+)\s+(.*)/ ){
my( $num, $file ) = ( $1, $2 );
if( $num == 1 ){
$file = $hOpt->{-arxFileDir} . $file if
$hOpt->{-arxFileDir};
if( ! -f $file ){
$$sError .= qq/Attachment file "$file" doesn't
exist.\n/;
return $hAttach;
}
my $name = $file;
$name =~ s|.*[\\/]||;
$name =~ s/_\d+(?=$|\.\w+$)//;
# local $/ = undef;
# local *FILE;
# my $ret = open( FILE, $file );
# if( $ret ){
# binmode FILE;
# my $buffer = <FILE>;
# close FILE;
# $hAttach = {
# name => $name,
# size => length($buffer),
# buffer => $buffer,
# };
# }else{
# $$sError .= "Cannot open \"$file\": $!\n";
# }
$hAttach = {
name => $name,
size => (stat $file)[7],
file => $file,
};
}else{
$$sError .= "Invalid number '$1' in Attachment
descriptor.\n";
}
}else{
$$sError .= "Invalid Attachment descriptor: $attachDsc\n";
}
return $hAttach;
}
sub parseCurrencyDsc {
my( $currDsc, $sError ) = @_;
return undef if ! $currDsc;
my( $value, $currCode, $convDate, $num, @funcList ) = split /\004/,
$currDsc;
my $hVal = {
value => $value,
currencyCode => $currCode,
conversionDate => $convDate,
funcList => [],
};
my $num2 = 2 * $num - 1;
for( my $i = 0; $i < $num2; $i += 2 ){
( $value, $currCode ) = ( $funcList[$i], $funcList[$i+1] );
push @{$hVal->{funcList}}, { value => $value, currencyCode =>
$currCode };
}
# print STDERR "\$hVal <", recursivePrint($hVal), ">\n"; # _DEBUG_
return $hVal;
}
sub importLine {
my( $ctrl, $form, $line, $aHeader, $hOpt ) = @_;
# print "importLine( $ctrl, $form, $line, $aHeader, <", join('|',%$hOpt),
"> )\n"; # _DEBUG_
my $mergeType = $hOpt->{-mergeType} ? $hOpt->{-mergeType} :
$DEFAULT_MERGE_TYPE;
my $hEntry = parseLine( $ctrl, $form, $line, $aHeader, $hOpt );
if( $hEntry ){
$hEntry->{1} = $hOpt->{-entryId} if defined $hOpt->{-entryId};
reduceEntry( $hEntry, $hOpt->{-fields}, $ctrl, $form ) if
$hOpt->{-fields};
# $hOpt->{-filter} = [
# 7 => '^[02]$',
# 8 =>
'^(?:ARCHIV-STS:AbweichendeTicketAnschrift|ARCHIV-STS:Attachment|ARCHIV-STS:Benutzer|ARCHIV-STS:Benutzer_DELETE|ARCHIV-STS:Benutzer-Password-Filter|ARCHIV-STS:Benutzer-SQL-Password|ARCHIV-STS:CFG:Menues|ARCHIV-STS:CFG:Menues_DELETE|ARCHIV-STS:EB|ARCHIV-STS:IF:MONI-Auftragskorb|ARCHIV-STS:Ticket|ARCHIV-STS:Ticketstopuhren|ARCHIV-STS:Ticketstopuhren_Vorgang|ARCHIV-STS:Vorgang|BMW-AuftragsstatusMail|BMW-IN-Assigned|BMW-IN-NewInformation|BMW-IN-Storno|BMW-IN-Update|BMW-OUT-Assigned-Reply|BMW-SMTP-OUT|CONF_UPDATE-ContentMap|CONF_UPDATE-FieldMap|CONF_UPDATE-FormMap|DPO-Create|DPO-Create-B|DPO-Dispokorb|DPO-Dispokorb-B|DPO-GJ-Wechsel-DPO-Update|DPO-GJ-Wechsel-Update-Dispo|DPO-MODUS-Create|DPO-MODUS-Create-B|DPO-MODUS-Dispokorb|DPO-MODUS-Dispokorb-B|DPO-Status-Dispo-Update-ABEN|DPO-Status-Dispo-Update-ABEN-Aktion|DPO-Status-Dispo-Update-ABEN-Unterbrechung|DPO-Status-Dispo-Update-Aktion-ABEN-U|DPO-Status-Dispo-Update-DISP|DPO-Status-Dispo-Update-DOWN|DPO-Status-Dispo-Update-INIT|DPO-Status-Dispo-Update-NEWDUR|DPO-Status-Dispo-Update-SAP2|DPO-Status-Dispo-Update-SAP6|DPO-Status-Dispo-Update-TABE|DPO-Status-Dispo-Update-TABE-U-Aktion|DPO-Status-Dispo-Update-TABE-Unterbrechung|DPO-Status-Dispo-Update-TEOK|DPO-Status-Dispo-Update-TUZK|DPO-Status-Dispo-Update-TVOR|DPO-Status-Dispo-Update-TVOR-Aktion|DPO-Status-Dispo-Update-ZRUE|DPO-Status-Dispo-Update-ZRUE-nach-TABE-Grund|DPO-Storno|DPO-Storno-Dispokorb|DPO-Update-Beschreibung|DPO-Update-Beschreibung-Update-Auftrag|DPO-Update-KREK|DPO-Update-Status-ABEN|DPO-Update-Status-ABEN-Unterbrechung|DPO-Update-Status-DOWN|DPO-Update-Status-NEWDUR|DPO-Update-Status-TABE-Unterbrechung|DPO-Update-Status-TEOK|DPO-Update-Status-TUZK|DPO-Update-Status-TVOR|DPO-Update-Status-ZRUE|DPO-Update-Status-ZRUE-nach-TABE-Grund|DPO-Update-Vorgang-ABEN|DPO-Update-Vorgang-ABEN-U-aus-Dispo|DPO-Update-Vorgang-ABEN-Unterbrechung|DPO-Update-Vorgang-DOWN|DPO-Update-Vorgang-NEWDUR|DPO-Update-Vorgang-Status-INIT|DPO-Update-Vorgang-TABE|DPO-Update-Vorgang-TABE-Unterbrechung|DPO-Update-Vorgang-TEOK|DPO-Update-Vorgang-TUZK|DPO-Update-Vorgang-TVOR|DPO-Update-Vorgang-ZRUE|DPO-Update-Vorgang-ZRUE-nach-TABE-Grund|EB-ARCIS-1-Mat|EB-ARCIS-1-Zeit|EB-ARCIS-2-Mat|EB-ARCIS-2-Zeit|EB-Dienstleistung|EB-Material|EB-Material-Bestellung|EService-Create|EService-Create-Status|EService-StatusMail|EService-Update|GenMail-AuftragsstatusMail|GenMail-IN-Assigned|GenMail-IN-Storno|GenMail-IN-Update|GenMail-OUT|GenMail-OUT-Assigned-Err|GenMail-OUT-Assigned-Reply|GenMail-OUT-Refuse|GenMail-OUT-Storno-Err|GenMail-OUT-Storno-Reply|GenMail-OUT-Updated-Err|GenMail-OUT-Updated-Reply|HTML-Template|HTML-Template-TEST|HTS-Quittung|HTS-Störmeldung|HTS-Storno|ICTS-Auftragskorb-CIC|ICTS-Auftragskorb-RCC|ICTS-CTS-CLOSED-BLS|ICTS-CTS-CLOSED-CIC|ICTS-CTS-CLOSED-RCC|ICTS-CTS-ESCALATE-BLS|ICTS-CTS-ESCALATE-CIC|ICTS-CTS-ESCALATE-RCC|ICTS-CTS-REOPEN-BLS|ICTS-CTS-UPDATE-CIC-ESCALATE-POQU|ICTS-CTS-UPDATE-CIC-REOPEN-POQU|ICTS-CTS-UPDATE-CIC-RESOLVED|ICTS-CTS-UPDATE-CIC-VENDOR|ICTS-CTS-UPDATE-TIC|ICTS-ORDER-ASSIGNED-CIC|ICTS-ORDER-CLOSED-CANCELD-BLS|ICTS-ORDER-CLOSED-FIXED-BLS|ICTS-ORDER-CLOSED-FIXED-BLS_Störung|ICTS-ORDER-CONTENT-CIC|ICTS-ORDER-CREATE-CIC|IF_INFO|INTERFACE-STS:CFG:Menues|INTERFACE-STS:CFG:Menues_DELETE|KOREK-DPO-Status-ABEN|KOREK-DPO-Update-Vorgang-ABEN|KOREK-EB-Dienstleistung-ARCH|KOREK-EB-Dienstleistung-PROD|KOREK-EB-DL-ARCH-ARCIS|KOREK-EB-DL-PROD-ARCIS|KOREK-EB-MAT-ARCH-ARCIS|KOREK-EB-Material-ARCH|KOREK-EB-Material-PROD|KOREK-EB-MAT-PROD-ARCIS|KOREK-MONI-Aktion-Ticket-E-ARCHIV|KOREK-MONI-Aktion-Ticket-1-ARCHIV|KOREK-MONI-Aktion-Ticket-1-PROD|KOREK-MONI-Aktion-Vorgang-L-ARCHIV|KOREK-MONI-Aktion-Vorgang-L-PROD|KOREK-MONI-Auftragskorb-ARCHIV|KOREK-MONI-Auftragskorb-PROD|MAC-Create|MAC-Create-Aktion|MAC-Rückmeldung-mit-Best-Nr|MAC-Rückmeldung-ohne-Best-Nr|MAC-Rückmeldung-V11|MAC-Update|MAC-Update-Aktion|MAP_TEST-4|MONI-Aktion-Ticket|MONI-Aktion-Ticket-E|MONI-Aktion-Vorgang|MONI-Aktion-Vorgang-DPO-MODUS|MONI-Auftragskorb|MONI-Auftragskorb-E|PDA-Kundenbeleg-1|PDA-Kundenbeleg-2|PDA-Kundenbeleg-3|PDA-Stoerhistorie-openclosed|PDA-Stoerhistorie-openonly|PDA-Stoerhistorie-Test|SAP-Altdaten_Ticket|SAP-Altdaten_Ticket_CL|SMS-OUT-Freitext|SMS-OUT-1|SMS-OUT-2.1|SMS-OUT-2.2|Vorgang-MODUS-Storno|Vorgang-MODUS-Storno-Dispokorb|ZSMI-Modus|ZSMI-Rückmeldung|ZSMI-RückmeldungClose)$',
# ];
if( $hOpt->{-filter} ){
for( my $i = 0; $i < $#{$hOpt->{-filter}}; $i+=2 ){
my( $fieldId, $regex ) = (
$hOpt->{-filter}[$i], $hOpt->{-filter}[$i+1] );
return 1 unless $hEntry->{$fieldId} =~ /$regex/;
}
}
my( $ret, $errTxt ) = importEntry( $ctrl, $form, $hEntry,
$aHeader, $mergeType );
warn $errTxt, "\n" if $errTxt;
return $ret;
}else{
warn qq/Cannot import line $. of import file.\n/;
return 0;
}
}
#use ARSx::LibSQL;
#my $ctrlSQL = sql_Login( 'dbi:Oracle:host=arsys70;sid=AR70', 'aradmin70',
'ar#admin#' );
#
#sub convertKeys {
# my( $cSub, $hEntry ) = @_;
# my %entry;
# map {$entry{$cSub->($_)} = $hEntry->{$_}} keys %$hEntry;
# delete $entry{'C15'};
# return \%entry;
#}
sub importEntry {
my( $ctrl, $form, $hEntry, $aHeader, $mergeType ) = @_;
my $errTxt;
if( $hEntry->{102} && $hEntry->{102} =~ /\\\\/ ){ # Field ID 102 =
Password
$errTxt .= "WARNING <Entry $hEntry->{1}>: double backslash
replaced in password field.\n";
$hEntry->{102} =~ s/\\\\/\\/g;
}
# foreach my $key ( sort {$a <=> $b} keys %$hEntry ){ print "$key =>
$hEntry->{$key}\n"; }
my $ret = 0;
if( $mergeType eq 'C' ){
map {delete $hEntry->{$_}} qw/1 3 5 6 15/;
my $entryId = ars_CreateEntry( $ctrl, $form, %$hEntry );
$errTxt .= "ars_CreateEntry( $form ): $ars_errstr\n" if
$ars_errstr;
$ret = 1 if $entryId;
}elsif( $mergeType eq 'S' ){
$ret = ars_SetEntry( $ctrl, $form, $hEntry->{1}, 0, %$hEntry );
$errTxt .= "ars_SetEntry( $form, $hEntry->{1} ): $ars_errstr\n"
if $ars_errstr;
}else{
# print STDERR "----\n"; foreach( keys %$hEntry ){ print STDERR
"$_: $hEntry->{$_}\n"; }
$ret = ars_MergeEntry( $ctrl, $form, $mergeType, %$hEntry );
$errTxt .= "ars_MergeEntry( $form, $mergeType, $hEntry->{1} ):
$ars_errstr\n" if $ars_errstr;
## $hEntry = convertKeys( sub{'C'.$_[0];}, $hEntry );
## $ret = sql_MergeEntry( $ctrlSQL, "H882", $mergeType, ENTRYID =>
$hEntry->{'C1'} );
## $errTxt .= "sql_MergeEntry( H882, $mergeType, $hEntry->{1} ):
$sql_errstr\n" if $sql_errstr;
## $ret = sql_MergeEntry( $ctrlSQL, "T882", $mergeType, %$hEntry );
## $errTxt .= "sql_MergeEntry( T882, $mergeType, $hEntry->{1} ):
$sql_errstr\n" if $sql_errstr;
#
# $hEntry = convertKeys( sub{'C'.$_[0];}, $hEntry );
# $ret = sql_CreateEntry( $ctrlSQL, "H882", ENTRYID =>
$hEntry->{'C1'} );
# $errTxt .= "sql_MergeEntry( H882, $hEntry->{1} ):
$sql_errstr\n" if $sql_errstr;
# $ret = sql_CreateEntry( $ctrlSQL, "T882", %$hEntry );
# $errTxt .= "sql_MergeEntry( T882, $hEntry->{1} ):
$sql_errstr\n" if $sql_errstr;
}
return ( $ret, $errTxt );
}
#--- data source functions -----------------------------------------------------
sub importText {
my( $ctrl, $text, $aEntryIds, $hOpt ) = @_;
$text = $$text if ref($text);
my @lines = split( /\n/, $text );
*nextLine = *nextLine_ArrayRef;
return importFromDataSource( $ctrl, \...@lines, $aEntryIds, $hOpt );
}
sub nextLine_ArrayRef {
my( $aLines ) = @_;
return shift( @$aLines );
}
sub importFile {
my( $ctrl, $fh, $aEntryIds, $hOpt ) = @_;
if( ref($fh) ){ # $fh = filehandle
*nextLine = *nextLine_FileHandle;
return importFromDataSource( $ctrl, $fh, $aEntryIds, $hOpt );
}else{ # $fh = filename
my $file = $fh;
open( FILE, $file ) or die "Cannot open \"$file\": $!\n";
my @ret = importFile( $ctrl, \*FILE, $aEntryIds, $hOpt );
close FILE;
return @ret;
}
}
sub nextLine_FileHandle {
my( $fh ) = @_;
return <$fh>;
}
#-------------------------------------------------------------------------------
sub importFromDataSource {
my( $ctrl, $dataSource, $aEntryIdsIn, $hOpt ) = @_;
# print "importText( $aEntryIds, <", join('|',%$hOpt), "> )\n"; # _DEBUG_
my $form = $hOpt->{-form} ? $hOpt->{-form} : undef;
my $aHeader = [];
my( $ret, $numOK, $numErr, $lineNr, @errorLines, @entryIdsOut ) = ( 0,
0, 0, 0 );
# initBulkTransactionHandler( $ctrl, 1, 195 );
my $line;
while( defined($line = nextLine($dataSource)) ){
++$lineNr;
if( $line =~ /^\s*$/ || $line =~ /^#/ ){
next;
}elsif( $line =~ s/^DATA\s+// && defined $aHeader ){
$hOpt->{-entryId} = (defined $aEntryIdsIn)? (shift
@$aEntryIdsIn) : undef;
$ret = importLine( $ctrl, $form, $line, $aHeader, $hOpt
);
if( $ret ){
push @entryIdsOut, $ret;
++$numOK;
}else{
push @entryIdsOut, undef;
push @errorLines, $lineNr;
++$numErr;
}
}elsif( $line =~ s/^(FIELDS|DTYPES|FLD-ID)\s+// ){
parseHeaderLine( $1, $line, $aHeader );
}elsif( $line =~ s/^SCHEMA\s+// ){
if( ! $hOpt->{-form} ){ # ignore if form name passed
in $hOpt
$form = $line;
$form =~ s/^"//;
$form =~ s/"\s*$//;
print $form;
}
}elsif( $line =~ s/^SQL>\s*// ){
if( $line =~ /^connect\s+(\S+)\/(\S+)\@(\S+)/ ){
dbConnect( $3, $1, $2 );
}else{
my @lines = split /\s*;;\s*/, $line;
map {dbExecSQL($_)} @lines;
}
}elsif( $line =~ s/^CHAR-SET\s+// ){
# ignore
}else{
warn "Invalid line: $line\n";
}
# transactionIncr( $ctrl, $BT_RUN );
last if $hOpt->{-maxEntries} && $numOK >= $hOpt->{-maxEntries};
}
# transactionIncr( $ctrl, $BT_END );
return ( $numOK, $numErr, \...@errorlines, \...@entryidsout );
}
sub parseHeaderLine {
my( $tag, $line, $aHeader ) = @_;
chomp $line;
my @val = splitDelimited( $line );
my $num = scalar(@val);
for( my $i = 0; $i < $num; ++$i ){
$aHeader->[$i]{$HEADER_MAP{$tag}} = $val[$i];
}
return $aHeader;
}
sub errorHandler {
my( $errorText, $hEntry ) = @_;
warn "ERROR: ", $errorText;
}
sub reduceEntry {
my( $hEntry, $rspec, $ctrl, $form ) = @_;
my $hFilter;
if( ref($rspec) eq 'HASH' ){
$hFilter = $rspec;
}elsif( lc($rspec) eq 'form' ){
$hFilter = getFormFilter( $ctrl, $form );
}else{
die "Field ranges not implemented: $rspec\n";
}
foreach my $key ( keys %$hEntry ){
delete $hEntry->{$key} unless $hFilter->{$key} || $key == 1;
}
}
sub getFormFilter {
my( $ctrl, $form ) = @_;
if( ! $FILTER_CACHE{$form} ){
my %fieldTable = ars_GetFieldTable( $ctrl, $form );
die "ars_GetFieldTable($form): $ars_errstr" if $ars_errstr;
$FILTER_CACHE{$form} = { map {$_ => 1} values(%fieldTable) };
}
return $FILTER_CACHE{$form};
}
sub dbConnect {
my( $conn, $user, $passwd ) = @_;
$global_dbh = DBI->connect( $conn, $user, $passwd ) or do {
errorDialog( $DBI::errstr );
return undef;
};
$global_dbh->{LongTruncOk} = 1;
}
sub dbExecSQL {
my( $sqlStr ) = @_;
print "execSQL( $sqlStr )\n"; # _DEBUG_
my %sqlCache = ( _index => 0, _data => [] );
UTAN::UniTree::Database::Connection::selectRows( $global_dbh, $sqlStr,
undef, undef );
# UTAN::UniTree::Database::Connection::selectRows( $global_dbh, $sqlStr,
sub{
# my @row = map {defined($_) ? $_ : ''} @_;
# formatRowOutput( \...@row, \%sqlCache, {-rows => 20} );
# }, \%sqlCache );
}
sub splitDelimited {
my( $pkg, $line, $hOpt ) = @_;
my @ret;
my $val;
my( $blS, $blE ) = $hOpt->{-block} ? ($hOpt->{-block} =~ /^(.).*(.)$/)
: (undef,undef);
# print "-------------------\n";
while( length($line) ){
if( substr($line,0,1) eq '"' ){
( $val, $line ) = extract_delimited( $line, '"' );
last if defined($line) && !defined($val);
# print "<$val>\n";
unless( $hOpt->{-nostrip} ){
$val =~ s/^"//;
$val =~ s/"$//;
}
}elsif( defined($blS) && substr($line,0,1) eq $blS ){
( $val, $line ) = extract_bracketed( $line,
$hOpt->{-block} );
last if defined($line) && !defined($val);
unless( $hOpt->{-nostrip} ){
$val =~ s/^\Q$blS//;
$val =~ s/\Q$blE\E$//;
}
}elsif( $line =~ s/^'(.*)// ){
$val = $1;
}else{
$line =~ s/(\S+)//;
$val = $1;
}
push @ret, $val;
$line =~ s/.\s*//;
}
return @ret;
}
1;
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
attend wwrug10 www.wwrug.com ARSlist: "Where the Answers Are"