Edward Wijaya wrote:
Hi,
Hello,
Is there any efficient way to do that?
if ( @array ) {
print [EMAIL PROTECTED] has elements.\n;
}
else {
print [EMAIL PROTECTED] is empty.\n;
}
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
I am writing a script to relocate some tar files in a folder.
Since those tar files are scheduled to be written daily,
I want to make sure I'm not moving any files which are being
written by other programs...
How can I do so?
Thanks a lot
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Shu Hung wrote:
I am writing a script to relocate some tar files in a folder.
Since those tar files are scheduled to be written daily, I want to
make sure I'm not moving any files which are being written by other
programs...
How can I do so?
You can lock them.
perldoc -f flock
perldoc -q
-Original Message-
From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED]
Sent: Friday, August 06, 2004 10:49 AM
To: [EMAIL PROTECTED]
Subject: Re: How to avoid writing files that is used by other
programs?
Shu Hung wrote:
I am writing a script to relocate some tar files in a
Hi,
I would like to know which of this
is better and what is the pro and cons:
1. A file mysub.pl which stored
a subroutine, and later called by
main file using: do mysub.pl
or
2. A file mysub.pm and called
in main file using : use mysub.pm
Thanks so much for your time
Regards,
Edward WIJAYA
Nyimi Jose ) wrote:
Gunnar Hjalmarsson wrote:
Shu Hung wrote:
I am writing a script to relocate some tar files in a folder.
Since those tar files are scheduled to be written daily, I want
to make sure I'm not moving any files which are being written
by other programs...
How can I do so?
You can
On Aug 5, Jose Alves de Castro said:
sub trim($), for instance, means that trim will work on a scalar.
It means that trim() expects ONE argument and will enforce scalar context
on it. trim($foo) and trim(@bar) both work.
This is useful to, instead of something such as
trim($var)
use
On Aug 4, Perl said:
die You must enter an argument. \n if $#ARGV 0;
I'd suggest using:
die ... if @ARGV == 0;
because it's easier to read and understand.
$logfile = chomp ($ARGV);
Is that really your code? That doesn't make any sense to me. I think you
meant:
$logfile = $ARGV[0];
Edward Wijaya wrote:
Hi,
I would like to know which of this
is better and what is the pro and cons:
1. A file mysub.pl which stored
a subroutine, and later called by
main file using: do mysub.pl
or
2. A file mysub.pm and called
in main file using : use mysub.pm
The second
-Original Message-
From: Chris Mortimore [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 05, 2004 5:19 PM
To: [EMAIL PROTECTED]
Subject: Sorting an array of hashes
I want to sort an AoH. Not each hash by its keys, but the array by the
value of one of the keys in each hash. I know how
Jose Nyimi wrote:
I made a copy-paste of your above code, added the following to call f():
package main;
My::Class::f();
And got the error message below:
Global symbol $s requires explicit package name at try.pl line 31.
Execution of try.pl aborted due to compilation errors.
Which
Mark Cohen [EMAIL PROTECTED] wrote:
: Hello Charles,
: I don't understand why you are getting differnet
: results. I checked approximatley 1000 records
: containing different floating points and it seems
: that the result is similar to the results I'm
: getting from SAS but I'll try to understand
Hi,
Is there anyway in Perl to create
hash with multiple key for an array?
The purpose is as follows.
For example these lines:
AGCAG,AGCCG,AGCCGGGCG,AGCCAGGAG 15.188721875540
AGCGGAGCG,AGCCGAGGG,AGCGGAGGG 16.163408331891
\_/ \_/
Edward Wijaya wrote:
Is there anyway in Perl to create hash with multiple key for an
array?
Yes.
my %HoA = ( key1 = [ @array1 ] );
$HoA{key2} = $HoA{key1};
The purpose is as follows.
For example these lines:
AGCAG,AGCCG,AGCCGGGCG,AGCCAGGAG 15.188721875540
Hello all. I am trying to use bind_param to create a list of values in the form of an
array. Then I want to query the data base using a basic sql statement where each value
in my list (array) will be sent to the DBI in order to return a value. I am getting
and error that says can't call method
-Original Message-
From: jason corbett [mailto:[EMAIL PROTECTED]
Sent: Friday, August 06, 2004 5:44 PM
To: perl beginners
Subject: Using binding in order to pass values to a sql statement.
Hello all. I am trying to use bind_param to create a list of
values in the form of an
Hello all. I am trying to use bind_param to create a list of values in
the form of an array. Then I want to query the data base using a basic
sql statement where each value in my list (array) will be sent to the
DBI in order to return a value. I am getting and error that says can't
call method
-Original Message-
From: Wiggins d Anconia [mailto:[EMAIL PROTECTED]
Sent: Friday, August 06, 2004 6:09 PM
To: jason corbett; perl beginners
Subject: Re: Using binding in order to pass values to a sql statement.
Hello all. I am trying to use bind_param to create a list
Hi,
I am trying to substitute TR for TC.
But I do not want words like AUDIT TRAIL to be substituted.
So my regexp is:
if( =~ / TR / ) {
s/TR/TC/g
}
But this is not exactly working.
As i want only those instances when TR is surrounded by spaces ie not part
of any other word to be substituted.
Radhika Sambamurti wrote:
I am trying to substitute TR for TC.
But I do not want words like AUDIT TRAIL to be substituted.
So my regexp is:
if( =~ / TR / ) {
s/TR/TC/g
}
But this is not exactly working.
You probably want to use the word boundary assertion:
s/\bTR\b/TC/g;
See perldoc perlre.
--
You probably want to use the word boundary assertion:
s/\bTR\b/TC/g;
See perldoc perlre.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Thanks! This worked.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
is there a way to iterate over the fields of a Class::Struct (in the order
they were declared)?
something like:
foreach my $i (@{my_struct-fields()}) {
print $i = my_struct-value($i)\n;
}
yeah i know its a long shot, but perl sometimes does things for me that i
never would have
Thanks so much for your reply Gunnar,
The purpose is as follows.
For example these lines:
AGCAG,AGCCG,AGCCGGGCG,AGCCAGGAG 15.188721875540
AGCGGAGCG,AGCCGAGGG,AGCGGAGGG 16.163408331891
\_/ \_/
@Array1
23 matches
Mail list logo