Re: Need some module help

2009-07-09 Thread Jim Gibson
At 9:58 PM -0700 7/9/09, Travis Thornhill wrote: I'm trying to learn to develop Perl modules in an effort to have clean directory structure and more reusable code. I'm hitting a little snag in my test code that I don't quite understand. I'm hoping someone can help explain where I may be going

Re: Need some module help

2009-07-09 Thread Chas. Owens
On Fri, Jul 10, 2009 at 00:58, Travis Thornhill wrote: snip > Can't locate object method "new" via package "myMod" (perhaps you forgot to > load "myMod"?) at uses_Mod.pl line 11. snip > my $obj = myMod->new(); # <- THIS IS THE LINE THAT ERRORS snip > package Mod::myMod; snip The package is na

Need some module help

2009-07-09 Thread Travis Thornhill
I'm trying to learn to develop Perl modules in an effort to have clean directory structure and more reusable code. I'm hitting a little snag in my test code that I don't quite understand. I'm hoping someone can help explain where I may be going wrong here. The error I'm receiving is this: ln0

Re: Help Me

2009-07-09 Thread Chas. Owens
On Thu, Jul 9, 2009 at 15:18, Umar Draz wrote: > Dear User! > > I want to get all telephone and mobile number from a string and save into a > variable. Here is my example what i am doing. > > #!/usr/bin/perl > > $str = "This is my string my mobile number is 0300-4459899, 042-8494949 > 041-8580880

Re: Help Me

2009-07-09 Thread Steve Bertrand
Umar Draz wrote: > Dear User! > > I want to get all telephone and mobile number from a string and save into a > variable. Here is my example what i am doing. > > #!/usr/bin/perl > > $str = "This is my string my mobile number is 0300-4459899, 042-8494949 > 041-8580880 now the string is complete

Help Me

2009-07-09 Thread Umar Draz
Dear User! I want to get all telephone and mobile number from a string and save into a variable. Here is my example what i am doing. #!/usr/bin/perl $str = "This is my string my mobile number is 0300-4459899, 042-8494949 041-8580880 now the string is complete" while($line =~ /(([0-9]{3,4}[-]?

Re: Edit a config file using perl cgi script

2009-07-09 Thread Randal L. Schwartz
> "Eric" == Eric Veith writes: Eric> sudo perl -e 'open($fh, "<", "/tmp/foo"); @f = <$fh>; close($fh); open($fh, Eric> ">", "/tmp/foo"); foreach(@f) { s/^(Key1=).*/$1NewValue1/; print $fh $_; } Eric> close($fh);' Eric> As always, TIMTOWTDI. Much easier way is in-place editing: perl -pi.ba

Re: Edit a config file using perl cgi script

2009-07-09 Thread Eric Veith
A config file in /etc is just another "data" file. Your problem has nothing to do with Perl itself, as it seems. You need to look up how to configure your web server to allow suexec for a script. And, normally, it is not a good idea to let the webserver edit files in /etc, but you'll probably know

Re: Edit a config file using perl cgi script

2009-07-09 Thread Eric Veith
sudo perl -e 'open($fh, "<", "/tmp/foo"); @f = <$fh>; close($fh); open($fh, ">", "/tmp/foo"); foreach(@f) { s/^(Key1=).*/$1NewValue1/; print $fh $_; } close($fh);' As always, TIMTOWTDI. HTH, -- Eric, Alpesh Naik wrote on 07/09/2009 11:34:43 AM: > From:> > > Alpesh Naik > > To: > >

Re: Edit a config file using perl cgi script

2009-07-09 Thread Jenn G.
On Thu, Jul 9, 2009 at 5:34 PM, Alpesh Naik wrote: > > For eg: below is what I have in the config file "configfile.cfg". > > Key1=OldValue1 > Key2=OldValue2 > > I want to search for "Key1" and change "OldValue1" to "NewValue1" Read the content into memory, search the key (i.e, use a regex) and rep

Edit a config file using perl cgi script

2009-07-09 Thread Alpesh Naik
Hi, I need to edit a config file using perl cgi script. i.e., Search with the 'key' string and edit the 'value'. For eg: below is what I have in the config file "configfile.cfg". Key1=OldValue1 Key2=OldValue2 I want to search for "Key1" and change "OldValue1" to "NewValue1" *(Note that, permi

Re: Help needed with '-e' operator

2009-07-09 Thread Anu P
Hi Robert, I am sorry for the typos in the mail.. Actually the file is tar.gz only, Tar.gz was a typo, and secondly the error message was still showing as .tar.gz does not exist but again it was a mistake from my end. Actually your response helped me get the solution. I figured out that we wer

Re: Help needed with '-e' operator

2009-07-09 Thread Robert Citek
On Wed, Jul 8, 2009 at 6:57 PM, John Refior wrote: > On Wed, Jul 8, 2009 at 7:34 AM, Anu P wrote: > >> I am trying to use the '-e' filetest operator and encountered some wired >> behavior. >> I have a tar.gz file which is around 2.6 G and this is the code...Tar.gz >> file is in the same directory