Re: store Array in hash ?

2006-03-29 Thread John W. Krahn
Michael Gale wrote: > Hello, Hello, > I have setup a hash like the following: > > my $test; > > $test->{$setup}->{'opt'} = "OK"; Or: my $test = { $setup => { opt => 'OK' } }; > It works fine, now I want to save an array to the hash: > > my @data; > > push(@data,"test"); > > $test->{$s

Re: store Array in hash ?

2006-03-29 Thread Koms Bomb
> I have setup a hash like the following: my $test; my $setup = 'a'; my @data; push(@data,"test"); $test->{$setup}->{'data'} = [EMAIL PROTECTED]; for(my $c=0; $c <= [EMAIL PROTECTED]>{$setup}->{'data'}}}; $c++) { print $test->{$setup}->{'data'}->[$c]; } Note: 1, it should be "$c <

Re: store Array in hash ?

2006-03-29 Thread Michael Gale
Hey, I think I am supposed to use a reference here ? If so I can't because the data array keeps over written and reused again and again. I guess I will come up with a different solution. Michael Michael Gale wrote: Hello, I have setup a hash like the following: my $test; $test->{$se

store Array in hash ?

2006-03-29 Thread Michael Gale
Hello, I have setup a hash like the following: my $test; $test->{$setup}->{'opt'} = "OK"; It works fine, now I want to save an array to the hash: my @data; push(@data,"test"); $test->{$setup}->{'data'} = @data; Now how do I use it in a for loop later in the script, I tried: for(my

Re: How to split a string read from the file?

2006-03-29 Thread
dear John that's what I want , thx 2006/3/30, John W. Krahn <[EMAIL PROTECTED]>: > > ÅÓ wrote: > > dear all , I'am trying to write a script to neaten files as follows: > > > > 1 : #!/usr/local/bin/perl > > 2 : > > 3 : while ($inputline = ) { > > 4 : while ($inputline =~ /\b[A-Z]\S+/g) { > > 5

Re: How to split a string read from the file?

2006-03-29 Thread John W. Krahn
ÅÓ wrote: > dear all , I'am trying to write a script to neaten files as follows: > > 1 : #!/usr/local/bin/perl > 2 : > 3 : while ($inputline = ) { > 4 : while ($inputline =~ /\b[A-Z]\S+/g) { > 5 : $word = $&; > 6 : $word =~ s/[;.,:-]$//; # remove punctuation > 7 : for ($count = 1; $c

Re: How to split a string read from the file?

2006-03-29 Thread
dear Shawn & Jay problem solved by using '<' instead of 'lt' but the $temp[2] is undefined which means the pattern is not appropriate 在06-3-29,Jay Savage <[EMAIL PROTECTED]> 写道: > > On 3/29/06, 庞 <[EMAIL PROTECTED]> wrote: > > dear all , I'am trying to write a script to neaten files as follows:

Re: can not filter out commentary lines with reg-exps

2006-03-29 Thread John W. Krahn
Harald wrote: > Hi, Hello, > I need to parse an ASCII file which first rows are comments. Those rows > are marked by a '#' at their beginning. You need to use '^' instead of '\' to indicate the beginning of a line. > I try to filter them out by > >while( <$FH> =~ m{\#*} ) >{} > > But

perl XML::Simple parsing for keyword

2006-03-29 Thread Sonika Sachdeva
Hi, I want to search for one or more "filename.mpg" from the xml files which I am parsing using XML:Simple. It may or maynot be there. sub parsexml { my $xml=shift; my $config = XMLin($xml,keyattr=>[Name]); my $A = $config->{' X '}->{'Y'}->{'A'} ; my $B = $config->{'X'}->{'Y'}->{'B'} ; my $C =

Re: Whimsical Question

2006-03-29 Thread Andreas Pürzer
Chas Owens schrieb: > On 3/29/06, Ryan Frantz <[EMAIL PROTECTED]> wrote: > >>Perlers, >> >>I just got a copy of Intermediate Perl (the updated version of Learning >>Perl Objects, References, and Modules, aka Alpaca) and started reading. >>I've been coding Perl for about 18 months now and every tim

SOAP::Lite perl client and .net webservice method.

2006-03-29 Thread Mikhail Cholokhov
Hi All, i have following situation Perl client consume .Net webservice method like: int Foo(out string name). I've used "stubmaker" to generate stub, but generated method does not contains this parameter :(. Are there any possibilities make such call from Perl? Thanks in advance for the help

Re: Whimsical Question

2006-03-29 Thread Tom Phoenix
On 3/29/06, Ryan Frantz <[EMAIL PROTECTED]> wrote: > _Is_ there a name for '$_' ? In class, I pronounce it "dollar-underscore". But that's short for "dollar-underscore-perl's-favorite-default". :-) --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: Whimsical Question

2006-03-29 Thread Frank Bax
At 08:03 AM 3/29/06, Ryan Frantz wrote: _Is_ there a name for '$_' ? http://www.rexswain.com/perl5.html $_ The default input and pattern-searching space. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Whimsical Question

2006-03-29 Thread Rob Coops
Lets just agree to keep on calling our little magic thingy... On 3/29/06, Bill Peters <[EMAIL PROTECTED]> wrote: > > Not very imaginative, but I read in a perldoc somewhere that it's > pronounced > "dollar-under." A little better than having the "score" on the end I > guess. > > -Bill > > On 3/29/

RE: How to change properties of IE 6.0

2006-03-29 Thread Timothy Johnson
You'll probably find a lot of examples on the Internet and a lot of technical documentation from Microsoft at http://msdn.microsoft.com using Visual Basic and VBScript. You can easily convert most of these to Perl using the Win32::OLE module. Alternately, most of these settings can also be chang

Re: Whimsical Question

2006-03-29 Thread Bill Peters
Not very imaginative, but I read in a perldoc somewhere that it's pronounced "dollar-under." A little better than having the "score" on the end I guess. -Bill On 3/29/06, Timothy Johnson <[EMAIL PROTECTED]> wrote: > > > I sometimes call it the "magic variable". > > > -Original Message- >

Re: syntax errors?

2006-03-29 Thread Tom Phoenix
On 3/28/06, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: > On Tue, 2006-28-03 at 17:42 -0800, Christopher Spears wrote: > > my $sum{$source} += my > > $total_bytes{$source}{$destination}; > > The second 'my' is causing the error. What does the first one cause? --Tom Phoenix Stonehenge Perl T

Re: huge file : parsing problem

2006-03-29 Thread Saurabh Singhvi
Hi thanks for the help!! After it worked i can't say how happy i was :). pardon me for my negligence in calling it the traditional method ;). I just meant traditional in my history :p. once again, thanks a lot Saurabh On 3/29/06, Jay Savage <[EMAIL PROTECTED]> wrote: > > On 3/29/06, Saurabh Sin

RE: Whimsical Question

2006-03-29 Thread Timothy Johnson
I sometimes call it the "magic variable". -Original Message- From: Ryan Frantz [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 29, 2006 5:03 AM To: beginners@perl.org Subject: Whimsical Question Perlers, I realized this after reading over example code in the Alpaca and it got me to

Re: Whimsical Question

2006-03-29 Thread Chas Owens
On 3/29/06, Ryan Frantz <[EMAIL PROTECTED]> wrote: > Perlers, > > I just got a copy of Intermediate Perl (the updated version of Learning > Perl Objects, References, and Modules, aka Alpaca) and started reading. > I've been coding Perl for about 18 months now and every time I see '$_' > I immediate

RE: Sub coding question...

2006-03-29 Thread Richard.Copits
Looks like what I need - Thanks! - I'll work on it... From: Rob Coops [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 29, 2006 9:47 AM To: Copits Dick Cc: beginners@perl.org Subject: Re: Sub coding question... Hi Richard, First of all you are right this is mo

Re: huge file : parsing problem

2006-03-29 Thread Mr. Shawn H. Corey
On Wed, 2006-29-03 at 15:53 +, Saurabh Singhvi wrote: > HI there, > > I have a huge file (~7GB) of text data. I need to parse it to extract > something : basically minima and maxima, and then i need to quantify > the data into an output file based on ranges. > > Now the problem is that the tr

huge file : parsing problem

2006-03-29 Thread Saurabh Singhvi
HI there, I have a huge file (~7GB) of text data. I need to parse it to extract something : basically minima and maxima, and then i need to quantify the data into an output file based on ranges. Now the problem is that the traditional method of opening and foreach which is as follows: open(FILE,

Re: Sub coding question...

2006-03-29 Thread Rob Coops
Hi Richard, First of all you are right this is more than a little inefficient. I would advise even more modifications though. 1. Separate the business logic and user interface parts in separate modules. 2. Use templates for the displaying and don't have the program create the user int

Re: How to split a string read from the file?

2006-03-29 Thread Jay Savage
On 3/29/06, 庞 <[EMAIL PROTECTED]> wrote: > dear all , I'am trying to write a script to neaten files as follows: > > I want to clear the number and colon at the beginning of each line and wirte > a perl script > > #/usr/bin/perl -w > use strict ; > > open MYFILE , "my.txt" ; > my @array=; > my $cou

RE: Whimsical Question

2006-03-29 Thread Ryan Frantz
> -Original Message- > From: Steve Bertrand [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 29, 2006 9:29 AM > To: beginners@perl.org > Subject: RE: Whimsical Question > > > > > For example, when I see '#!', I read 'shebang' and it rolls off the > > > tongue, but 'dollar underscore'

RE: Whimsical Question

2006-03-29 Thread Steve Bertrand
> > For example, when I see '#!', I read 'shebang' and it rolls off the > > tongue, but 'dollar underscore' is clumsy. > > I tend to call it "implicit scalar". How 'bout "impliscalar"? Or "defariable" for default variable. :) Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: Combine similar patterns

2006-03-29 Thread Xavier Noria
On Mar 29, 2006, at 13:55, anand kumar wrote: Please find the attached input.dat and output.dat I asked twice to go back to the simplified notation and that was twice ignored. Sorry, I can't spend more time on this thread. -- fxn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Sub coding question...

2006-03-29 Thread Richard.Copits
I'm really new to Perl and am learning as I go. My boss gave me a program to look over that they're thinking of implementing. It seems to be a GPL auction program. As I was looking through the code, I was puzzled by one part... the part that displays subcategories on the users screen. I've copied s

RE: Whimsical Question

2006-03-29 Thread Gomez, Juan
I am with Ryan been working with Perl for some months now And I have never found a name for '$_', some of my friends They just call it scalar but that's too general for it If someone knows please tell Thanks Armando Gomez Guajardo Process Engineer Work Ph 956 547 6438 Beeper956 768 4

Re: How to split a string read from the file?

2006-03-29 Thread Mr. Shawn H. Corey
On Wed, 2006-29-03 at 20:44 +0800, 庞 wrote: > dear all , I'am trying to write a script to neaten files as follows: > > 1 : #!/usr/local/bin/perl > 2 : > 3 : while ($inputline = ) { > 4 : while ($inputline =~ /\b[A-Z]\S+/g) { > 5 : $word = $&; > 6 : $word =~ s/[;.,:-]$//; # remove punctua

Re: Whimsical Question

2006-03-29 Thread Chad Perrin
On Wed, Mar 29, 2006 at 08:03:24AM -0500, Ryan Frantz wrote: > Perlers, > > I just got a copy of Intermediate Perl (the updated version of Learning > Perl Objects, References, and Modules, aka Alpaca) and started reading. > I've been coding Perl for about 18 months now and every time I see '$_' >

Whimsical Question

2006-03-29 Thread Ryan Frantz
Perlers, I just got a copy of Intermediate Perl (the updated version of Learning Perl Objects, References, and Modules, aka Alpaca) and started reading. I've been coding Perl for about 18 months now and every time I see '$_' I immediately understand its use in the context of the code, but I don't

Re: can not filter out commentary lines with reg-exps

2006-03-29 Thread Bjørge Solli
On Wednesday 29 March 2006 14:22, Harald wrote: > I need to parse an ASCII file which first rows are comments. Those rows > are marked by a '#' at their beginning. > I try to filter them out by > > while( <$FH> =~ m{\#*} ) while( <$FH> =~ m{^\#.*} ) > {} > > But this does not work. The lo

How to split a string read from the file?

2006-03-29 Thread
dear all , I'am trying to write a script to neaten files as follows: 1 : #!/usr/local/bin/perl 2 : 3 : while ($inputline = ) { 4 : while ($inputline =~ /\b[A-Z]\S+/g) { 5 : $word = $&; 6 : $word =~ s/[;.,:-]$//; # remove punctuation 7 : for ($count = 1; $count <= @wordlist; 8 :

RE: can not filter out commentary lines with reg-exps

2006-03-29 Thread Raymond Raj
> -Original Message- > From: Harald [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 29, 2006 5:53 PM > To: beginners@perl.org > Subject: can not filter out commentary lines with reg-exps > > > Hi, > > I need to parse an ASCII file which first rows are comments. > Those rows > are

can not filter out commentary lines with reg-exps

2006-03-29 Thread Harald
Hi, I need to parse an ASCII file which first rows are comments. Those rows are marked by a '#' at their beginning. I try to filter them out by while( <$FH> =~ m{\#*} ) {} But this does not work. The loop does never stop. What goes wrong? I am really confused! Regards and thanks a lot

Re: Combine similar patterns

2006-03-29 Thread anand kumar
Hi   Please find the attached input.dat and output.dat   Thanks in advance for the help   Regards AnandXavier Noria <[EMAIL PROTECTED]> wrote: On Mar 29, 2006, at 12:32, anand kumar wrote:> Please find the file as an attachment with this mailWell, that didn't look like a simplification at a

Re: Combine similar patterns

2006-03-29 Thread anand kumar
Hi Please find the attached input.dat and output.dat Thanks in advance for the help Regards Anand Xavier Noria <[EMAIL PROTECTED]> wrote: On Mar 29, 2006, at 12:32, anand kumar wrote: > Please find the file as an attachment with this mail Well, that didn't look like a simpl

Re: [SPAM DETECT] Re: Combine similar patterns

2006-03-29 Thread Xavier Noria
On Mar 29, 2006, at 12:32, anand kumar wrote: Please find the file as an attachment with this mail Well, that didn't look like a simplification at all. I asked for another example with simplified notation because we already have an idea of the actual input and because you need to provide t

Re: [SPAM DETECT] Re: Combine similar patterns

2006-03-29 Thread anand kumar
Hi   Please find the file as an attachment with this mail   Regards AnandXavier Noria <[EMAIL PROTECTED]> wrote: On Mar 29, 2006, at 12:01, anand kumar wrote:> Yes, of course the code u have sent is very helpful and thanks for > that. But the problem here is that in a single file there may be

Re: [SPAM DETECT] Re: Combine similar patterns

2006-03-29 Thread Xavier Noria
On Mar 29, 2006, at 12:01, anand kumar wrote: Yes, of course the code u have sent is very helpful and thanks for that. But the problem here is that in a single file there may be various number of foot notes i.e. ,.so on. For all these the conventions are the same as told before. I am ha

Re: Combine similar patterns

2006-03-29 Thread anand kumar
Hi Yes, of course the code u have sent is very helpful and thanks for that. But the problem here is that in a single file there may be various number of foot notes i.e. ,.so on. For all these the conventions are the same as told before. I am having problem in combining the relevant one

Re: Combine similar patterns

2006-03-29 Thread Xavier Noria
On Mar 29, 2006, at 10:28, anand kumar wrote: Sorry for not posting the question clearly, Please find the attachment of the sample file. The matter enclosed in ….f1=c>, …..….…… are all the foot notes that are spanning on various pages, now what I am trying to do is that to combine all the r

Re: Combine similar patterns

2006-03-29 Thread anand kumar
Hi all   Sorry for not posting the question clearly, Please find the attachment of the sample file. The matter enclosed in …., …..….…… are all the foot notes that are spanning on various pages, now what I am trying to do is that to combine all the related footnotes that are spanned in various pag