Re: reference to a hash

2006-04-14 Thread Chad Perrin
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_items_for_all(%all) in

Re: How to use proxy with LWP?

2006-04-14 Thread Alan_C
On Friday 14 April 2006 14:36, siegfried wrote: > I stole the following code fragment from an example program: > > use vars '@ISA'; > @ISA = 'LWP::UserAgent'; > my $agent= __PACKAGE__->new; > > Now I want to use a proxy and a search on CPAN to find > http://search.cpan.org/~qjzhou/LWP-UserAgent

Re: regex matching conditionally

2006-04-14 Thread JupiterHost.Net
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 be perect!

Re: reference to a hash

2006-04-14 Thread Owen Cook
On Fri, 14 Apr 2006, 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_items_for_all(%all) instead for (\%all

reference to a hash

2006-04-14 Thread Brian Volk
Hi All, 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 explain this to me?

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

2006-04-14 Thread chen li
--- "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

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

2006-04-14 Thread Randy W. Sims
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 environment variable PERL5LIB to the additional paths. On the command line: `set PERL

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

2006-04-14 Thread Jay Savage
Please don't top post. On 4/14/06, chen li <[EMAIL PROTECTED]> wrote: > Hi Timothy, > > Under windows XP I recall perl interpreter look for > the default paths > > C:/Perl/lib > C:/Perl/site/lib > > What I try to say is that how I add something to the > @INC of perl so that it also looks for anoth

Re: regex matching conditionally

2006-04-14 Thread Jay Savage
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 be perect! Than

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

2006-04-14 Thread chen li
Hi Timothy, Under windows XP I recall perl interpreter look for the default paths C:/Perl/lib C:/Perl/site/lib What I try to say is that how I add something to the @INC of perl so that it also looks for another path under windows let say c:/Perl/local Where I like to put my own stuff in it. I d

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

2006-04-14 Thread Timothy Johnson
You don't need Unix to use lib, just change your backslashes to forward slashes. "CAVEATS In order to keep lib.pm small and simple, it only works with Unix filepaths. This doesn't mean it only works on Unix, but non-Unix users must first translate their file paths to Unix conventions

RE: reverse the order of a row in Excel

2006-04-14 Thread chen li
--- Timothy Johnson <[EMAIL PROTECTED]> wrote: > Ah. Ok, this will work as long as you are using > text files. The > answers I gave you were for automating Excel using > OLE. Unless you are > having to do this over and over, saving the file as > text and then using > this will probably work,

RE: reverse the order of a row in Excel

2006-04-14 Thread Timothy Johnson
Ah. Ok, this will work as long as you are using text files. The answers I gave you were for automating Excel using OLE. Unless you are having to do this over and over, saving the file as text and then using this will probably work, except for one thing: Do you want to split the line into an arr

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

2006-04-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
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. I believe you don't, but you need to check your doc how where the new pm's should go as part of installing and there becomes no need to tell Perl where

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

2006-04-14 Thread Timothy Johnson
perldoc lib -Original Message- From: chen li [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 2:40 PM To: beginners@perl.org Subject: how to tell perl to look for where a new module is installed I install in new module like this: c:/perl/local/new.pm. How should tell the perl

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

2006-04-14 Thread chen li
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? Li __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best

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

2006-04-14 Thread Ed
Ok, Thanks for the suggestions. It turns out that I have a permissions/access problem, but I don't see how since I'm running as administrator!! I ran "system("whoami") and it returned Ed who is "administrator". I also did an unlink call to remove the file first and $^E (thanks for the tip!) repo

How to use proxy with LWP?

2006-04-14 Thread siegfried
I stole the following code fragment from an example program: use vars '@ISA'; @ISA = 'LWP::UserAgent'; my $agent= __PACKAGE__->new; Now I want to use a proxy and a search on CPAN to find http://search.cpan.org/~qjzhou/LWP-UserAgent-ProxyAny-1.02/ProxyAny.pm with some sample code (see below).

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

2006-04-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Wagner, David --- Senior Programmer Analyst --- WGO wrote: > Ed wrote: >> I'm trying to do a simple file rename and am starting to pull my >> hair out. >> >> # Open the infile for read, no append, no create, no clobber >> open RIGHTSLISTFILE, "<$rightslistfilename" >> || die ("admin_us

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

2006-04-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ed wrote: > I'm trying to do a simple file rename and am starting to pull my > hair out. > > # Open the infile for read, no append, no create, no clobber > open RIGHTSLISTFILE, "<$rightslistfilename" > || die ("admin_user_ex : Error: Can not open file: > $rightslistfilename \n"); > #

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

2006-04-14 Thread Timothy Johnson
You might want to add the $^E and $! error variables in your output. I've been using rename with XP,W2k, and W2k3 for a few years now without problems. Another thought: Make sure that it's working in the directory you think it is. It's pretty easy to accidentally copy the file somewhere else.

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

2006-04-14 Thread Ed
I'm trying to do a simple file rename and am starting to pull my hair out. # Open the infile for read, no append, no create, no clobber open RIGHTSLISTFILE, "<$rightslistfilename" || die ("admin_user_ex : Error: Can not open file: $rightslistfilename \n"); # Open the outfile for write

Re: Problems with simple regexps

2006-04-14 Thread John Ackley
Mattheus Henrique wrote: Hi, I'm learning Perl but I've found some difficulties: Why doesn't this: [code] #!/usr/bin/env perl use warnings; use strict; while(<>){ if(/[A-Z][^A-Z]+/){ print; } } [/code] Act like this: [code]#!/usr/bin/env perl use warnings; use strict; while(<

Problems with simple regexps

2006-04-14 Thread Mattheus Henrique
Hi, I'm learning Perl but I've found some difficulties: Why doesn't this: [code] #!/usr/bin/env perl use warnings; use strict; while(<>){ if(/[A-Z][^A-Z]+/){ print; } } [/code] Act like this: [code]#!/usr/bin/env perl use warnings; use strict; while(<>){ if(/[A-Z][a-z]+/){

RE: regex matching conditionally

2006-04-14 Thread Timothy Johnson
-Original Message- From: JupiterHost.Net [mailto:[EMAIL PROTECTED] Sent: Friday, April 14, 2006 12:15 PM To: beginners@perl.org Subject: Re: regex matching conditionally >Timothy Johnson wrote: >> Will the string always have the two quotes in the same place and only >> one per string? Wh

Re: regex matching conditionally

2006-04-14 Thread JupiterHost.Net
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 be perect! Thank Mr. Johnson :) I love when I learn a new tidbit! -- To unsubscribe, e-

RE: Crypt::GPG produces an empty cleartext file

2006-04-14 Thread Smith, Derek
-Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Thursday, April 06, 2006 8:04 PM To: Perl Beginners Subject: Re: Crypt::GPG produces an empty cleartext file RICHARD FERNANDEZ wrote: > Hi Folks, Hello, > I have a job that takes in an encrypted file and decrypts it

Re: regex matching conditionally

2006-04-14 Thread JupiterHost.Net
Not what you asked for, but probably more correct: my @matches; use Regexp::Common; my @quoted = ($string =~ /$RE{quoted}/g); foreach my $quoted ( @quoted ) { push( @matches, ($quoted =~ /$RE{balanced}{-parens=>'{}'}/g) ); } print join "\n", @matches; Thanks, it was the same sort of i

Re: row and column convert in perl

2006-04-14 Thread Mr. Shawn H. Corey
On Fri, 2006-14-04 at 07:07 -0700, chen li wrote: > Hi all, > > I have a two dimensional array: > > $array=([1,2,3,4,5,], > [10,20,30,40,50]) > > How could I change so that I will get the following > results using perl? > $change_array=([1,10], >[2,20], >

row and column convert in perl

2006-04-14 Thread chen li
Hi all, I have a two dimensional array: $array=([1,2,3,4,5,], [10,20,30,40,50]) How could I change so that I will get the following results using perl? $change_array=([1,10], [2,20], [3,30], [4,40], [5,50]) Thanks, Li

Create ODBC driver?

2006-04-14 Thread Karjala
Is there a Perl module that can help me create my own ODBC driver for Windows? I haven't found any on CPAN, but it could be a good idea to have one. For example, I need a special kind of ODBC driver that instead of issuing SQL statements to a database, issues SOAP statements to a website. It