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
>
--- 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" ==
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.
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
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
-
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
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/
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
--- 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
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
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
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
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
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
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
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
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
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
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
#!/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
") 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
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
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){
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]
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.
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
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
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
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
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
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
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
32 matches
Mail list logo