LZMA

2008-04-15 Thread Octavian Rasnita
Hi, Does anyone know if there is a way of creating/extracting an LZMA archive with perl without using an external program? Thank you. Octavian -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: LZMA

2008-04-15 Thread Chas. Owens
On Tue, Apr 15, 2008 at 1:18 AM, Octavian Rasnita <[EMAIL PROTECTED]> wrote: > Hi, > > Does anyone know if there is a way of creating/extracting an LZMA archive > with perl without using an external program? snip Take a look at Compress::unLZMA*. * http://search.cpan.org/dist/Compress-unLZMA/lib

Re: LZMA

2008-04-15 Thread Octavian Rasnita
From: "Chas. Owens" <[EMAIL PROTECTED]> Does anyone know if there is a way of creating/extracting an LZMA archive with perl without using an external program? snip Take a look at Compress::unLZMA*. * http://search.cpan.org/dist/Compress-unLZMA/lib/Compress/unLZMA.pm Thank you. It helped

RE: grabbing text between two tokens

2008-04-15 Thread sanket vaidya
Hi, Here is the code to accomplish your task. It involves too many substitutions but it accomplishes your task. I think there should be a simpler substitution which I am not aware: use warnings; use strict; my $str = "tokena name: name1 tokenb tokena name: name2 tokenb tokena name: name3

Re: Getting more than one match with regexp

2008-04-15 Thread Jim
Many thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Troubleshooting SQL server

2008-04-15 Thread aspiritus
On 15 huhti, 03:52, [EMAIL PROTECTED] (Chas. Owens) wrote: > On Mon, Apr 14, 2008 at 7:11 PM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > > snip> > my $sql = q/SELECT Account,Last_Name,First_Name,Email_Address FROM > > > prospects WHERE Email_Address='?'/; > > > Drop the singlequotes. This way

Re: Changing case of UTF-8 strings

2008-04-15 Thread Paulo Antonio
On 14 abr, 13:25, [EMAIL PROTECTED] (Chas. Owens) wrote: [...] > Hmm, the following works for me, but then again I have > > export PERL_UNICODE=SDL #Make Perl use UTF-8 for IO > > in my .bash_profile. > Yes, that made the trick. Thanks. But I wish there was a "Perl only" way... -- To unsubs

CSV to ~XML (total newbie)

2008-04-15 Thread Travis
Hi there, Never written a line of Perl until now but I think it might be perfect for this little program I need. I have some CSV files that are given to me and I need to spit them in a format that kind of looks like XML but I don't think it is. The structure looks something like this:

CPAN force method question

2008-04-15 Thread Mathew
I looked at the CPAN perldoc but I wanted to make sure I'm looking at this right. For Bundle, Distribution, and Module, force can be called and passed a command as an argument. Can this be applied to CPAN::Shell as well? Right now I have a script which runs CPAN::Shell->install(mod_name). C

Re: CSV to ~XML (total newbie)

2008-04-15 Thread Gunnar Hjalmarsson
Travis wrote: I have some CSV files that are given to me and I need to spit them in a format that kind of looks like XML ... You forgot to mention that the problem was solved. Or wasn't it? http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/afdd2d74d2dc63e4 -- Gunnar Hjalma

blessing a hash

2008-04-15 Thread perl pra
Hi Gurus, How can I bless a hash. below is my code: package load; use strict; use warnings; sub new { my $class=shift; my %samp=('1' => "xxx", '2' => ""); } sub print { here i need to print $samp{1}

Re: Changing case of UTF-8 strings

2008-04-15 Thread Chas. Owens
On Mon, Apr 14, 2008 at 1:21 PM, Paulo Antonio <[EMAIL PROTECTED]> wrote: > On 14 abr, 13:25, [EMAIL PROTECTED] (Chas. Owens) wrote: > [...] > > > Hmm, the following works for me, but then again I have > > > > export PERL_UNICODE=SDL #Make Perl use UTF-8 for IO > > > > in my .bash_profile.

Re: blessing a hash

2008-04-15 Thread Chas. Owens
On Tue, Apr 15, 2008 at 9:54 AM, perl pra <[EMAIL PROTECTED]> wrote: > Hi Gurus, > > How can I bless a hash. > > below is my code: > > package load; > > use strict; > use warnings; > > sub new { > > my $class=shift; > my %samp=('1' => "xxx", '2' =>

Re: blessing a hash

2008-04-15 Thread Chas. Owens
On Apr 15, 2008, at 10:30, perl pra wrote: Hi Owen, yeah that true ,but theres little change in the way i build the hash,I build the hash from variables in the text file. snip package Load; use strict; use warnings; sub new { my $class=shift; my $file=shift; my %samp; open my $FH, '<'

Re: blessing a hash

2008-04-15 Thread perl pra
Hi Owen, yeah that true ,but theres little change in the way i build the hash,I build the hash from variables in the text file. The below are the datails: I have a following text file app.config - app_path=/home/ap/buuild host

Re: grabbing text between two tokens

2008-04-15 Thread Sharan Basappa
actually I tried this before posting this question. The issue is that regex stops after first match. The output is: name: name1 I did put /g at the end, but results are the same. Regards On Mon, Apr 14, 2008 at 9:11 PM, Gary Stainburn <[EMAIL PROTECTED]> wrote: > On Monday 14 April 2008 16:35,

Re: grabbing text between two tokens

2008-04-15 Thread Sharan Basappa
The issue is I have not been able to successfully install a local module so far. I have tried this in the context of Permute module and gave up after spending couple of days. My mail with subject "algorithm/permute.pm" is the one I am talking about Regards, On Mon

Re: algorithm/permute.pm

2008-04-15 Thread Sharan Basappa
On Fri, Apr 4, 2008 at 8:48 PM, Sharan Basappa <[EMAIL PROTECTED]> wrote: > Dont seem to have luck. I did make test followed by make install. > Here is what I got: > make install > Installing > /u/basappas/local/perl/Algorithm-Permute-0.06/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/auto/

Re: algorithm/permute.pm

2008-04-15 Thread Chas . Owens
Where/how did you install the module. If it was not installed in the normal directory (ie the one it will be installed in if you installed as root) you will need to either set the PERL5_LIB environmental variable or use the lib pragma. -- Chas. Owens wonkden.net The most important skill a

Re: algorithm/permute.pm

2008-04-15 Thread Rob Dixon
Sharan Basappa wrote: > On Fri, Apr 4, 2008 at 8:48 PM, Sharan Basappa <[EMAIL PROTECTED]> wrote: >> Dont seem to have luck. I did make test followed by make install. >> Here is what I got: >> make install >> Installing >> /u/basappas/local/perl/Algorithm-Permute-0.06/lib/perl5/site_perl/5.8.5/

Re: Getting more than one match with regexp

2008-04-15 Thread Dr.Ruud
Rob Dixon schreef: > Dr.Ruud: >> Rob Dixon: >>> my @files = $text =~ m#(http://.*?.mp3)"#g; >> >> Missing is escaping of the dot. >> This would lead to mismatching "http://my-mp3.mp3";. > > Thank you Ruud You're welcome. I forgot to mention that there are alternatives: my @files = $text =~

reg ex

2008-04-15 Thread Irfan.Sayed
Hi All, I need help in regular expression. I have string as follows. OMS.FD.08.03.000.14 I need only OMS.FD.08.03.000 this much part of the string.i want to exclude .14 Please help. Regards, Irfan

Re: grabbing text between two tokens

2008-04-15 Thread Gunnar Hjalmarsson
Sharan Basappa wrote: Gary Stainburn wrote: On Monday 14 April 2008 16:35, Sharan Basappa wrote: I am trying to capture the text between two tokens. These tokens always exist in pairs but can occur N times. I somehow dont get what I want. $str =~ m/tokena(.*)tokenb/ms; print $1; Try $str =~

Re: reg ex

2008-04-15 Thread Paul Johnson
On Wed, Apr 16, 2008 at 12:11:20AM +0530, [EMAIL PROTECTED] wrote: > Hi All, Hello > I need help in regular expression. I have string as follows. > > OMS.FD.08.03.000.14 > > I need only OMS.FD.08.03.000 this much part of the string.i want to > exclude .14 > > Please help. That's not much of

Re: reg ex

2008-04-15 Thread Rob Dixon
Paul Johnson wrote: > > On Wed, Apr 16, 2008 at 12:11:20AM +0530, [EMAIL PROTECTED] wrote: > >> I need help in regular expression. I have string as follows. >> >> OMS.FD.08.03.000.14 >> >> I need only OMS.FD.08.03.000 this much part of the string.i want to >> exclude .14 > > That's not much of a

Re: reg ex

2008-04-15 Thread Paul Johnson
On Tue, Apr 15, 2008 at 08:38:30PM +0100, Rob Dixon wrote: > Paul Johnson wrote: > > > > On Wed, Apr 16, 2008 at 12:11:20AM +0530, [EMAIL PROTECTED] wrote: > > > >> I need help in regular expression. I have string as follows. > >> > >> OMS.FD.08.03.000.14 > >> > >> I need only OMS.FD.08.03.000 thi

Re: CSV to ~XML (total newbie)

2008-04-15 Thread Jenda Krynicky
From: Travis <[EMAIL PROTECTED]> > Never written a line of Perl until now but I think it might be perfect > for this little program I need. > > I have some CSV files that are given to me and I need to spit them in > a format that kind of looks like XML but I don't think it is. The > structure look

Re: reg ex

2008-04-15 Thread Rob Dixon
Paul Johnson wrote: > On Tue, Apr 15, 2008 at 08:38:30PM +0100, Rob Dixon wrote: >> Paul Johnson wrote: >>> On Wed, Apr 16, 2008 at 12:11:20AM +0530, [EMAIL PROTECTED] wrote: >>> I need help in regular expression. I have string as follows. OMS.FD.08.03.000.14 I need only OM

first perl script...help anyone?

2008-04-15 Thread Meriadoc Overhill of Nobottle
HI all, I.m very new to Perl, but I've been told it's such a powerful language for text processing I wanted to try it and learn. So, I'm writing my first script which I need to process some text file. Basically that's what I want to do: I have 3 files, I want to read some informations from the firs

Re: CSV to ~XML (total newbie)

2008-04-15 Thread Travis
On Apr 15, 6:16 am, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > Travis wrote: > > I have some CSV files that are given to me and I need to spit them in > > a format that kind of looks like XML ... > > You forgot to mention that the problem was solved. Or wasn't > it?http://groups.google.com/gr

Re: first perl script...help anyone?

2008-04-15 Thread John W. Krahn
Meriadoc Overhill of Nobottle wrote: HI all, Hello, I.m very new to Perl, but I've been told it's such a powerful language for text processing I wanted to try it and learn. So, I'm writing my first script which I need to process some text file. Welcome. Basically that's what I want to do:

Regular Expression Help

2008-04-15 Thread Ley, Chung
Hi, I have a program that will take in a string that will resolve to a path where the output is going to store. The path can includes "variables" in this format "%%". The acceptable variableNames that the program will support are fixed to a list such as "Person", "Class", "Dept". This list

Re: Regular Expression Help

2008-04-15 Thread Jialin Li
my $input =q(C:\Windows\%Person%\%Class%); my @vars = $input =~ /%([^%]+)%/g; local $, = $/; print @vars; On Tue, Apr 15, 2008 at 10:20 PM, Ley, Chung <[EMAIL PROTECTED]> wrote: > Hi, > > > > I have a program that will take in a string that will resolve to a path > where the output is going

RE: Regular Expression Help

2008-04-15 Thread Ley, Chung
Thank you! This looks much cleaner. From: Jialin Li [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 15, 2008 8:56 PM To: Ley, Chung Cc: beginners@perl.org Subject: Re: Regular Expression Help my $input =q(C:\Windows\%Person%\%Class%); my @vars = $inpu

Re: Regular Expression Help

2008-04-15 Thread John W. Krahn
Ley, Chung wrote: Hi, Hello, I have a program that will take in a string that will resolve to a path where the output is going to store. The path can includes "variables" in this format "%%". The acceptable variableNames that the program will support are fixed to a list such as "Person", "Cl

CGI serverpush??

2008-04-15 Thread sanket vaidya
Hi, Kindly go through the code below. #!D:\Perl\bin\perl use warnings; use strict; my $line=""; use CGI::Push qw(:standard); do_push(-next_page=>\&refresh, -last_page=>\&done); sub refresh() { my ($cgi,$count)[EMAIL PROTECTED]; if($count>10) { return undef;