Andreas Moroder wrote:
Hello,
Hello,
I have two arrays with strings and I have to find out the differences
between this arrays. Is a perl function available that does this ?
perldoc -q "How do I compute the difference of two arrays"
John
--
Perl isn't a toolbox, but a small machine shop
Andreas Moroder 写道:
Hello,
I have two arrays with strings and I have to find out the differences
between this arrays. Is a perl function available that does this ?
Hello,
You may try this module:
http://search.cpan.org/~typester/Array-Diff-0.04/lib/Array/Diff.pm
--
To unsubscribe, e-mail:
Hello,
I have two arrays with strings and I have to find out the differences
between this arrays. Is a perl function available that does this ?
Thanks
andreas
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Thank You It worked fine
-Anand
"Mumia W." <[EMAIL PROTECTED]> wrote:
On 06/20/2007 02:07 AM, anand kumar wrote:
> Please guide me with some code or documentation for the following problem :-
>
> I need to set some specific time for a command to execute. [...]
>
The "alarm" function mig
On 6/20/07, Ravi Malghan <[EMAIL PROTECTED]> wrote:
Hi: I have a script which runs fine when I run it from the shell prompt. My
LD_LIBRARY_PATH in the shell is as shown below
Somebody told me that if you have to set LD_LIBRARY_PATH and you're
not testing libraries, that means that your ld need
I had to set the LD_LIBRARY_PATH in the cron as following
0,5,10,15,20,25,30,35,40,45,50,55 * * * *
LD_LIBRARY_PATH=/export/home/netcool/oracle/instantclient_10_2:/usr/arsapi/lib:/usr/local/lib
/exp
ort/home/netcool/lookForNewRequests.pl
- Original Message
From: Ravi Malghan <[EMAIL PR
Hi: I have a script which runs fine when I run it from the shell prompt. My
LD_LIBRARY_PATH in the shell is as shown below
bash-2.05$ env |grep LD_LIBRARY_PATH
LD_LIBRARY_PATH=/export/home/netcool/oracle/instantclient_10_2:/usr/arsapi/lib:/usr/local/lib
But the same script when I run from cronta
On 6/20/07, John W. Krahn <[EMAIL PROTECTED]> wrote:
Steve Pittman wrote:
snip
man nohup
John
Rather than doing a Perl fix, I think you can detach the 'screen' and
reattach it later, so the script doesn't see anything happening.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional c
Chas Owens wrote:
On 6/20/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
snip
This might not be necessary for the RDMS you use, but I generally end
my database-driven scripts with this block:
END {
if ($?) {
print "Exiting with error, rolling back data!\n";
$dbh->rollback();
}
Chas Owens wrote:
On 6/20/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
snip
This might not be necessary for the RDMS you use, but I generally end
my database-driven scripts with this block:
END {
if ($?) {
print "Exiting with error, rolling back data!\n";
$dbh->rollback();
}
Steve Pittman wrote:
I have a perl script that I want to leave running after I close my terminal
session...it's a tcpip listener...
When i run the job in background mode and exit the term session...it terminates
Any thoughts?thanks in advance..Steve!
$ killMsgRcv.pl 9997
[Server killMsgRc
I have a perl script that I want to leave running after I close my terminal
session...it's a tcpip listener...
When i run the job in background mode and exit the term session...it terminates
Any thoughts?thanks in advance..Steve!
$ killMsgRcv.pl 9997
[Server killMsgRcv.pl accepting clients]
Check the bugs on Email::MIME.
IIRC there's an error when the response is '' which is legal but not
handled by the code.
I submitted a bug a couple of years ago and I don't believe it's been
fixed.
I found MIME::Tools to be the absolute best in parsing MIME content
in it's ability to giv
On 6/20/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
snip
This might not be necessary for the RDMS you use, but I generally end
my database-driven scripts with this block:
END {
if ($?) {
print "Exiting with error, rolling back data!\n";
$dbh->rollback();
} else {
prin
On Jun 20, 2:23 pm, [EMAIL PROTECTED] (Aruna Goke) wrote:
> Can someone put me thru this?
>
> when I run the script..it bring no error..
That's because you never asked it to give you any errors. That's
something of a Perl trait - it generally doesn't tell you anything's
wrong unless you ask it to
On 6/20/07, Aruna Goke <[EMAIL PROTECTED]> wrote:
snip
$sth->execute($x[2], $x[5], $x[4], $x[6]);
snip
I would also change this line to
$sth->execute(@x[2,5,4,6]);
But that is just because I am lazy.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTE
On 6/20/07, Boyle, Christopher <[EMAIL PROTECTED]> wrote:
Dumb question, does mysql need an explicit commit?
The DBI does a commit after every statement unless you pass AutoCommit
=> 0 during the connect call.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On 6/20/07, Aruna Goke <[EMAIL PROTECTED]> wrote:
snip
$dbh = DBI->connect($data_source, $user, $pass);
snip
change this line to
$dbh = DBI->connect(
$data_source,
$user,
$pass
{
RaiseError => 1
}
);
And the code will raise an error telling you what is wrong with the
SQL
Dumb question, does mysql need an explicit commit?
-Original Message-
From: Aruna Goke [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 20, 2007 2:23 PM
To: beginners@perl.org; [EMAIL PROTECTED]
Subject: the Database is not updated
Can someone put me thru this?
when I run the script..it
hi all,
Can someone put me thru this?
when I run the script..it bring no error.. however, the table radacct is
not updated.
what have i done wrong.
Goksie
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
my ($fn, @x);
#define the file
$fn = 'lost.csv';
$/ = "\n";
#prepare a database conn
Can someone put me thru this?
when I run the script..it bring no error.. however, the table radacct is
not updated.
what have i done wrong.
Goksie
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
my ($fn, @x);
#define the file
$fn = 'lost.csv';
$/ = "\n";
#prepare a database connection
On 06/20/2007 08:40 AM, yitzle wrote:
I took down the firewall and got the same results.
Could not fetch authors/id/K/KA/KASEI/Crypt-Simple-0.06.tar.gz
Giving up on
'/home/Admin/.cpan/sources/authors/id/K/KA/KASEI/Crypt-Simple-0.06.tar.gz'
Note: Current database in memory was generated on Sat,
On 6/20/07, oryann9 <[EMAIL PROTECTED]> wrote:
snip
Also noticed I could use binary & and |
$ perl -le 'print "hello" & "X";'
[EMAIL PROTECTED]
$ perl -le 'print "hello" | "X";'
x}||⌂
but these were not decrypted. Why not?
There is a reason I used xor (grin). The other operators do
Hi,
Hope this is what you are expecting.
#!/usr/bin/perl -w
($old_header,$old_atoms,$old_bonds) = mol2_read('prabu');
print "@{$old_header} \n @{$old_atoms} \n @{$old_bonds}";
sub mol2_read {
@mol2_header = ('prabu1','prabu12');
@mol2_atoms = ('prabu2');
@mol2_bonds = ('pr
Hi,
Hope this is what you are expecting.
#!/usr/bin/perl -w
($old_header,$old_atoms,$old_bonds) = mol2_read('prabu');
print "@{$old_header} \n @{$old_atoms} \n @{$old_bonds}";
sub mol2_read {
@mol2_header = ('prabu1','prabu12');
@mol2_atoms = ('prabu2');
@mol2_bonds = ('pr
Hi,
Hope this is what you are expecting.
#!/usr/bin/perl -w
($old_header,$old_atoms,$old_bonds) = mol2_read('prabu');
print "@{$old_header} \n @{$old_atoms} \n @{$old_bonds}";
sub mol2_read {
@mol2_header = ('prabu1','prabu12');
@mol2_atoms = ('prabu2');
@mol2_bonds = ('pr
On 6/20/07, oryann9 <[EMAIL PROTECTED]> wrote:
snip
> > my $plaintext = do { local $/ = undef; <> };
> > my $pad = "X" x length $plaintext;
> >
> > my $encryptedtext = $plaintext ^ $pad;
snip
I like it to, but dont understand how it is
encrypting.
Will you kindly expalin?
$plaintext is t
> >
> > > > #!/usr/bin/perl
> > > >
> > > > use strict;
> > > > use warnings;
> > > >
> > > > my $plaintext = do { local $/ = undef; <> };
> > > > my $pad = "X" x length $plaintext;
> > > >
> > > > my $encryptedtext = $plaintext ^ $pad;
> > > > my $decryptedtext = $encryptedtext ^ $pad;
> >
--- oryann9 <[EMAIL PROTECTED]> wrote:
>
> > > #!/usr/bin/perl
> > >
> > > use strict;
> > > use warnings;
> > >
> > > my $plaintext = do { local $/ = undef; <> };
> > > my $pad = "X" x length $plaintext;
> > >
> > > my $encryptedtext = $plaintext ^ $pad;
> > > my $decryptedtext = $encrypte
> > #!/usr/bin/perl
> >
> > use strict;
> > use warnings;
> >
> > my $plaintext = do { local $/ = undef; <> };
> > my $pad = "X" x length $plaintext;
> >
> > my $encryptedtext = $plaintext ^ $pad;
> > my $decryptedtext = $encryptedtext ^ $pad;
> > print
>
"plaintext:\n$plaintext\n\nencrypted
On 6/20/07, yitzle <[EMAIL PROTECTED]> wrote:
> Without more information about why you want to encrypt something we
> can give no good advice; so here's some bad advice
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> my $plaintext = do { local $/ = undef; <> };
> my $pad = "X" x length $p
Rob Dixon wrote:
> Mathew Snyder wrote:
>> It looks like an object is what I want. Am I correct? Suppose I need
>> to work
>> with a bit of data that actually has 11 attributes. This would be an
>> object of
>> another type. However, I need to manipulate pieces of it
>> differently. So I'm
>>
> "Matt" == Matt <[EMAIL PROTECTED]> writes:
Matt> #!/usr/bin/perl
use File::Finder; # in the CPAN
Matt> $cuid = "aef";
Matt> $directory = "EOM033107";
Matt> $smallcuid = lc $cuid;
my @result = File::Finder->type('f')->name(qr/^DATA.*\.zip\z/)->in(
'/home/ftpuser/'.$smallcuid.'/flexvaul
Without more information about why you want to encrypt something we
can give no good advice; so here's some bad advice
#!/usr/bin/perl
use strict;
use warnings;
my $plaintext = do { local $/ = undef; <> };
my $pad = "X" x length $plaintext;
my $encryptedtext = $plaintext ^ $pad;
my $decry
On 6/20/07, Tony marquis <[EMAIL PROTECTED]> wrote:
I'm trying to read the body and the attachment in a mime message. I keep
getting the folling error.
Use of uninitialized value in pattern match (m//) at
/usr/share/perl5/Email/MIME/ContentType.pm line 24.
That means that at or near line 24 o
On 6/20/07, yitzle <[EMAIL PROTECTED]> wrote:
I tried to install Crypt::Simple using the CPAN shell
Can you install other modules using the CPAN shell?
Can you install this module without the CPAN shell? It seems to be
available here:
http://search.cpan.org/CPAN/authors/id/K/KA/KASEI/Cryp
On 06/20/2007 06:42 AM, Nath, Alok (STSD) wrote:
Hi,
Is it possible to read a particular line by line number ?
For e.g reading line 3 from a file.
I don't want to read each line and count.
Thanks
Alok
The module Tie::File makes this easy. However, you should probably
On 6/20/07, yitzle <[EMAIL PROTECTED]> wrote:
What function/module (I prefer built in functions...) is there that I
can use to do some simple/basic reversable (opposed to crypt()'s one
way) encryption?
I want to be able to encrypt/decrypt a textfile.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of zentara
> Sent: Wednesday, June 20, 2007 8:13 AM
> To: beginners@perl.org
> Subject: Re: Inter-thread communications
>
> On Tue, 19 Jun 2007 15:44:18 -0400, [EMAIL PROTECTED] ("Bob McConnell")
> wrote:
On 6/20/07, Isnard Delacoste Jaquet Junior <[EMAIL PROTECTED]> wrote:
I have a simple question (hard for me that don't know perl though):
How do I search for a line and when found insert a comment in the
beginning of it?
Perl's comments run from the pound sign ("#") to end-of-line, so a
commen
I'm trying to read the body and the attachment in a mime message. I keep
getting the folling error.
Use of uninitialized value in pattern match (m//) at
/usr/share/perl5/Email/MIME/ContentType.pm line 24.
#!/usr/bin/perl -w
use Net::POP3;
use Email::MIME;
my ($mail_server, $username, $passwo
Hello,
I have a simple question (hard for me that don't know perl though):
How do I search for a line and when found insert a comment in the
beginning of it?
If more info is needed let me know please.
Best regards,
Isnard
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
I'm trying to read the body and the attachment in a mime message. I keep
getting the folling error.
Use of uninitialized value in pattern match (m//) at
/usr/share/perl5/Email/MIME/ContentType.pm line 24.
#!/usr/bin/perl -w
use Net::POP3;
use Email::MIME;
my ($mail_server, $username, $pass
But that still reads the entire file to that point,
You can use seek if you know the number of chars on a line.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 20 June 2007 13:53
To: beginners@perl.org
Subject: Re: Reading a particular line from a file
On 20 J
You could do it a couple of ways the way I would go about it is
My(@arr1,@arr2,@arr3);
mol2_read($opts{m},[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]);
sub mol2_read {
My($opt_m,$arr1,$arr2,$arr3)[EMAIL PROTECTED];
#
# code to do what you want with the above
#
return;
}
-O
On 20 Jun, 16:42, [EMAIL PROTECTED] (Alok Nath) wrote:
> Hi,
> Is it possible to read a particular line by line number ?
>
> For e.g reading line 3 from a file.
>
> I don't want to read each line and count.
>
> Thanks
> Alok
You can do below to print the 3rd line.
open FIL
Hi everybody,
I got a problem with handling sub-routines and arrays.
Here is an example of the code:
#!/usr/bin/perl -w
(@old_header,@old_atoms,@old_bonds) = mol2_read($opts{m});
sub mol2_read {
return ([EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]);
}
Ok, now the problem:
If I
I took down the firewall and got the same results.
Could not fetch authors/id/K/KA/KASEI/Crypt-Simple-0.06.tar.gz
Giving up on
'/home/Admin/.cpan/sources/authors/id/K/KA/KASEI/Crypt-Simple-0.06.tar.gz'
Note: Current database in memory was generated on Sat, 05 May 2007 21:09:57 GMT
On 6/20/07, y
I tried to install Crypt::Simple using the CPAN shell
It failed at downloading the module multiple times from multiple servers.
I got:
Please check, if the URLs I found in your configuration file
(ftp://CPAN.mirror.rafal.ca/pub/CPAN/,
ftp://cpan.sunsite.ualberta.ca/pub/CPAN/, ftp://ftp.nrc.ca/pub
On Jun 20, 7:42 am, [EMAIL PROTECTED] (Alok Nath) wrote:
> Is it possible to read a particular line by line number ?
>
> For e.g reading line 3 from a file.
>
> I don't want to read each line and count.
You don't have to count. Perl counts for you. The current line number
On Wed, 2007-06-20 at 17:12 +0530, Nath, Alok (STSD) wrote:
> Hi,
> Is it possible to read a particular line by line number ?
>
> For e.g reading line 3 from a file.
>
> I don't want to read each line and count.
No and yes. If it is genuine new random data then no.
If it is fi
Hi,
Is it possible to read a particular line by line number ?
For e.g reading line 3 from a file.
I don't want to read each line and count.
Thanks
Alok
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Mathew Snyder wrote:
It looks like an object is what I want. Am I correct? Suppose I need to work
with a bit of data that actually has 11 attributes. This would be an object of
another type. However, I need to manipulate pieces of it differently. So I'm
guessing I would create an object thus
On 06/20/2007 05:40 AM, Mathew Snyder wrote:
It looks like an object is what I want. Am I correct?
As always, it depends.
Suppose I need to work
with a bit of data that actually has 11 attributes. This would be an object of
another type. However, I need to manipulate pieces of it differen
It looks like an object is what I want. Am I correct? Suppose I need to work
with a bit of data that actually has 11 attributes. This would be an object of
another type. However, I need to manipulate pieces of it differently. So I'm
guessing I would create an object thusly:
sub objectname {
Mathew Snyder wrote:
I'm probably going to be doing some work with data that would, based on what I
already know of Perl, require me to create something along the lines of a
HoHoHoHoHoHoHoHoH...not exactly representative but you get the idea.
Is there a way to handle data with a lot of attribut
Thank you
I learnt a lot!
Martin
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
I'm probably going to be doing some work with data that would, based on what I
already know of Perl, require me to create something along the lines of a
HoHoHoHoHoHoHoHoH...not exactly representative but you get the idea.
Is there a way to handle data with a lot of attributes other than creating a
On 06/20/2007 02:07 AM, anand kumar wrote:
Please guide me with some code or documentation for the following problem :-
I need to set some specific time for a command to execute. [...]
The "alarm" function might help you:
At a command prompt, type "perldoc -f alarm"
--
To unsubscr
Thanks .It serves the purpose.
-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 20, 2007 12:42 PM
To: beginners@perl.org
Cc: Nath, Alok (STSD)
Subject: Re: How to get the values
Nath, Alok (STSD) wrote:
> Hi,
> I have a file from which I have to p
Nath, Alok (STSD) wrote:
Hi,
I have a file from which I have to pick a line like this
and get the values of Par, Default and RootOnly.
Par=som Default=yes RootOnly=no Shared=force
I am trying something like below.But the code is becoming long.
Anything simpli
Please guide me with some code or documentation for the following problem :-
I need to set some specific time for a command to execute. For example, If I
am opening a very large file and it takes me more than 3 to 4 seconds then my
code should be able to quit the program or kill the process
62 matches
Mail list logo