RE: accessing DBF file

2006-03-21 Thread Raymond Raj
>my $ref = $sth->fetchrow_arrayref(); >foreach my $row (@$ref) { may be you want use just like this while (my $row = $sth->fetchrow_arrayref() ) OR you can use 'fetchall_arrayref' instead of 'fetchrow_arrayref'. 'fetchrow_arrayref()' fetches the next row of data and returns a reference

accessing DBF file

2006-03-21 Thread Eko Budiharto
Hi, I have a DBF file and like to access it. I already write a script and got an error message, " "Can't use string ("01010005") as an ARRAY ref while "strict refs" in use at migr asi2.pl line 19.   and my script is: use strict; use DBI;   my ( $CUST, $NAMA, $AL, $AL2, $TLP, $PERSO, $NPWP,

Re: Extracting numbers from a string

2006-03-21 Thread $Bill Luebkert
Naresh Bajaj wrote: > Hello all, > I have one string PT2H46M7.815S. > It is in hours, minutes and seconds. I want to extract number between > the alphabets and > stored in seconds. How should I approach this problem. > Right now I am using the split command which is not much elegant way. > Crude m

Re: Extracting numbers from a string

2006-03-21 Thread Williamawalters
In a message dated 3/21/2006 9:10:13 P.M. Eastern Standard Time, [EMAIL PROTECTED] writes:   > Hello all,> I have one string PT2H46M7.815S.> It is in hours, minutes and seconds. I want to extract number between> the alphabets and> stored in seconds. How should I approach this problem.> Righ

RE: Extracting numbers from a string

2006-03-21 Thread Toby Stuart
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf > Of Naresh > Bajaj > Sent: Wednesday, 22 March 2006 12:29 PM > To: activeperl@listserv.ActiveState.com > Subject: Extracting numbers from a string > > > Hello all, > I have one string PT2H46M7.815S. > It

Re: Extracting numbers from a string

2006-03-21 Thread Ken Barker
How about using a regex if($string =~ /PT(\d+)H(\d+)M(\d+).(\d+)/){ $1=$hr; $2=$min; $3=$sec; $time = ($hr*3600)+($min*60)+$sec; } untested At 07:28 PM 3/21/2006, Naresh Bajaj wrote: Hello all, I have one string PT2H46M7.815S. It is in hours, minutes a

Extracting numbers from a string

2006-03-21 Thread Naresh Bajaj
Hello all, I have one string PT2H46M7.815S. It is in hours, minutes and seconds. I want to extract number between the alphabets and stored in seconds. How should I approach this problem. Right now I am using the split command which is not much elegant way. Crude method: extractinterval(PT7.815S) su

RE: exec broken?

2006-03-21 Thread Francis Paulin
Yes, this is what I expected exec to do, never return. system does work like I told in my previous email: this what I get (and notepad is actually launching): ret=, $?=0, $!=Bad file descriptor, $^E= -Original Message- From: $Bill Luebkert [mailto:[EMAIL PROTECTED] Sent: 21 mars

Re: exec broken?

2006-03-21 Thread $Bill Luebkert
Francis Paulin wrote: > Hi, > > If I try: > print(exec 'notepad'); > > It prints "0" to the console. I'm not sure if it's an error code or if > it is the return value of the program, if it's the return value, it's > the good one. > > But I got some qx instruction hanging only on my machine. So

RE: exec broken?

2006-03-21 Thread Francis Paulin
Hi, If I try: print(exec 'notepad'); It prints "0" to the console. I'm not sure if it's an error code or if it is the return value of the program, if it's the return value, it's the good one. But I got some qx instruction hanging only on my machine. So I'm starting to think that my machine got s

Re: exec broken?

2006-03-21 Thread $Bill Luebkert
Francis Paulin wrote: > Hi, > > I'm having a problem using exec perl function. > I run on Windows XP Pro SP2. > > This simple statement: exec 'notepad'; is not working on my machine > I tried it with ActivePerl 5.8.7 build 813. > I desinstall Perl, reboot, install ActivePerl 5.8.8 build 816. > T

RE: OLE/M$ Excel and finding sheets

2006-03-21 Thread Josh . Perlmutter
Mr Thurn- Thank you! it worked like a charm! -Josh "Thurn, Martin" <[EMAIL PROTECTED]> 03/21/2006 04:10 PM To <[EMAIL PROTECTED]> cc Subject RE: OLE/M$ Excel and finding sheets > it gets this error:Use of uninitialized value in pattern > match (m//) > at compinfo.pl line 234.

RE: renaming files in XP

2006-03-21 Thread Gerald Preston
David,   Thanks for the code.  I did try the Perl routine and was getting no where.  You code is giving me “Permission denied”.  The “read only” and “hidden” attributes are not set / active.    Now to figure out the attributes.   Thanks,   Jerry   From: Wagner, David ---

RE: renaming files in XP

2006-03-21 Thread Thurn, Martin
Your file names have spaces in them. The DOS rename command sees spaces and thinks you're sending it a *whole bunch* of arguments. You have to put double-quotes around your arguments when you drop the DOS command in backticks. - - Martin P.S. Please send ONLY PLAIN TEXT email to mailing lists.

RE: exec broken?

2006-03-21 Thread Francis Paulin
Already try them all... -Original Message- From: Thurn, Martin [mailto:[EMAIL PROTECTED] Sent: 21 mars 2006 16:45 To: Francis Paulin Subject: RE: exec broken? Try 'notepad.exe' Try giving it the full path to where notepad is - - Martin > -Original Message- > From: [EMAIL PROTE

RE: renaming files in XP

2006-03-21 Thread Thurn, Martin
DOS doesn't recognize FORWARDslash as a dir separator. When you use `backticks` it just sends the command to DOS. Therefore you have to use BACKslashes inside backticks. - - Martin P.S. Please send ONLY PLAIN TEXT email to mailing lists. From: [EMAIL P

exec broken?

2006-03-21 Thread Francis Paulin
Hi, I'm having a problem using exec perl function. I run on Windows XP Pro SP2. This simple statement: exec 'notepad'; is not working on my machine I tried it with ActivePerl 5.8.7 build 813. I desinstall Perl, reboot, install ActivePerl 5.8.8 build 816. Try the command again, it failed. I tried

RE: renaming files in XP

2006-03-21 Thread Bowie Bailey
Basil Daoust wrote: > Same kind of question: > if this works from a DOS command prompt in Windows XP: > C:\>rename \test2\filea fileb > C:\>ls \test2 > fileb > > why doesn't $x=`rename /test2/fileb filec`; > the $x = null or empty. > > the rename(old,new) did work. It even MOVED the file. What

RE: renaming files in XP

2006-03-21 Thread Gerald Preston
David,   Here is the code: #!/perl     use strict;     local( *FI, *FO );     my $DEBUG  = 00;   my $DEBUG1 = 01;   my $path   = "C:\\Documents and Settings\\Jerry\\My Documents\\My Music\\";   #  $path .= "NEW\\Easy Listing\\Harry Connick Jr\\" ;   $path .= "NEW\\Country\\Reb

RE: renaming files in XP

2006-03-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
    you might change: my $p = `rename $old_name $new_name`;     to next if ( rename($old_name, $new_name) ) ;    # implies successful rename     print "Error: " , $! , "\n"; printf "OldFile: %s\nNewFile: %s\n",     $old_name,     $new_name;   

Re: renaming files in XP

2006-03-21 Thread Basil Daoust
Same kind of question: if this works from a DOS command prompt in Windows XP: C:\>rename \test2\filea fileb C:\>ls \test2 fileb why doesn't $x=`rename /test2/fileb filec`; the $x = null or empty. the rename(old,new) did work.  It even MOVED the file. Basil___

RE: renaming files in XP

2006-03-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
    Without seeing code, the list will be guessing. As fully as you defined the setup for the writing of the file, then you will need to qualify that much to do the rename.       What does the error say? ( ie, if ( ! rename(old,new) ) { print $! } )   Wags ;) ps a code snippet portion i

Re: OLE/M$ Excel and finding sheets

2006-03-21 Thread Josh . Perlmutter
Mr Rickards et al- I checked the server shortly after to notice that between norton anti-virus and some other things others were running it was 99% cpu usage. running the script again when that dropped to a more reasonable level, the excel resource error was NOT encountered as it moved from the

renaming files in XP

2006-03-21 Thread Gerald Preston
Hi!   I am using version 5.8.7 on XP Pro.  I am trying a very simple thing, that is I am trying to rename a file “rename $old_name, $new_name”.  I know this a not biggie but what am I doing wrong.   I am not local directory that I am changing the file, is this the problem?   Thanks,

Re: OLE/M$ Excel and finding sheets

2006-03-21 Thread Josh . Perlmutter
Mr RIckards et al- Thank you. that has helped a LOT. there's 2 issues left. one is a PERL issue I'm not sure how to deal with, the other is an OLE/Excel one in which excel is left up with an error message saying "not enough resources to display" after bringing the workbook up for the second tim

RE: OLE/M$ Excel and finding sheets

2006-03-21 Thread Brian Raven
Lynn. Rickards <> wrote: > [EMAIL PROTECTED] wrote: >> Mr. Rickards, MR. Raven et al- >> >> I still get some errors and i'm not sure why on the OLE ones. It is >> not saving/closing on either version, operating on previously >> existing nore building new. > > I'm going to try and go thru the bugh