Re: problem getting multiple values returned from a subroutine

2011-02-02 Thread loan tran
Thank you Rob, Uri and John for your replies. I've learned great things from them. Thank to your pointers, my script is working properly. --- On Wed, 2/2/11, John Delacour wrote: > From: John Delacour > Subject: Re: problem getting multiple values returned from a subroutine >

Re: problem getting multiple values returned from a subroutine

2011-02-01 Thread loan tran
--- On Tue, 2/1/11, Uri Guttman wrote: > From: Uri Guttman > Subject: Re: problem getting multiple values returned from a subroutine > To: "loan tran" > Cc: beginners@perl.org > Date: Tuesday, February 1, 2011, 10:59 AM > >>>>> "lt" ==

problem getting multiple values returned from a subroutine

2011-02-01 Thread loan tran
I'm having problem getting multiple values returned from a subroutine. Thanks in advance for pointers. My codes: #!/usr/bin/perl use strict; use warnings; # Get required subroutines which need to be included.

Re: parse data from a report file

2011-01-27 Thread loan tran
John and Rob, Thanks a lot for the pointers. Very helpfull. --- On Thu, 1/27/11, Rob Dixon wrote: > From: Rob Dixon > Subject: Re: parse data from a report file > To: beginners@perl.org > Cc: "loan tran" > Date: Thursday, January 27, 2011, 11:33 AM > On 27/01/2

parse data from a report file

2011-01-26 Thread loan tran
Hi All, I'm trying to parse data from a report file and I'm having trouble producing desired results. Here is a data example from the report: PONumber Line InvoicedQty UnitCost Amount Curr Extended Amount FrDate Company Department Account ItemNum ItemDescription -

Re: Critcize my scripts.

2005-06-24 Thread loan tran
Thank you John and Wiggins for your time and feedbacks. Loan --- "John W. Krahn" <[EMAIL PROTECTED]> wrote: > loan tran wrote: > > Please critize my scripts and suggest better ways > to > > accomplish the same task. > > > > (I know it's a g

Critcize my scripts.

2005-06-22 Thread loan tran
Please critize my scripts and suggest better ways to accomplish the same task. (I know it's a good practice to put use strict in Perl script but I'm struggling to make my scripts work with use strict.The script below work fine if I comment out use strict.) [EMAIL PROTECTED] /home/sybase/scripts/

run Perl /shell script directly from web browser?

2005-02-10 Thread loan tran
Is it possible to exec a unix Perl or Shell script directly from a web browser? Note that a web server locates on PC Window NT and the Perl or shell script locate on AIX Unix server. Does anyone know of a way to accomplish this? Thanks. __ Do

Re: Can do in 1 while loop?

2004-10-11 Thread loan tran
--- Ramprasad A Padmanabhan <[EMAIL PROTECTED]> wrote: > On Mon, 2004-10-11 at 06:26, loan tran wrote: > > Hello Perl Gurus, > > > > I wrote a script to search for log suspends and > > bloking processes in a text file and send me email > if > > it fi

Can do in 1 while loop?

2004-10-10 Thread loan tran
Hello Perl Gurus, I wrote a script to search for log suspends and bloking processes in a text file and send me email if it find either of them. My codes below work but it's not efficent. As you can see I open the file and go to while loop twice. Can someone suggest a better way? Thanks. (attached

get last record in a file

2004-08-25 Thread loan tran
I would like to know if there is any way to process a file using perl to get rid of extra records based on a key value. My key is the 1st field and in my output file I only want 1 record per key and it has to be the last record in the file. So for example here is my file: 1 5 4 1 0 2 1 2 2

Env, crontab, perl script

2003-07-29 Thread loan tran
ql) || die &errormsg("$0","Cannot prepare $sql", "Warning\n$!\n"); #$sth->execute || die print "$sql\n$!\n"; $sth->execute || die &errormsg("$0","Cannot execute $sql", "Warning\n$!\n"); } * belo

How to check if the job is failure or successful in sub1 before calling sub2

2003-07-25 Thread loan tran
Hello all, Can somebody throw some light on this. 1. How to capture errors from the output running a perl script. 2. How to check if the job is failure or successful in sub1 before calling sub2. Thanks __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use

RE: good text editor

2002-10-23 Thread loan tran
EditPlus is good. --- Nikola Janceski <[EMAIL PROTECTED]> wrote: > nedit is good, www.nedit.org, but you need some > third party stuff to make it > run on windows, there is lots on the website to > explain how to install/run > on windows. > > > -Original Message- > > From: Mariusz [mailto

Re: how to check if a dir exists if not create it?

2002-10-10 Thread loan tran
Thank you all for your reply. I greatly appreciate your help. Loan --- Steve Grazzini <[EMAIL PROTECTED]> wrote: > Loan Tran <[EMAIL PROTECTED]> wrote: > > mkdir ("/storage/systbl/") || die "$!\n"; > > > > The code above does not check i

how to check if a dir exists if not create it?

2002-10-10 Thread loan tran
mkdir ("/storage/systbl/") || die "$!\n"; The code above does not check if the dir exist. Can you modify it please. Thanks. Loan __ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com -- To unsubscribe, e-mail: [EMAIL P

can my code be shortened?

2002-09-24 Thread loan tran
Hi, I codes in the while loop is too long. Can it be written in different way? Thanks. sub display_helpdb{ my $server = $_[0]; my @results; &sybase_connect("$server","master","sp_helpdb"); $dbh->dbsqlexec; $dbh->dbresults; @tbl_header = ("DB Name", "DB Size", "Owner", "DBID", "Create

perl and DB connectivities

2002-09-23 Thread loan tran
Howdy, Does someone know if there is a function in sybperl (use Sybase::DBlib) which does exactly the same thing of: $data = $sth->fetchrow_hashref (use DBI). In order words, when using DBI, i can extract data from Sybase using this $sql = qq(select name,dbid from sysdatabases); while(my $data

RE: Can my code be shortened?

2002-09-12 Thread loan tran
It works perfectly. Thanks mucho. --- Kirby_Sarah <[EMAIL PROTECTED]> wrote: > I didn't test it, but this should work, right? > > -Original Message----- > From: loan tran [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 4:02 PM > To: [EMAIL PROT

Can my code be shortened?

2002-09-12 Thread loan tran
#!/usr/bin/perl -w @col_header = ('Sybase Server','Function','Type','Unix Machine','Location'); my $num_col_header = @col_header ; $td0= join(' ', @col_header[0..($num_col_header -1)]); $td= ''."$td0".''; print "$td"; # out put: Sybase Server Function Type Unix Machine Locatio n Please

Re: sendmail problem

2002-08-01 Thread loan tran
") or die "Cannot fork for send mail: $! \n"; print SENDMAIL<<"EOF"; From: ltran\@my To: you\@yourhost cc: myboss\@my Subject: Report Howdy, I'm sending you bla bla EOF while (){ print SENDMAIL $_; } close MAILFILE; close(SENDMAIL) or warn &qu

sendmail problem

2002-08-01 Thread loan tran
Howdy, 1. Can a variable store a text file with 4+ bytes in size? 2. How can I cc or send a message to 2 persons at the same time using sendmail? 3. Could someone please suggest a better way than mine to send a content of a text file using sendmail. Below is part of my script. The problem i

store message in a variable and use sendmail

2002-07-31 Thread loan tran
I store a messages(4 pages in text) in a variabe and use sendmail to send it. The mail messages get chopped of but I'm not sure why. Can you suggest a better way to send a content of a text file using sendmail. Thanks in advance. Below is part of my script: foreach $eachowner(@ownerlist){

empty a dir

2002-07-30 Thread loan tran
Is there a better way to do this in perl: $reportdir = '/sybase/dba/scripts/dbuser_report'; `rm -r $reportdir/*`; __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED]

problem with count record and while loop

2002-07-30 Thread loan tran
Hi everyone, Could you point out what is wrong the count and the while loop below? Here is part of the script: $sql_alias = qq( select aliasName = l.name from master..syslogins l, $eachdb..sysusers u, $eachdb..sysalternates a where a.suid = l.suid and a.altsuid = u.

Re: I want it skips to the line where it stopped.

2002-05-18 Thread loan tran
Thanks very much. Loan --- drieux <[EMAIL PROTECTED]> wrote: > > On Saturday, May 18, 2002, at 10:11 , loan tran > wrote: > [..] > > I still seem can not figure out the answer for > > question #2 by myself. Can you please help? > > Thanks. > > the only

Re: I want it skips to the line where it stopped.

2002-05-18 Thread loan tran
Thanks very much Dieux for the illustrations. It's the answer for question #1. I still seem can not figure out the answer for question #2 by myself. Can you please help? Thanks. --- drieux <[EMAIL PROTECTED]> wrote: > > On Friday, May 17, 2002, at 03:18 , loan tran wrote: &g

I want it skips to the line where it stopped.

2002-05-17 Thread loan tran
input. Loan Tran - #!/usr/bin/perl # usage: search_error.pl errorlog_file open (FILE,"errorlog_file") || die "cannot open file errorlog_file"; for(;;){ while(){ if ($_ =~ /Error: 21||timeslice|Error: LOG FULL|Error: SPAC

How to compress a file using PERL?

2002-04-09 Thread loan tran
Hello all, What's good way to compress a file using PERL? Thanks in advance. LT __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

RE: Can Unlink Remove Tar and Zip files?

2002-04-05 Thread loan tran
t; removed. I'm assuming > that what you wanted to do was skip . and .. If > that is the case, then try > something more like this: > > next if $file =~ /^\.{1,2}$/; > > -Original Message- > From: loan tran > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECT

Re: Can Unlink Remove Tar and Zip files?

2002-04-05 Thread loan tran
nt; printf "Files deleted: %5d\n", $cnt - $cnt2; printf "After delete : %5d\n", $cnt2; closedir DIR; --- drieux <[EMAIL PROTECTED]> wrote: > > On Friday, April 5, 2002, at 05:14 , loan tran > wrote: > [..] > > I want to remov

Can Unlink Remove Tar and Zip files?

2002-04-05 Thread loan tran
Hello, In my perl script I use "unlink" to remove files which are older than a given hours. After I ran the script, I saw all the files were removed except tar and zip files. Why unlink does not remove *.tar and *.Z files? I want to remove *.tar and *.Z file too. Any suggestions? Thank you in