RE: Matching a Scalar Variable

2005-11-28 Thread Thomas Bätzler
Hi, Mazhar <[EMAIL PROTECTED]> asked: > Open (FILE1,">one Fuile"); > Open (FILE,">Second File"); Please post working examples, not pseudo code. > while () > { > $line1 = $_; This is bad. I'd suggest you use meaningful variable names. They help people to understand what you're trying to

Re: help about regex matching

2005-11-28 Thread Jeff Pang
Thanks for Charles.That code can work well,but I still want to know how to do it with regex expression. 2005/11/29, Charles K. Clarkson <[EMAIL PROTECTED]>: > Jeff Pang wrote: > : I would like to use regex for my destination because the file > : size is large and having

RE: help about regex matching

2005-11-28 Thread Bedanta Bordoloi, Gurgaon
Hi Jeff, Here's a solution u can have a look at: open(INPUTFILE, "d:/data.log"); open(OUTPUTFILE, ">d:/output.log"); my $last_str = "INIT"; RECORD: while(){ chomp; $str = $_; if ($last_str ne "INIT" && length($str) != 0){ print OUTPUTFILE "$last_str $str\n"

Re: Matching a Scalar Variable

2005-11-28 Thread Mazhar
Sorry i am passing the OPEN as Open (FILE1," wrote: > > > > On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: > > > > Hi Folks, > > I have a requirement where in i have to read a file and then > > store > > the line by line items into a scalar variable. And then ihave ti match > > the > > sa

Re: Matching a Scalar Variable

2005-11-28 Thread Muthukumar
On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: > > Hi Folks, > I have a requirement where in i have to read a file and then > store > the line by line items into a scalar variable. And then ihave ti match the > same. i am providing you a sample code. Just help how can i match a string > wh

Matching a Scalar Variable

2005-11-28 Thread Mazhar
Hi Folks, I have a requirement where in i have to read a file and then store the line by line items into a scalar variable. And then ihave ti match the same. i am providing you a sample code. Just help how can i match a string where in i should pass a scalar variable value. PGM Open (FI

RE: help about regex matching

2005-11-28 Thread Charles K. Clarkson
Jeff Pang wrote: : I would like to use regex for my destination because the file : size is large and having much lines. An unnecessary regex would slow you down on a large file. HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 No regex needed

Re: You've read the Llama, now what?

2005-11-28 Thread Alfred Vahau
Paul Lalli wrote: On 11/27/05, Tom Yarrish <[EMAIL PROTECTED]> wrote: I've been reading this list for a while, and I've been trying to learn perl on my own for quite some time. However, my job doesn't really (from my vantage point at least) "allow" me to do any sort of programming (by that

Re: help about regex matching

2005-11-28 Thread Jeff Pang
I would like to use regex for my destination because the file size is large and having much lines.Thanks for Bhate's reply. 2005/11/29, Dhanashri Bhate <[EMAIL PROTECTED]>: > Hi Jeff, > If that the problem definition, why do you need regex? You can just keep on > reading the lines one by one and c

RE: help about regex matching

2005-11-28 Thread Dhanashri Bhate
Hi Jeff, If that the problem definition, why do you need regex? You can just keep on reading the lines one by one and combine 1st and 2nd, 3rd and 4th and so on.. I hope I got your question correct :) Thanks and regards, Dhanashri Life is a differ

help about regex matching

2005-11-28 Thread Jeff Pang
hi,list, I have a file looking as below: 356.5 192.168.2.20 283.3 192.168.2.21 261.9 192.168.2.22 135.9 192.168.2.23 557 192.168.2.24 79.4 192.168.2.25 349 192.168.2.26 265.1 192.168.2.27 326 192.168.2.28 404 192.168.2.29 331 192.168.2.30 612 192.168.2.31 ... I want to get this resu

Re: mode Q on File::stat

2005-11-28 Thread Abid Khwaja
On Nov 26, 2005, at 4:58 AM, John W. Krahn wrote: You could use perl's built-in getgrnam function to do that: $ perl -le' $shouldbegid = getgrnam "uucp"; print $shouldbegid' 14 Cool, that's much better. Thanks. I think you may misunderstand how the & operator works. You are telling

Re: From column to row?

2005-11-28 Thread John W. Krahn
Andrej Kastrin wrote: > > I suppose that above example is not good one; here is the real one: > Mark > Francesco > Ann > Robert > > transform to: "Mark","Francesco","Ann","Robert" > > and here is my code: > > $source_file = "input.txt"; > $result_file = "output.txt"; > > open (SOURCE, $source_f

Re: From column to row?

2005-11-28 Thread Gerard Robin
On Mon, Nov 28, 2005 at 08:45:14PM +0100 Andrej Kastrin wrote: > Hi, I am totally NOOB in Perl and here is my first problem, which I > couldn't solve... > I have column data in file xy.txt, which looks like: > A > B > C > ABCDD > .. > . > > Now I have to transform this to row data fil

RE: From column to row?

2005-11-28 Thread Cintron, Jose J.
Here's a fixed version, not much though into it, you can figure out how to remove the trailing , $source_file = "input.txt"; $result_file = "output.txt"; open (SOURCE, $source_file) || die "cannot open $source_file: $!"; open (RESULT, ">$result_file") || die "cannot open $result_file: $!"; whil

Re: From column to row?

2005-11-28 Thread Jeff 'japhy' Pinyan
On Nov 28, Andrej Kastrin said: I suppose that above example is not good one; here is the real one: Mark Francesco Ann Robert transform to: "Mark","Francesco","Ann","Robert" while () { my($line) = $_; if ($line =~ $) #match to end of line You don't need a regex here at all, and even if you

Re: From column to row?

2005-11-28 Thread Andrej Kastrin
Chris Devers wrote: On Mon, 28 Nov 2005, Andrej Kastrin wrote: Hi, I am totally NOOB in Perl and here is my first problem, which I couldn't solve... I have column data in file xy.txt, which looks like: A B C ABCDD .. . Now I have to transform this to row data file in the fol

RE: From column to row?

2005-11-28 Thread Timothy Johnson
It's definitely possible. The first thing to do is define your problem a little better. Do you want four items per row, or do you want to slurp the entire file and make one long comma-separated list? This is a good starting project because it makes you learn how to open, read, and write to file

Re: Adding the use statements to a different file

2005-11-28 Thread vmalik
That worked Shawn. Thanks Quoting Shawn Corey <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] wrote: > > Hi, > > > > I have to write several perl scripts with a number of modules included. > > Therefore, I have to type many "use" statements at the top of each script. > Is > > there a way to dump all th

Re: From column to row?

2005-11-28 Thread Chris Devers
On Mon, 28 Nov 2005, Andrej Kastrin wrote: > Hi, I am totally NOOB in Perl and here is my first problem, which I > couldn't solve... > > I have column data in file xy.txt, which looks like: > > A > B > C > ABCDD > .. > . > > Now I have to transform this to row data file in the follow

From column to row?

2005-11-28 Thread Andrej Kastrin
Hi, I am totally NOOB in Perl and here is my first problem, which I couldn't solve... I have column data in file xy.txt, which looks like: A B C ABCDD .. . Now I have to transform this to row data file in the following way: "A","B","C","ABCDD" Is that possible? Thanks i

Re: want to install

2005-11-28 Thread Andreas Schroeder
I have perl 5.8.7 and glib 2.8.1 and 1.2.10. I have pkg-config as a perl module and a decent standard c library. swayam panda wrote: In order to use perl bindings for glib, you must have glib 2.x and its prerequisites (pkg-config and a decent standard c library) installed. glib-2.x is available

RE: You've read the Llama, now what?

2005-11-28 Thread Frank D. Gunseor
Now that is REALLY helpful! -Original Message- From: swayam panda [mailto:[EMAIL PROTECTED] Sent: Monday, November 28, 2005 3:59 AM To: beginners@perl.org Subject: Re: You've read the Llama, now what? Hi There is Saying I See and I Forget I Hear and I Remember I Do and I Understand

Re: Installing Perl Modules Locally

2005-11-28 Thread Eric Pretorious
Mandar: Download the module's source code and install the module manually but modify the installation location by providing Makefile.PL the PREFIX=... argument. i.e., %> perl Makefile.PL PREFIX=/your/home/dir %> make %> make test %> make install Eric P. Sunnyvale, CA On Sat, 2005-11-26 at 14:18

Re: Adding the use statements to a different file

2005-11-28 Thread Shawn Corey
[EMAIL PROTECTED] wrote: Hi, I have to write several perl scripts with a number of modules included. Therefore, I have to type many "use" statements at the top of each script. Is there a way to dump all these "use" statements in a different file and then just include that file everytime I have t

Re: You've read the Llama, now what?

2005-11-28 Thread Tom Yarrish
On Mon, 28 Nov 2005, merlyn@stonehenge.com (Randal L. Schwartz) wrote: "Tom" == Tom Yarrish <[EMAIL PROTECTED]> writes: Tom> So it makes it difficult for me to apply what I've read from the Tom> O'Reilly books to real world problems (and I've read the Llama Tom> book a few times). But have yo

Adding the use statements to a different file

2005-11-28 Thread vmalik
Hi, I have to write several perl scripts with a number of modules included. Therefore, I have to type many "use" statements at the top of each script. Is there a way to dump all these "use" statements in a different file and then just include that file everytime I have to include these "use" state

Re: You've read the Llama, now what?

2005-11-28 Thread Wiggins d'Anconia
Randal L. Schwartz wrote: "Tom" == Tom Yarrish <[EMAIL PROTECTED]> writes: Tom> So it makes it difficult for me to apply what I've read from the Tom> O'Reilly books to real world problems (and I've read the Llama Tom> book a few times). But have you also read the Alpaca? That's the natural "

Re: You've read the Llama, now what?

2005-11-28 Thread Randal L. Schwartz
> "Tom" == Tom Yarrish <[EMAIL PROTECTED]> writes: Tom> So it makes it difficult for me to apply what I've read from the Tom> O'Reilly books to real world problems (and I've read the Llama Tom> book a few times). But have you also read the Alpaca? That's the natural "next book" after the lla

Re: how to get file's creation time

2005-11-28 Thread Randal L. Schwartz
> "Jay" == Jay Savage <[EMAIL PROTECTED]> writes: Jay> It depends on what you mean by "creation". stat() on POSIXish systems Jay> returns ctime, which is the inode creation time, Nope. Inode *change* time. Will update any time you write to the file, or change any metadata (owner, permission

Re: how to get file's creation time

2005-11-28 Thread Jay Savage
On 11/28/05, Wijaya Edward <[EMAIL PROTECTED]> wrote: > > > > - Original Message - > From: Jennifer Garner <[EMAIL PROTECTED]> > Date: Monday, November 28, 2005 12:30 pm > Subject: how to get file's creation time > > > > How to get file's creation time,NOT last modify time?Thanks. > > I don

Re: Pattern Matching Question

2005-11-28 Thread Jeff 'japhy' Pinyan
On Nov 27, Dax Mickelson said: I am having problems matching ALL possible matches of a string against another (very large) string. I am doing something like: @LargeArray = ($HugeString =~ m/$Head/ig); Where $Head is an 8 character string. (Basically I want to get all 16 character lon

Re: You've read the Llama, now what?

2005-11-28 Thread John Doe
Tom Yarrish am Montag, 28. November 2005 05.33: > Hey all, > I've been reading this list for a while, and I've been trying to > learn perl on my own for quite some time. However, my job doesn't > really (from my vantage point at least) "allow" me to do any sort of > programming (by that I mean my

Re: You've read the Llama, now what?

2005-11-28 Thread Rob Coops
I would say get stuck in... You are speaking of larger projects well choose one and start working on it. Small steps and one at a time. Then when you have the first small stp running go back and improve what you have made with what you have learned. Ask many questions as this will help you figure

Re: You've read the Llama, now what?

2005-11-28 Thread swayam panda
Hi There is Saying I See and I Forget I Hear and I Remember I Do and I Understand . Swayam - Original Message - From: "Elie De Brauwer" <[EMAIL PROTECTED]> To: "Paul Lalli" <[EMAIL PROTECTED]> Cc: Sent: Monday, November 28, 2005 5:25 PM Subject: Re: You've read the Llama, now what?

Re: You've read the Llama, now what?

2005-11-28 Thread Elie De Brauwer
Paul Lalli wrote: On 11/27/05, Tom Yarrish <[EMAIL PROTECTED]> wrote: I've been reading this list for a while, and I've been trying to learn perl on my own for quite some time. However, my job doesn't really (from my vantage point at least) "allow" me to do any sort of programming (by that I

Re: You've read the Llama, now what?

2005-11-28 Thread Paul Lalli
On 11/27/05, Tom Yarrish <[EMAIL PROTECTED]> wrote: > I've been reading this list for a while, and I've been trying to > learn perl on my own for quite some time. However, my job doesn't > really (from my vantage point at least) "allow" me to do any sort of > programming (by that I mean my day to

Re: Pattern Matching Question

2005-11-28 Thread Dr.Ruud
Dr.Ruud: > #!/usr/bin/perl > use strict; use warnings; > > { local ($,, $\) = (':', "\n"); > > $_ = 'AASDFGHJKL'; > my $Head = ''; > > print $Head, $1, substr($',0,7) while /(?<=$Head)(.)(?=.{7})/ig; > } Revision: #!/usr/bin/perl use strict; use warnings;

Re: Pattern Matching Question

2005-11-28 Thread Dr.Ruud
Dax Mickelson schreef: > I am having problems matching ALL possible matches of a string against > another (very large) string. I am doing something like: @LargeArray > = ($HugeString =~ m/$Head/ig); Where $Head is an 8 character > string. (Basically I want to get all 16 character long

Re: format to scalar better solution?

2005-11-28 Thread Dr.Ruud
Brano Gerzo: > I like format function, but I miss output to scalars. I think you mean 'to text strings' and are looking for sprintf. perldoc -f sprintf -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Google API + SOAP

2005-11-28 Thread Rob Coops
This seems to have to do with running into a proxy server or being in a NAT enviroment from my perspective. This error indicates that your connection to the outside is a little borked... I of course can not say for sure as I do nto know your setup but I can say that I have been able to get this g

Re: want to install

2005-11-28 Thread swayam panda
In order to use perl bindings for glib, you must have glib 2.x and its prerequisites (pkg-config and a decent standard c library) installed. glib-2.x is available from http://www.gtk.org, http://www.gnome.org, etc. Glib uses unicode internally; therefore this module requires perl 5.8.0 or newer.

Re: want to install

2005-11-28 Thread tee
Andreas Schroeder wrote: Hello? Does someone know, why I can't install the Glib-module on my perl? Andy if Carnac the Magnificent were still around, he might be able to help you out! Tee -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: want to install

2005-11-28 Thread Andreas Schroeder
I have Open Suse Linux 10.0 with kernel 2.6.13-15-default and tried to first make the makefile with perl Makefile.PL which suceeded with some warnings. Then I tried to make the whole module which failed with a lot of errors. I could list the procedures with resulting output in the ending of thi