Re: using hashes with request(POST

2006-04-15 Thread Mr. Shawn H. Corey
On Sat, 2006-15-04 at 22:30 +0100, Matt Richards wrote: > hello everybody, :) > > i'm just starting with perl and i have come across a little problem that > i cant seem to solve, atm i have this code ... > > my $response = $ua->request(POST $url, > Content_Type => 'form-data', > Content => my %

Re: reference to a hash

2006-04-15 Thread Mr. Shawn H. Corey
On Sat, 2006-15-04 at 14:34 -0700, John W. Krahn wrote: > Actually it will effect the values of the hash but not the keys: > > $ perl -le' > sub foo { > for ( @_ ) { > tr/a-z/A-Z/ > } > } > my @a = qw/ a b c d e f g h i j /; > print "@a"; > foo @a; > print "@a"; > my %h = q

Re: reference to a hash

2006-04-15 Thread John W. Krahn
Mr. Shawn H. Corey wrote: > On Sat, 2006-15-04 at 09:32 -0400, Steve Bertrand wrote: >>Just out of curiosity, if you pass the hash, won't it create a 'copy' of >>the original, manipulate it so that in the end you may have two >>different versions (modifications) of the same hash? >> >>As I underst

using hashes with request(POST

2006-04-15 Thread Matt Richards
hello everybody, :) i'm just starting with perl and i have come across a little problem that i cant seem to solve, atm i have this code ... my $response = $ua->request(POST $url, Content_Type => 'form-data', Content => my %fq_hash); i would like the hash values in $fq_hash to be submitted as

Fwd: regex matching conditionally

2006-04-15 Thread Jay Savage
-- Forwarded message -- From: Jay Savage <[EMAIL PROTECTED]> Date: Apr 15, 2006 2:58 PM Subject: Re: regex matching conditionally To: "John W. Krahn" <[EMAIL PROTECTED]> On 4/15/06, John W. Krahn <[EMAIL PROTECTED]> wrote: > Jay Savage wrote: > > On 4/14/06, JupiterHost.Net <[EMAI

Re: how to tell perl to look for where a new module is installed

2006-04-15 Thread Jay Savage
On 4/14/06, Randy W. Sims <[EMAIL PROTECTED]> wrote: > chen li wrote: > > Hi all, > > > > Thank you all for reply my post in advance. > > > > I install in new module like this: > > c:/perl/local/new.pm. > > > > How should tell the perl to look at it in addition to > > the default paths? > > Set the

Re: "use warnings" not working in Perl 5.8.8

2006-04-15 Thread Tom Phoenix
On 4/15/06, mattesonweb <[EMAIL PROTECTED]> wrote: > !# /usr/bin/perl > use warnings; You need to reverse those first two characters. Pound-bang is the traditional start of executable scripts. But when reversed, Perl thinks you're trying to negate the boolean value of 'use warnings', and that's n

"use warnings" not working in Perl 5.8.8

2006-04-15 Thread mattesonweb
I am a complete newbie to Perl (although I am an advanced PHP programmer). I have installed ActivePerl-5.8.8.817-MSWin32-x86-257965.msi on my Windows XP machine running Apache 2.0. I am getting this syntax error: "use" not allowed in expression at c:\hello_world.pl line 2, at end of line Here

Re: reference to a hash

2006-04-15 Thread Chad Perrin
On Sat, Apr 15, 2006 at 06:09:04AM -0700, John W. Krahn wrote: > Chad Perrin wrote: > > On Fri, Apr 14, 2006 at 12:18:33PM -0400, Brian Volk wrote: > >>I'm working through the exercises in the Alpaca book. I don't > >>understand why you have to pass the check_items_for_all subroutine a > >>referen

Re: does rename have problems on W2K, W Server 2003, etc?

2006-04-15 Thread Ed
Dr. Ruud, " See news:[EMAIL PROTECTED] (that Message-ID is far from RFC compliant)" Say what? On 4/15/06, Dr.Ruud <[EMAIL PROTECTED]> wrote: > Ed schreef: > > > I took the section of code and ran it from the command line and it > > works fine, so it must be something having to do with it

RE: reference to a hash

2006-04-15 Thread Mr. Shawn H. Corey
On Sat, 2006-15-04 at 09:32 -0400, Steve Bertrand wrote: > Just out of curiosity, if you pass the hash, won't it create a 'copy' of > the original, manipulate it so that in the end you may have two > different versions (modifications) of the same hash? > > As I understand it, if you pass a href,

RE: reference to a hash

2006-04-15 Thread Steve Bertrand
> > I'm working through the exercises in the Alpaca book. I don't > > understand why you have to pass the check_items_for_all > subroutine a > > reference to a hash. Why can't you just pass it the hash itself... > > check_items_for_all(%all) instead for (\%all) ? Could someone pls > > expla

Re: reference to a hash

2006-04-15 Thread John W. Krahn
Brian Volk wrote: > Hi All, Hello, > I'm working through the exercises in the Alpaca book. I don't > understand why you have to pass the check_items_for_all subroutine a > reference to a hash. Why can't you just pass it the hash itself... > check_items_for_all(%all) instead for (\%all) ? Could

Re: reference to a hash

2006-04-15 Thread John W. Krahn
Chad Perrin wrote: > On Fri, Apr 14, 2006 at 12:18:33PM -0400, Brian Volk wrote: >>I'm working through the exercises in the Alpaca book. I don't >>understand why you have to pass the check_items_for_all subroutine a >>reference to a hash. Why can't you just pass it the hash itself... >>check_item

Re: regex matching conditionally

2006-04-15 Thread John W. Krahn
Jay Savage wrote: > On 4/14/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote: >> >>Timothy Johnson wrote: >>>Will the string always have the two quotes in the same place and only >>>one per string? What about something like this? >>> >>>/.*?\{([^\}]*)\}(?=.*")/gi >>I tested it out and it appears to b

Re: regex matching conditionally

2006-04-15 Thread Dr.Ruud
Timothy Johnson schreef: > /.*?\{([^\}]*)\}(?=.*")/gi There is no need to escape a } in a character class. Something like [^x]*x can also be written as .*?x The "/i" modifier is superfluous. The last .* can also be minimalized. So an alternative is: / [{] (.*?) [}] (?=.*?") /xg

Re: does rename have problems on W2K, W Server 2003, etc?

2006-04-15 Thread Dr.Ruud
Ed schreef: > I took the section of code and ran it from the command line and it > works fine, so it must be something having to do with it being run by > the server? See news:[EMAIL PROTECTED] (that Message-ID is far from RFC compliant) -- Affijn, Ruud "Gewoon is een tijger." -- To unsubs

RE: Cannot access file because it is being used by another process

2006-04-15 Thread Charles K. Clarkson
Ed wrote: : What's odd is that this code runs fine if I run it as a : command line script, but if it's run as a CGI script if : fails. So, what you're saying is that this error may be coming from your host and not from perl. Running your error through Google reveals it to be an IIS 6.0 error.

Cannot access file because it is being used by another process

2006-04-15 Thread Ed
I'm not sure why I get the error above, but is there a way to wait to unlink a file until it's no longer being used by another process? IIn a CGI file, when trying to unlink a file I get the following message. "The process cannot access the file because it is being used by another process" What

Re: How to use proxy with LWP?

2006-04-15 Thread Alan_C
Hi, (just now found at bottom) which redirects to: http://bfr.caseywest.com/ scroll down to heading entitled: April 14, 2006 How to use proxy with LWP? which has a dozen cross referenced searches going to lots of very relevant places. Please post your

Re: How to use proxy with LWP?

2006-04-15 Thread Alan_C
On Friday 14 April 2006 23:24, Alan_C wrote: > On Friday 14 April 2006 14:36, siegfried wrote: [ . . ] > > How do I modify the above fragment so I can conditionally use a proxy? http://www.google.com/search?q=perl+lwp+proxy&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official