Re: Help: Perl Module Installation Issue(s)

2007-04-27 Thread Mumia W.
On 04/27/2007 07:13 PM, Jefferson Kirkland wrote: [...] I was doing fine until today. I tried the following: perl -MCPAN -e 'install OpenSSL' Things started ok, but quickly took a down turn/nose dive into the pavement. The install failed horribly [...] Probably the OpenSSL Perl mo

Re: Help: Perl Module Installation Issue(s)

2007-04-27 Thread Tom Phoenix
On 4/27/07, Jefferson Kirkland <[EMAIL PROTECTED]> wrote: Running make for O/OE/OESI/OpenSSL-0.09.tar.gz You seem to be trying to install version 0.09 of a module. Version numbers below 1.0 are pre-releases, by convention, and may not be finished. Have you read that module's README file? h

Help: Perl Module Installation Issue(s)

2007-04-27 Thread Jefferson Kirkland
Hello all! I am hoping that someone here can point me in the right direction. Before I get right into the issue(s) I am experiencing, allow me to digress into the background of this story. I recently decided, after much deliberation, to install Ubuntu Feisty on my system. It was great, recogni

Re: need some help using strict??

2007-04-27 Thread Tom Phoenix
On 4/27/07, FamiLink Admin <[EMAIL PROTECTED]> wrote: I am trying to verify a credit card number format with the following: (below) but I am getting errors like: Global symbol "%r" requires explicit package name at ./modmember.cgi line 681. This is because, under 'use strict', you must declar

need some help using strict??

2007-04-27 Thread FamiLink Admin
I am trying to verify a credit card number format with the following: (below) but I am getting errors like: Global symbol "%r" requires explicit package name at ./modmember.cgi line 681. Global symbol "%r" requires explicit package name at ./modmember.cgi line 683. Global symbol "%r" requires

Re: basename equivalent?

2007-04-27 Thread Nishi
I thing that I forgot to mention here is that I am calling the perl commands within a batch script. So I pass ACTIVESTATEPERL to the perl within the batch script and the bat file is run within the cygwin environment. Thanks, Nishi. On 4/27/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 4/27/07,

Re: basename equivalent?

2007-04-27 Thread Chas Owens
On 4/27/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 4/27/07, Nishi <[EMAIL PROTECTED]> wrote: > > So, calling the perl script explicitly as in > %ACTIVESTATEPERL%\bin\perl.exe > > solves my issue in the cygwin environment. snip I think there is some confusion here. You cannot be running %ACTIV

Re: basename equivalent?

2007-04-27 Thread Chas Owens
On 4/27/07, Nishi <[EMAIL PROTECTED]> wrote: So, calling the perl script explicitly as in %ACTIVESTATEPERL%\bin\perl.exe solves my issue in the cygwin environment. snip I think there is some confusion here. You cannot be running %ACTIVESTATEPERL%\bin\perl.exe from the "cygwin environment" as

Re: basename equivalent?

2007-04-27 Thread Nishi
So, calling the perl script explicitly as in %ACTIVESTATEPERL%\bin\perl.exe solves my issue in the cygwin environment. On 4/27/07, Nishi <[EMAIL PROTECTED]> wrote: So, I see the below output (that is diff than yours) when i run from cygwin. If I run from the cmd prompt, I see the same outpu

Re: basename equivalent?

2007-04-27 Thread Nishi
So, I see the below output (that is diff than yours) when i run from cygwin. If I run from the cmd prompt, I see the same output as yours. On 4/27/07, Nishi <[EMAIL PROTECTED]> wrote: This is what i see c:\foo\bar\baz.txt -> c:\foo\bar\baz.txt /cygdrive/c/foo/bar/baz.txt -> baz.txt which

Re: basename equivalent?

2007-04-27 Thread Nishi
This is what i see c:\foo\bar\baz.txt -> c:\foo\bar\baz.txt /cygdrive/c/foo/bar/baz.txt -> baz.txt which is different from your output. On 4/27/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 4/27/07, Nishi <[EMAIL PROTECTED]> wrote: > The issue is when i use cygwin Perl. > And the specific

Re: basename equivalent?

2007-04-27 Thread Chas Owens
On 4/27/07, Nishi <[EMAIL PROTECTED]> wrote: The issue is when i use cygwin Perl. And the specific issue is what? I have just installed cygwin on an XP box and wrote this script: #!/usr/bin/perl use strict; use warnings; use File::Basename; for my $path (qw{c:\foo\bar\baz.txt /cygdrive/c/f

Re: basename equivalent?

2007-04-27 Thread Nishi
The issue is when i use cygwin Perl. On 4/27/07, Chas Owens <[EMAIL PROTECTED]> wrote: On 4/27/07, Nishi <[EMAIL PROTECTED]> wrote: > I am having issues using File::Basename via cygwin perl. Is there a > workaround for that? Are you using cygwin's Perl or Activestate's Perl?

Re: basename equivalent?

2007-04-27 Thread Chas Owens
On 4/27/07, Nishi <[EMAIL PROTECTED]> wrote: I am having issues using File::Basename via cygwin perl. Is there a workaround for that? Are you using cygwin's Perl or Activestate's Perl? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.

Re: improving my code: array of references

2007-04-27 Thread Pierre Mariani
On Fri, 2007-04-27 at 14:26 -0400, Matthew J. Avitable wrote: > Pierre, > >> Thank you, but I got it to work the way I wanted, thanks to Matthew and > >> Rob's posts: > >> > >> map { modify_variable(${$_}) } = \($var1, $var2, $var3); > >> > > To annotate to what Paul said - the above won't wo

Re: improving my code: array of references

2007-04-27 Thread Matthew J. Avitable
Pierre, Thank you, but I got it to work the way I wanted, thanks to Matthew and Rob's posts: map { modify_variable(${$_}) } = \($var1, $var2, $var3); To annotate to what Paul said - the above won't work. The block syntax of map is "map BLOCK LIST". Plus, it looks like you are going to

Re: basename equivalent?

2007-04-27 Thread Nishi
I am having issues using File::Basename via cygwin perl. Is there a workaround for that? On 4/26/07, Xavier Noria <[EMAIL PROTECTED]> wrote: On Apr 26, 2007, at 2:34 AM, Nishi wrote: > What is the equivalent of basename? Ie if I dont want to use basename > package to get the filename off a pa

Re: File::Basename issues

2007-04-27 Thread Nishi
Yes, its the cygwin perl to be blamed. Would setting the ACTIVESTATE environment variable help? before running the scripts that contain the basename usage? Thanks, Nishi. On 4/26/07, Ken Foskey <[EMAIL PROTECTED]> wrote: On Wed, 2007-04-25 at 17:15 -0700, Nishi wrote: > Hi: > > The File::Base

Re: perl and cygwin perl (unix style paths)

2007-04-27 Thread yitzle
I believe when you run CygWin it maps the directories and all that. I think it actually "mounts" the drives etc. If you try to run '/cygdrive/c/Perl/bin/perl' in the command prompt, I don't think it will work. You should be able to use the Windows path, though: c:\Perl\bin\perl.exe "$CygWin_HOME\t

Re: improving my code: array of references

2007-04-27 Thread Paul Johnson
On Fri, Apr 27, 2007 at 09:54:37AM -0700, Pierre Mariani wrote: > Thank you, but I got it to work the way I wanted, thanks to Matthew and > Rob's posts: > > map { modify_variable(${$_}) } = \($var1, $var2, $var3); I think you'll find that syntax is incorrect. And map in void context is generall

perl and cygwin perl (unix style paths)

2007-04-27 Thread Nishi
Hi gurus: I am trying to run perl command via cygwin. I have cygwin mapped drive in which i use the locally installed perl(and not cygwin perl) but apprently, that perl is not able to find an existing file. When the same command is run via cygwin perl, it runs fine. Does perl on windows understa

Re: improving my code: array of references

2007-04-27 Thread Pierre Mariani
On Fri, 2007-04-27 at 12:45 -0400, Chas Owens wrote: > On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote: > > On Fri, 2007-04-27 at 12:03 -0400, Chas Owens wrote: > > > On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote: > > > snip > > > > > - modify_variable() doesn't appear to modify anythin

Re: improving my code: array of references

2007-04-27 Thread Chas Owens
On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote: On Fri, 2007-04-27 at 12:03 -0400, Chas Owens wrote: > On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote: > snip > > > - modify_variable() doesn't appear to modify anything, otherwise why > > > are you assigning its return value to the scal

Re: pure perl replacment for "/usr/bin/file"

2007-04-27 Thread John W. Krahn
Martin Barth wrote: > Hi, Hello, > I want to determine the character encoding of some strings I have. > Something similar to the "file" tool, http://search.cpan.org/~knok/File-MMagic-1.27/ John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of too

Re: improving my code: array of references

2007-04-27 Thread Pierre Mariani
On Fri, 2007-04-27 at 12:03 -0400, Chas Owens wrote: > On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote: > snip > > > - modify_variable() doesn't appear to modify anything, otherwise why > > > are you assigning its return value to the scalar passed as a parameter? > > > It seems to be just a fu

Re: scape . character

2007-04-27 Thread Chas Owens
On 4/27/07, Jeff Pang <[EMAIL PROTECTED]> wrote: > umm, why are you testing twice? Just capture the last digit (instead > of the whole version number) in the first regex. > >next unless /\s+\d+\.\d+\.(\d+)\s+/; >print "$1\n" > b/c he asked two questions, 1) how to capture version string

Re: Sorting the items in a directory

2007-04-27 Thread Nigel Peck
Thanks Jeff, thanks Rob. I used your solution Jeff and it's working a treat. Cheers, Nigel Rob Dixon wrote: Nigel Peck wrote: Hi, I have a list containing the names of all items in a directory. I want to sort it by non-directories first and then directories, with a secondary sort in alph

Re: improving my code: array of references

2007-04-27 Thread Chas Owens
On 4/27/07, Pierre Mariani <[EMAIL PROTECTED]> wrote: snip > - modify_variable() doesn't appear to modify anything, otherwise why > are you assigning its return value to the scalar passed as a parameter? > It seems to be just a function. Modify_variable modifies its input variable. I think the

Re: scape . character

2007-04-27 Thread Martin Barth
Hi, is your version allways number dot number dot number? or can it be.. e.g. 1.2.1a or 1.6 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: improving my code: array of references

2007-04-27 Thread John W. Krahn
Pierre Mariani wrote: > Matthew and Rob, thank you for your replies. > >> - It's unclear whether you have a fixed set of variables to process. >> Is the list always the same? > > Yes, the list is always the same. > >> - Why are you using references? Are you sure you need to? >> >> - modify_vari

Re: scape . character

2007-04-27 Thread Jeff Pang
umm, why are you testing twice? Just capture the last digit (instead of the whole version number) in the first regex. next unless /\s+\d+\.\d+\.(\d+)\s+/; print "$1\n" b/c he asked two questions, 1) how to capture version string; 2) how to capture last number from version string. surel

Re: scape . character

2007-04-27 Thread Chas Owens
On 4/27/07, Jeff Pang <[EMAIL PROTECTED]> wrote: open FILE,$file or die $!; while () { next unless /\s+(\d+\.\d+\.\d+)\s+/; my $version_str = $1; my ($lastnum) = $verison_str =~ /.*\.(\d+)/; print $lastnum,"\n"; } close FILE; snip umm, why are you testing twice? Just capture th

Re: scape . character

2007-04-27 Thread Chas Owens
On 4/27/07, Tatiana Lloret Iglesias <[EMAIL PROTECTED]> wrote: thanks a lot!! And how can I locate the version String it self in the file? bla bla bla bla bla bla 1.2.0 bla bla bla bla bla my pattern is number.number.number snip Loop over the lines of the file applying the regex as you go:

Re: scape . character

2007-04-27 Thread Jeff Pang
open FILE,$file or die $!; while () { next unless /\s+(\d+\.\d+\.\d+)\s+/; my $version_str = $1; my ($lastnum) = $verison_str =~ /.*\.(\d+)/; print $lastnum,"\n"; } close FILE; (Note for no test.) 2007/4/27, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: thanks a lot!! And how can I

Re: scape . character

2007-04-27 Thread Tatiana Lloret Iglesias
thanks a lot!! And how can I locate the version String it self in the file? bla bla bla bla bla bla 1.2.0 bla bla bla bla bla my pattern is number.number.number Thanks! T On 4/27/07, Jeff Pang <[EMAIL PROTECTED]> wrote: 2007/4/27, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: > Hi all! > >

Re: Sorting the items in a directory

2007-04-27 Thread John W. Krahn
Nigel Peck wrote: > > Hi, Hello, > I have a list containing the names of all items in a directory. I want > to sort it by non-directories first and then directories, with a > secondary sort in alphabetical order. > > I currently have: > > > my @items = sort { >

Re: scape . character

2007-04-27 Thread Jeff Pang
2007/4/27, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>: Hi all! how can I create a regular expression to find a software version pattern in a file (e.g. 1.2.0) and return the last number , i.e. 0 Hi, What's the form of your version string? Given the case of $version_str = '1.2.0',you may wri

Re: XML::Writer....Lessons Learned

2007-04-27 Thread Tom Phoenix
On 4/27/07, Dave Adams <[EMAIL PROTECTED]> wrote: Today I learned something about XML::Writer where I was using single quotes instead of double quotes and it caused me all sorts of problems later in the script. That can happen. But I can't find it happening anywhere in the code you posted. A

scape . character

2007-04-27 Thread Tatiana Lloret Iglesias
Hi all! how can I create a regular expression to find a software version pattern in a file (e.g. 1.2.0) and return the last number , i.e. 0 Thanks! T

Re: improving my code: array of references

2007-04-27 Thread Pierre Mariani
Matthew and Rob, thank you for your replies. > - It's unclear whether you have a fixed set of variables to process. > Is > the list always the same? Yes, the list is always the same. > - Why are you using references? Are you sure you need to? > > - modify_variable() doesn't appear to modify

XML::Writer....Lessons Learned

2007-04-27 Thread Dave Adams
Because I am not a very good perl programmer (but working on it) an unable to answer most of the questions from the group, I thought I could at least contribute what I have learned so I can help others that are in my position. Today I learned something about XML::Writer where I was using single q

Re: Open() and glob EXPR

2007-04-27 Thread Chas Owens
On 4/27/07, Somu <[EMAIL PROTECTED]> wrote: snip My next question is regarding opening pipes. I tried the following: open ( FH , " notepad " ); print FH 'hello' ; But its only opening the notepad application, and nothing shows up on the notepad.. snip I fear that you are trying to open the

Re: Encryption

2007-04-27 Thread Martin Barth
Hi On Fri, 27 Apr 2007 11:33:47 +0200 Andreas Moroder <[EMAIL PROTECTED]> wrote: > Hello, > > I have to calculate a hash of username and password in perl. > The calculation should be done this way: > first the easy stuff, I think you already know that answers to that: > 1. Concatenate the use

Re: Open() and glob EXPR

2007-04-27 Thread Jay Savage
Please don't top post. On 4/27/07, Somu <[EMAIL PROTECTED]> wrote: Please give me one simple example using glob.. I saw the perlopentut, and perldoc -f open, and perldoc -f glob, but i am unable to make out anything from them.. I know only how to open files which are in the same dir or child dir

Re: Open() and glob EXPR

2007-04-27 Thread Rodrick Brown
On 4/27/07, Somu <[EMAIL PROTECTED]> wrote: Please give me one simple example using glob.. I saw the perlopentut, and perldoc -f open, and perldoc -f glob, but i am unable to make out anything from them.. I know only how to open files which are in the same dir or child dir.. But suppose i am in d

Re: Regexp

2007-04-27 Thread Dr.Ruud
Somu schreef: > Ruud: >> Somu: >>> why wont the following work? >>> >>> $$^Hq = shift; >> >> print length($$^Hq), " "; >> >>> $$^Hp = "pass"; >>> if ( $$^Hq =~ m/$$^Hp/i ) { print 'match' } >>> >>> But it works on changing the $$^Hq and $$^Hp places.. > $q contains decoded msgs using MIME::Base64

Re: Sorting the items in a directory

2007-04-27 Thread Rob Dixon
Nigel Peck wrote: Hi, I have a list containing the names of all items in a directory. I want to sort it by non-directories first and then directories, with a secondary sort in alphabetical order. I currently have: my @items = sort { my $a_path = $a

Re: Sorting the items in a directory

2007-04-27 Thread Jeff Pang
I'm sorry that just be clear you want the non-directory first,then simply change the codes to: my @items = map { $_->[0] } sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] } map { -d $_ ? [$_,1] : [$_,0] } readdir DIR; 2007/4/27, Jeff Pang <[EMAIL PROTECTED]>: 2007/4/27,

Re: Sorting the items in a directory

2007-04-27 Thread Jeff Pang
2007/4/27, Nigel Peck <[EMAIL PROTECTED]>: Hi, I have a list containing the names of all items in a directory. I want to sort it by non-directories first and then directories, with a secondary sort in alphabetical order. Hello, I've tested, this could work for you. my @items = map { $_->[0]

Encryption

2007-04-27 Thread Andreas Moroder
Hello, I have to calculate a hash of username and password in perl. The calculation should be done this way: 1. Concatenate the username and the password to produce a plaintext string; 2. Convert the plaintext string to uppercase characters; 3. Convert the plaintext string to multi-byte storage

pure perl replacment for "/usr/bin/file"

2007-04-27 Thread Martin Barth
Hi, I want to determine the character encoding of some strings I have. Something similar to the "file" tool, which gives me this information: cp1252.text: Non-ISO extended-ASCII text iso-8859-1.text: ISO-8859 text, with no line terminators macintosh.text: Non-ISO extended-ASCII text utf16.te

Sorting the items in a directory

2007-04-27 Thread Nigel Peck
Hi, I have a list containing the names of all items in a directory. I want to sort it by non-directories first and then directories, with a secondary sort in alphabetical order. I currently have: my @items = sort { my $a_path = $args->{direc

Re: Open() and glob EXPR

2007-04-27 Thread Somu
Please give me one simple example using glob.. I saw the perlopentut, and perldoc -f open, and perldoc -f glob, but i am unable to make out anything from them.. I know only how to open files which are in the same dir or child dir.. But suppose i am in dir D:/Scripts/Test and i want to open another