Re: line command in perl

2006-08-23 Thread Robin Norwood
"Timothy Johnson" <[EMAIL PROTECTED]> writes: > I believe you want 'perldoc -f splice'. > > -f is for internal functions. I've wondered for quite a while why 'perldoc ' doesn't 'do what I mean' and search for as a built in funtion, then the module. Anyone know what the reason is? -RN > -Or

Re: How to remove duplicates from a file ...

2006-08-23 Thread Dr.Ruud
benbart schreef: > How do I remove the duplicates via a Perl script? Or use uniq. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to remove duplicates from a file ...

2006-08-23 Thread joseph
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > Hello, > If I have a file that has ... > > A > A > B > C > D > D > D > E > E > F > F > G > > How do I remove the duplicates via a Perl script? perldoc -q "How can I remove duplicate elements from a list or array" One way

Re: How to grep $string from a file? How to run sed-like commands fromPerl?

2006-08-23 Thread Dr.Ruud
benbart schreef: [I see no direct relation of the Subject to the question.] > I have two files that contains thousands and millions of records of > two database tables that are supposed to be replicated and same > "similar" amount of records but, unfortunately, they're not. If the files are sor

Re: How to do this sed one-liners inside Perl?

2006-08-23 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > "sed 's/^[ \t]*//;s/[ \t]*$//' /tmp/file.txt > /tmp/filea.txt" perl -pe 's/^[ \t]+//; s/[ \t]+$//' /tmp/file.txt > /tmp/filea.txt Alternative-1: perl -pe 's/^[[:blank:]]+//, s/[[:blank:]]+$//' /tmp/file.txt > /tmp/filea.txt Alternative-2: perl -ple 's/^\s+//

Re: is there a path enviroment parameter that can tell perl where to find files?

2006-08-23 Thread Mumia W.
On 08/23/2006 02:30 PM, zhihua li wrote: Dear all, now when I'm writing some perl script that needs to open some files, I alwayse have to put the script in the same directory of these files, or I'll have to give the full path to these files in my script. if I do not do so, perl wouldn't be ab

Re: How to grep $string from a file? How to run sed-like commands from Perl?

2006-08-23 Thread Mumia W.
On 08/23/2006 05:09 PM, [EMAIL PROTECTED] wrote: [...] Am guessing that I have to take out the array bit and just modify this line here: @match=grep{/$lookfor/[EMAIL PROTECTED]; But I am not sure how or what I should change it to. How do I tell grep to search from a file instead of from an arra

Re: How to do this sed one-liners inside Perl?

2006-08-23 Thread Mumia W.
On 08/23/2006 04:43 PM, [EMAIL PROTECTED] wrote: Hi all, I found the following sed one-liner trick that strips out the spaces that I run as follows: sed 's/^[ \t]*//;s/[ \t]*$//' /tmp/file.txt > /tmp/filea.txt [...] It's pretty much exactly the same except for the "-pe": perl -pe 's/^[ \t]*/

How to remove duplicates from a file ...

2006-08-23 Thread benbart
Hi all, If I have a file that has ... A A B C D D D E E F F G How do I remove the duplicates via a Perl script? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

How to grep $string from a file? How to run sed-like commands from Perl?

2006-08-23 Thread benbart
Hi all, Please note the Perl script that am trying to write at end the of this email, after the dashes. I have two files that contains thousands and millions of records of two database tables that are supposed to be replicated and same "similar" amount of records but, unfortunately, they're not.

How to do this sed one-liners inside Perl?

2006-08-23 Thread benbart
Hi all, I found the following sed one-liner trick that strips out the spaces that I run as follows: sed 's/^[ \t]*//;s/[ \t]*$//' /tmp/file.txt > /tmp/filea.txt This strips out the spaces in file.txt and cuts down its size from 600M+ to a mere 60M. How do I apply this sed one-liner trick inside

Re: is there a path enviroment parameter that can tell perl where to find files?

2006-08-23 Thread Adriano Ferreira
On 8/23/06, zhihua li <[EMAIL PROTECTED]> wrote: now when I'm writing some perl script that needs to open some files, I alwayse have to put the script in the same directory of these files, or I'll have to give the full path to these files in my script. if I do not do so, perl wouldn't be able to

is there a path enviroment parameter that can tell perl where to find files?

2006-08-23 Thread zhihua li
Dear all, now when I'm writing some perl script that needs to open some files, I alwayse have to put the script in the same directory of these files, or I'll have to give the full path to these files in my script. if I do not do so, perl wouldn't be able to find the files I called up in the sc

Re: Intersection for each pair of arrays

2006-08-23 Thread Adriano Ferreira
On 8/23/06, Derek B. Smith <[EMAIL PROTECTED]> wrote: From the previous emails, I do not understand what parts of this code is doing and why is this practical? The part is $union{$e} = 1 and $isect{$e} = 1 . Also %count is never used. It seems like Andrej made some mistakes in his code. I thin

Re: Intersection for each pair of arrays

2006-08-23 Thread Derek B. Smith
>From the previous emails, I do not understand what parts of this code is doing and why is this practical? The part is $union{$e} = 1 and $isect{$e} = 1 . Also %count is never used. thank you derek use warnings; @a = (1, 3, 5, 6, 7, 8); @b = (2, 3, 5, 7, 9); @union = @intersect= (); %union =

Re: Intersection for each pair of arrays

2006-08-23 Thread Mumia W.
On 08/23/2006 09:58 AM, Andrej Kastrin wrote: Hi, below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. You could turn your code into a function and call it f

Re: Intersection for each pair of arrays

2006-08-23 Thread Tom Phoenix
On 8/23/06, Andrej Kastrin <[EMAIL PROTECTED]> wrote: below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. Use a pair of nested loops; the outer picks one item f

Re: Passing filehandlers

2006-08-23 Thread Tom Phoenix
On 8/23/06, Beginner <[EMAIL PROTECTED]> wrote: Do I have to pass the FH each time I use one of the exported functions? The FAQ has an answer about "How do I pass filehandles between subroutines?" If you type 'perldoc -q filehandle' at the prompt, you should be able to read that answer and som

Intersection for each pair of arrays

2006-08-23 Thread Andrej Kastrin
Hi, below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. Thanks in advance for any suggestion, Andrej ## use warnings; @a = (1, 3, 5, 6, 7

Fwd: hello Sir, I have an issue with the case insensitive characters, would you plz help me

2006-08-23 Thread Adriano Ferreira
Mukthar, I am not sure I understood your problem, but let me give a try. The user input a value for $MACHINE_TYPE and you want to test if there exists a file "$first.trc.$MACHINE_TYPE" regardless of case in the variable. This is it? It depends: if the filesystem is case-insensitive (like in Wind

Fwd: hello Sir, I have an issue with the case insensitive characters, would you plz help me

2006-08-23 Thread mukthar ahmed
-- Forwarded message -- From: mukthar ahmed <[EMAIL PROTECTED]> Date: Aug 23, 2006 5:34 PM Subject: hello Sir, I have an issue with the case insensitive characters, would you plz help me To: perl5-porters@perl.org Let me introduce myself first, I am Mukthar Ahmed, working in a so

Re: Compilation failed in require

2006-08-23 Thread Ranish George
Bala Murugan wrote: Hi All, While running the following temp.pl script, it throws the following error message. $ perl temp.pl HELLO Compilation failed in require at temp.pl line 2. $ $ cat temp.pl #!/usr/bin/perl require "/home/bala/hello.pl"; $ cat hello.pl #!/usr/bin/perl die "HELLO\n"; If

Passing filehandlers

2006-08-23 Thread Beginner
Hi, I trying to be more modular and have put some functions into a separate file, myfunctions.pm. I have another script(s) which call the exported functions from myfunctons.pm. What I would now like is for the myfunctions.pm file to be able to access a filehandle opened by the calling script,

RE: Accessing TCL api via perl

2006-08-23 Thread Bobby Jafari
> I am using a test gear that uses a TCL api for automation. However, all > my test environment is in perl. Has anybody done any work in perl such > that they can call TCL API commands and capture both return codes and > other outputs. > > Every TCL API instruction that I use, would create a handle

Re: Compilation failed in require

2006-08-23 Thread John W. Krahn
Bala Murugan wrote: > Hi All, Hello, > While running the following temp.pl script, it throws the following error > message. > > $ perl temp.pl > HELLO > Compilation failed in require at temp.pl line 2. > $ > > $ cat temp.pl > #!/usr/bin/perl > require "/home/bala/hello.pl"; > > $ cat hello.pl

Re: Accessing TCL api via perl

2006-08-23 Thread Ken Foskey
On Wed, 2006-08-23 at 16:03 +1000, Bobby Jafari wrote: > Hi All, > > I am using a test gear that uses a TCL api for automation. However, all > my test environment is in perl. Has anybody done any work in perl such > that they can call TCL API commands and capture both return codes and > other outp

Compilation failed in require

2006-08-23 Thread Bala Murugan
Hi All, While running the following temp.pl script, it throws the following error message. $ perl temp.pl HELLO Compilation failed in require at temp.pl line 2. $ $ cat temp.pl #!/usr/bin/perl require "/home/bala/hello.pl"; $ cat hello.pl #!/usr/bin/perl die "HELLO\n"; If anyone knows, could

Perl and Apache

2006-08-23 Thread Adilson
Hi All. How can i config Apache to run perl? I tryied to put the correct string, but do not work. My perl is installed into c:\perl Thx Adilson

Re: How do I do this on Perl ...

2006-08-23 Thread Chad Perrin
On Tue, Aug 22, 2006 at 11:44:43PM -0500, Mumia W. wrote: > > for my $letter (qw(a e i o u)) { > print $letter, "\n"; > } Fore! #!/usr/bin/perl -l use strict; use warnings; print for qw(a e i o u); . . . or from the command line: perl -le 'print for qw(a e i o u)' Sorry, couldn't

Re: Accessing TCL api via perl

2006-08-23 Thread Mumia W.
On 08/23/2006 01:03 AM, Bobby Jafari wrote: [...] Every TCL API instruction that I use, would create a handle of some sort (i.e. a value that can be use to destinguish the call in a unique fashion). [...] I don't know what you mean by this. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Connecting to Oracle

2006-08-23 Thread Xavier Noria
On Aug 23, 2006, at 7:52 AM, anand kumar wrote: Can anyone please explain how to connect to oracle database server using perl script which is in separate linux server. Please note that currently I am using putty to connect to linux server for perl scripting and we have the Oracle database