Re: hash speed

2005-02-17 Thread Ken Gillett
On 16 Feb 2005, at 17:40, Jay wrote: On Wed, 16 Feb 2005 08:13:02 +, Ken Gillett <[EMAIL PROTECTED]> wrote: As an extension to my question, what about when repeatedly adding to a data set that needs to be written to a file? Will it be quicker to write each line directly to the file, or repeated

deep and shallow binding

2005-02-17 Thread Ajey Kulkarni
Hi, Can any one explain me how perl treats this binding? - also i'm little confused about the binding rules for reference environments. Unless we use strict, i guess, the default scope is global - is this right? Any pointers,links will be highly appreciated regards -Ajey -- To unsubscribe, e-mail:

Re: 5.6.0 to 5.8.6 problems.

2005-02-17 Thread Richey
I did it this time around with the '/usr' now I get: [EMAIL PROTECTED]:/# perl -v This is perl, v5.8.6 built for i686-linux Copyright 1987-2004, Larry Wall Thanks for the help! "Wiggins d'Anconia" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Richey wrote: >> I am trying to u

splitting by number

2005-02-17 Thread Ken Gillett
I have a problem that is not exactly a perl problem, but I do have to implement it in perl, although the implementation is not the problem. Sorry if that's a bit obscure. I have thousands ( <50,000 ) of numerically named files that I need to store in 2 different location so that the ratio of nu

Re: splitting by number

2005-02-17 Thread bright true
Hi , what i understand from what you wrote ... that you want to check if the files already exits you won't to copy it again so you can check that useing if(-e "location/Filename"){do something } this will return true whenever a file is exits ... if you want to copy whenever a file isn't exi

Re: 5.6.0 to 5.8.6 problems.

2005-02-17 Thread Chris Devers
On Wed, 16 Feb 2005, Ken Simon wrote: > It probably installed the perl binary to /usr/local/bin/perl, or > something similar. Do a `which perl` and find out where your current > perl is (probably /usr/bin/perl), and install perl to that prefix. ^

RE: Class::MethodMaker Query

2005-02-17 Thread Graeme St. Clair
I may well be in over my head here, but I just happened to be reading about this area only yesterday. I'm wondering if the section "References Don't Work As Hash Keys" on p265 of Camel 3rd edn applies here? HTH, GStC. -Original Message- From: Siddharth Uppal [mailto:[EMAIL PROTECTED] S

Re: deep and shallow binding

2005-02-17 Thread Wiggins d'Anconia
Ajey Kulkarni wrote: Hi, Can any one explain me how perl treats this binding? - also i'm little confused about the binding rules for reference environments. Unless we use strict, i guess, the default scope is global - is this right? Any pointers,links will be highly appreciated regards -Ajey See if

Re: Use of uninitialized value in hash element

2005-02-17 Thread AstroDrabb
On Wed, 16 Feb 2005 15:14:47 -0500, AstroDrabb <[EMAIL PROTECTED]> wrote: > Hello group, > > I am new to Perl but not to programming. The company I work for > bought a product called > WebEvent View (http://www.webevent.com/products/view/). Here is the def for %usermap BEGIN { @LDIF::User::ISA

Re: Idiomatic Perl for GPA Calculation

2005-02-17 Thread Randal L. Schwartz
> "Alfred" == Alfred Vahau <[EMAIL PROTECTED]> writes: Alfred> $wcp = ($a6*4.0*6.0 + $a4*4.0*4.0 + $a3*4.0*3.0 + $a2*4.0*2.0) + Alfred> ($b6*3.0*6.0 + $b4*3.0*4.0 + $b3*3.0*3.0 + $b2*3.0*2.0) + Alfred> ($c6*2.0*6.0 + $c4*2.0*4.0 + $c3*2.0*3.0 + $c2*2.0*2.0) + Alfred>

Re: Use of uninitialized value in hash element

2005-02-17 Thread Jay
On Wed, 16 Feb 2005 15:14:47 -0500, AstroDrabb <[EMAIL PROTECTED]> wrote: > > The main part of the code is: > > my $newline = $cmdopts{'msdos'} ? "\r\n" : "\n"; > local($/) = $newline x 2; # Blank line terminates records > > while (<>) { > my @flds = split $newline; > # Don't add it if p

PDF Generation with PDF::API2 or similar

2005-02-17 Thread Gavin Henry
Dear Gurus, What is the preferred way to generate PDF file? I have never done this before and PDF::API2 seems to look good on cpan, but I can't find any tutorials. Anyone got any tips? -- Just getting into the best language ever... Fancy a [EMAIL PROTECTED] Just ask!!! -- To unsubscribe, e-

Capturing the results from Expect with backtick

2005-02-17 Thread glidden, matthew
I'm using combined perl and Expect scripts to do the following: 1. ping a host using expect (for technical reasons, I've had better luck using expect than perl here) 2. for each system that responds to ping, perform a series of rsh commands via perl The expect script is this, where $hosts is a li

RE: Capturing the results from Expect with backtick

2005-02-17 Thread Tyson Sommer
> -Original Message- > From: glidden, matthew [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 17, 2005 10:15 AM > To: 'beginners@perl.org' > Subject: Capturing the results from Expect with backtick > > I'm using combined perl and Expect scripts to do the following: > > 1. ping a

Unicode

2005-02-17 Thread bright true
Hello , any one could help me ? how could i get UCS2/HexEncoded chracters like Hello will return "00480065006C006C006F" Thank you -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: RE: Capturing the results from Expect with backtick

2005-02-17 Thread mgoland
- Original Message - From: Tyson Sommer <[EMAIL PROTECTED]> Date: Thursday, February 17, 2005 11:42 am Subject: RE: Capturing the results from Expect with backtick > > > > -Original Message- > > From: glidden, matthew [EMAIL PROTECTED] > > Sent: Thursday, February 17, 2005 10:

RE: splitting by number

2005-02-17 Thread Charles K. Clarkson
Ken Gillett <[EMAIL PROTECTED]> wrote: : I have thousands ( <50,000 ) of numerically named files that I : need to store in 2 different location so that the ratio of : numbers of files in each location is maintained at a preset : ratio. The files will be repeatedly created and I want to ensure : th

Suggeston/idea.

2005-02-17 Thread Lal, Kumundani \(cognizant\)
Gurus, got small project to design a portal to do many jobs from single place and plan is to use perl+apache on Solaris9 OE. Can some one pls. suggest any link/book which deals precisely with integrating perl with apache. Thanks in advance. -Regds. This e-mail and any files transmitted

Re: splitting by number

2005-02-17 Thread Doug Essinger-Hileman
On 17 Feb 2005 at 11:27, Ken Gillett wrote: > Initially the storage requirements are 2:1, so simply dividing the > name by 3 would (I think) work, i.e. if the name is exactly divisible > by 3 or not could determine in which location to place it. But if I > need to change that to e.g. 3:2 it's not

RE: RE: Capturing the results from Expect with backtick

2005-02-17 Thread Lal, Kumundani \(cognizant\)
Here it's from my side. =head1 DESCRIPTION host_ping work around of no permission to use ping =cut use strict; use warnings; use Net::Ping; my $host = shift or die "specify host\n"; my $timeout = shift || 15; my $p

Re: Suggeston/idea.

2005-02-17 Thread Chris Devers
On Fri, 18 Feb 2005, Lal, Kumundani (cognizant) wrote: > Gurus, [I have] got [a] small project to design a portal to do many > jobs from single place and [the] plan is to use perl+apache on > Solaris9 OE. > > Can some one [please] suggest any link/book which deals precisely > with integrating

Re: Idiomatic Perl for GPA Calculation

2005-02-17 Thread Alfred Vahau
Thank you Randal. Yes, the formula looked ugly and the challenge from 'The Camel' on p.119, 120 prompted me to post for the Perl idiom to do the job. Jay's posting weaved the magic after some modifications. Hard to believe that such a terse coding using only hashes can do the job for the 30,000 r

Solaris Perl Execution

2005-02-17 Thread Eduardo Vázquez Rodríguez
Hello perl addicts! Is there a possible way of executing a Perl Script so that it uses not only one Solaris Processor? What I want is that my script use more than one processor, because they took much time to execute. What I do with my scripts are parsing log files (each one about 800 000 line

Re: Solaris Perl Execution

2005-02-17 Thread Chris Devers
On Thu, 17 Feb 2005, Eduardo Vázquez Rodríguez wrote: > Is there a possible way of executing a Perl Script so that it uses not > only one Solaris Processor? Distributing work across processors is the OS's job, isn't it? That said, if you write your code in such a way that the work is fragmente

Regex to extract numbers between "[ ]"

2005-02-17 Thread Harold Castro
Hi, I'm parsing a log file that contains numbers enclosed by []. Ex. [1108702375] I need to extract them so that I can convert them to `date -r` format. Any help is apreciated. __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! ht

Re: Regex to extract numbers between "[ ]"

2005-02-17 Thread Chris Devers
On Thu, 17 Feb 2005, Harold Castro wrote: > I'm parsing a log file that contains numbers > enclosed by []. Ex. [1108702375] > I need to extract them so that I can convert them to > `date -r` format. > > Any help is apreciated. Please show us the code you've tried so far. Also, please explain

simple substitution question

2005-02-17 Thread Harold Castro
Hi, There is something that's bothering me for so long regarding the use of $_ variable. for example: here is my string: $_ = "but"; s/u/a/g; print $_; This will simply print "bat" My problem is using a variable in place of $_. how will I tell that the one i'm going to substitute is the $strin

RE: simple substitution question

2005-02-17 Thread Bedanta Bordoloi, Gurgaon
Hi, If I've understood your problem, what you can simply try is $string = "but"; print "Before: $string "; $string =~ s/u/a/g; print "After: $string\n"; You will get as output $ Before: but After: bat Cheers, Bedanta -Original Message- From: Harold Castro [mailto:[EMAIL PROTECTED]