Re: substitution

2008-07-01 Thread Amit Saxena
Why don't use perl "s" operator with "e" option ? $str =~ s/([^ ]+)/$hash{\1}/ge Regards, Amit Saxena On Tue, Jul 1, 2008 at 3:57 AM, Brad Baxter <[EMAIL PROTECTED]> wrote: > On Jun 30, 4:20 pm, [EMAIL PROTECTED] (Epanda) wrote: > > Hi, > > > > I have to do a substitution of a pattern in a text

Re: Array problem

2008-07-01 Thread Amit Saxena
use $*dbh*->*quote*($str) On Tue, Jul 1, 2008 at 4:59 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Beyza wrote: > >> I have an array which has strings like; >> >> John's House >> Bla bla; >> etc, >> >> When I use them in an SQL query, perl gives an error. So, I need to >> put escape chara

AW: some question about komodo4

2008-07-01 Thread Tobias Eichner
> thanks for you help, but can you tell me how to set it? > could you tell me the detail process? Go to the software preferences: At the left panel select "Code Intelligence" and check the settings there (ensure that auto-completion is turned on generally). Now when you create a new file from

Re: substitution

2008-07-01 Thread John W. Krahn
Amit Saxena wrote: Why don't use perl "s" operator with "e" option ? $str =~ s/([^ ]+)/$hash{\1}/ge You don't need the /e option to interpolate a variable in a double quoted string and you should use $1 instead of \1 inside a double quoted string: $str =~ s/([^ ]+)/$hash{$1}/g John -- Pe

@INC and cross-platform path usage

2008-07-01 Thread Tobias Eichner
I have created a Perl library that I want to use with my programs (via require). However the Perl library should be placed at a sub-folder of the working directory (the place where the program runs). For example: /my/custom/path/ is the location of the program. /my/custom/path/libraries/ is the

mailing list

2008-07-01 Thread Harry Bennett
Hi, I am wondering if the mailinglist has plonked my email address... I have not received a digest since 22 may. If I try to subscribe (again) I get no reply either to confirm or inform me that I am already on the list. Any help? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Re: mailing list

2008-07-01 Thread Jeff Peng
On Tue, Jul 1, 2008 at 8:36 PM, Harry Bennett <[EMAIL PROTECTED]> wrote: > > I have not received a digest since 22 may. If I try to subscribe (again) I get > no reply either to confirm or inform me that I am already on the list. Try to check your system's antispam policy to see if you have filter

Re: @INC and cross-platform path usage

2008-07-01 Thread Gunnar Hjalmarsson
Tobias Eichner wrote: I have created a Perl library that I want to use with my programs (via require). However the Perl library should be placed at a sub-folder of the working directory (the place where the program runs). For example: /my/custom/path/ is the location of the program. /my/custom/

Re: substitution

2008-07-01 Thread Amit Saxena
Hi John, I am not only expanding a variable but also using that expanded variable as a key to ultimately find the value. That's why I need "e". Secondly, inside text that is to be substituted, I can use \1 as well. And moreover, for this, I don't need double quotes. If i purposefully incorporate

Re: @INC and cross-platform path usage

2008-07-01 Thread Amit Saxena
You can also set the environment variable PERL5LIB to whatever directory that contains your custom library files. Regards, Amit Saxena On Tue, Jul 1, 2008 at 6:32 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Tobias Eichner wrote: > >> I have created a Perl library that I want to use with

AW: @INC and cross-platform path usage

2008-07-01 Thread Tobias Eichner
PERL5LIB is no choice, since there would be the same issue of how to write paths a cross-platform way. > Both those methods assume that the path to the directory where the > program resides equals the current working directory. That's often the > case, but not always. Isn't the "working direct

RE: @INC and cross-platform path usage

2008-07-01 Thread Thomas Bätzler
Tobias Eichner <[EMAIL PROTECTED]> wrote: > I have created a Perl library that I want to use with my > programs (via require). However the Perl library should be > placed at a sub-folder of the working directory (the place > where the program runs). > > For example: > > /my/custom/path/ is the

RE: @INC and cross-platform path usage

2008-07-01 Thread Thomas Bätzler
Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: > Some would suggest the use of the FindBin module. It does the > right thing, but unfortunately it is known to be buggy. Actually, I wish more modules were as "buggy" as FindBin ;-) I.e. that they would work robustly for all of the common usage case

Re: substitution

2008-07-01 Thread Rob Dixon
Amit Saxena wrote: > > On Tue, Jul 1, 2008 at 4:19 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: >> >> Amit Saxena wrote: >> >>> Why don't use perl "s" operator with "e" option ? >>> >>> $str =~ s/([^ ]+)/$hash{\1}/ge >>> >> You don't need the /e option to interpolate a variable in a double quoted >

Re: @INC and cross-platform path usage

2008-07-01 Thread Rob Dixon
Tobias Eichner wrote: > > I have created a Perl library that I want to use with my programs (via > require). However the Perl library should be placed at a sub-folder of the > working directory (the place where the program runs). > > For example: > > /my/custom/path/ is the location of the progra

Re: @INC and cross-platform path usage

2008-07-01 Thread Gunnar Hjalmarsson
Thomas Bätzler wrote: Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: Some would suggest the use of the FindBin module. It does the right thing, but unfortunately it is known to be buggy. Actually, I wish more modules were as "buggy" as FindBin ;-) I.e. that they would work robustly for all of

Re: AW: @INC and cross-platform path usage

2008-07-01 Thread Gunnar Hjalmarsson
Tobias Eichner wrote: Gunnar Hjalmarsson wrote: Both those methods assume that the path to the directory where the program resides equals the current working directory. That's often the case, but not always. Isn't the "working directory" always the path where the program executes from ? No

Re: Perl Script runs to slow

2008-07-01 Thread Cheez
On Jun 30, 8:36 pm, [EMAIL PROTECTED] (Rob Dixon) wrote lots of great advice: Hi Rob, I appreciate your reply and all of the suggestion. I will see if I can get your script to work then report back. Cheers! -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

Re: Perl Script runs to slow

2008-07-01 Thread Cheez
On Jun 30, 8:47 pm, [EMAIL PROTECTED] (Icarus) wrote: > Is this homework by the way dude? > > anyway..my two cents..run them..if it works right away cool. If not, > that'll get you started.  There's more than way to do it. Hehe, sorry Icarus, this is not homework...just some old man trying to sel

DBI install

2008-07-01 Thread manojkumarg
Can any one help me out in Installing DBI in a standalone box. There is no internet connetion. I tried downloading DBI-1.48 module and tried using ppm and makefile.PL its not working. I am doing it correct or missing something?

Re: DBI install

2008-07-01 Thread Jeff Peng
On Tue, Jul 1, 2008 at 8:39 PM, <[EMAIL PROTECTED]> wrote: > Can any one help me out in Installing DBI in a standalone box. There is no > internet connetion. I tried downloading DBI-1.48 module and tried using ppm > and makefile.PL its not working. I am doing it correct or missing something? >

Re: Perl Script runs to slow

2008-07-01 Thread Cheez
On Jun 30, 8:25 pm, [EMAIL PROTECTED] (John W. Krahn) wrote: > Cheez wrote: > > Howdy, > > Hello, Hi John, thank you for your reply. I will incorporate as much of these suggestions as possible. Certainly when I get a new, more efficient script running, I will post it. Thanks again! -Dan -- To

Perl Audit Reports

2008-07-01 Thread Kingmaker
I am new to perl . I need to write a perl script to generate an audit report of a root directory and all subsequent sub-directories and files under it, the report should be able to 1. list any directories/files changes in size and content, addition, deletion of any of them. 2. It could be run for

How to get the SSL cert from a IMAP-Server?

2008-07-01 Thread Michelle Konzack
* Do not Cc: me, because I READ THIS LIST, if I write here * *Keine Cc: am mich, ich LESE DIESE LISTE wenn ich hier schreibe* Hello,

Re: about perl module uninstallation

2008-07-01 Thread Randal L. Schwartz
> "Telemachus" == Telemachus <[EMAIL PROTECTED]> writes: Telemachus> On Jun 22, 3:32 pm, [EMAIL PROTECTED] (Randal L. Schwartz) wrote: >> Note: the CPAN Shell and the CPAN-PLUS Shell are not package managers, and >> have no uninstall capability. Telemachus> Cpan-plus can uninstall, but only

Re: DBI install

2008-07-01 Thread Francisco Valladolid
Hi, if you don't have internet connection, the easy form is downloading the module via cpan. http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.605.tar.gz later you have to decompress it with : $ tar -xzvf DBI-1.605.tar.gz # cd DBI... # perl Makefile.PL # make && make install can do the wo

Re: regexp behin assertions ?

2008-07-01 Thread epanda
In fact I would like my number is not preceded by aor a I have tried that but error : s/(? epanda wrote: > > I would like to identify in a pattern a number wich is not > > >         preceded by     another number    a word or a ';' > >         followed > > by       ;number > > ~      ;\d+ > >

AW: AW: @INC and cross-platform path usage

2008-07-01 Thread Tobias Eichner
@Gunnar Hjalmarsson: > use File::Spec; > my ($vol, $progdir); > BEGIN { ($vol, $progdir) = File::Spec->splitpath( __FILE__ ) } > use lib File::Spec->catpath( $vol, $progdir, 'libraries' ); At http://perldoc.perl.org/perldata.html it is stated that __FILE__ contains the curren

kill process when file number reached...

2008-07-01 Thread onlineviewer
Hello All, I am trying to run a tcpdump and have perl kill the tcpdump once 10 files have been created by the tcpdump. Here is my code, not sure...if my logic is screwy Thanks, system "tcpdump -i bge1 -s0 -w /tmp/file.out -C 1"; sleep 2; while(true){ @array1 = `ls -l /tmp | grep files`;

Re: regexp behin assertions ?

2008-07-01 Thread Gunnar Hjalmarsson
[ Please do not top-post! ] epanda wrote: Gunnar Hjalmarsson wrote: epanda wrote: I would like to identify in a pattern a number wich is not preceded by another numbera word or a ';' followed by ;number ~ ;\d+ I have tried this s/\d+(? You probably want t

Re: substitution

2008-07-01 Thread Rob Dixon
epanda wrote: > this is not working > > here is an example of my file and I just want to replace with one > regexp > > in file1 ddd ddd by the value stored in my hash table > in file2 all d > in file3 not the first d; but all the others which is preceed by > WORD; > > in all files > no

Re: AW: AW: @INC and cross-platform path usage

2008-07-01 Thread Gunnar Hjalmarsson
Tobias Eichner wrote: @Gunnar Hjalmarsson: use File::Spec; my ($vol, $progdir); BEGIN { ($vol, $progdir) = File::Spec->splitpath( __FILE__ ) } use lib File::Spec->catpath( $vol, $progdir, 'libraries' ); At http://perldoc.perl.org/perldata.html it is stated that __FILE__ c

Re: print reference

2008-07-01 Thread onlineviewer
On Jun 30, 5:38 pm, [EMAIL PROTECTED] (Rob Dixon) wrote: > onlineviewer wrote: > > > Can someone tell me the proper syntax to print out the value in a > > reference? > > Thank you.,, > > I'm not sure what you mean. Look: > > > my $string = ''; > > open my $scalar_fh, '>>', \$string; > > So you have

Re: substitution

2008-07-01 Thread epanda
yes to distinguish in file3 the first d;, it is sufficient to avoid it by preceded WORD;\s+\d+; but I have tried that and it is not working (? epanda wrote: > > this is not working > > > here is an example of my file and I just want to replace with one > > regexp > > > in file1 ddd ddd ddd

Re: regexp behin assertions ?

2008-07-01 Thread epanda
I can show you sample on hotmail if you want. files can't be shown On 1 juil, 21:27, [EMAIL PROTECTED] (Gunnar Hjalmarsson) wrote: > [ Please do not top-post! ] > > > > epanda wrote: > > Gunnar Hjalmarsson wrote: > >> epanda wrote: > >>> I would like to identify in a pattern a number wich is not >

Re: regexp behin assertions ?

2008-07-01 Thread Gunnar Hjalmarsson
epanda wrote: Gunnar Hjalmarsson wrote: [ Please do not top-post! ] Maybe I'm dumb, but it's not clear to me what you want to achieve. It might be easier to help you if you showed us a few _examples_, both of strings that should match and strings that should not match. I can show you sam

Re: kill process when file number reached...

2008-07-01 Thread Jenda Krynicky
To: beginners@perl.org From: onlineviewer <[EMAIL PROTECTED]> Subject:kill process when file number reached... Date sent: Tue, 1 Jul 2008 11:26:42 -0700 (PDT) Organization: http://groups.google.com > Hello All, > > I am

Re: about perl module uninstallation

2008-07-01 Thread Amit Saxena
Is there a way to convert the perl packages from CPAN to binary packages in linux like rpm etc. This way, it's easy for installation, uninstallation of the modules. On Tue, Jul 1, 2008 at 9:52 PM, Randal L. Schwartz <[EMAIL PROTECTED]> wrote: > > "Telemachus" == Telemachus <[EMAIL PROTECTED

user id validation

2008-07-01 Thread Richard Lee
I am just wondering how to validate a user who is using the script?? I wanted to allow only user below to be able to user the script and was thinking about userA(userid: 1077) userB(userid: 1088) userC(userid: 1099) so, inside of script, I would put, unless ( $userid =~ /1077|1088|1099/ ) {

about Zlib

2008-07-01 Thread Rajnikant
I want to uncompress *.gz and *.tar on linux box. So is there any package which will do it for me? Can we use Zlib to do same? Thanks in advance. Rajnikant Jachak | Software Engg | Persistent Systems Limited [EMAIL PROTECTED] | Cell: +91 9822204088 | Tel: +91 (20)

RE: user id validation

2008-07-01 Thread Rajnikant
I think Work around for this is, My $usr = $ENV { USER }; If ($usr eq "userA") Go get it Else Access restricted. Rajnikant Jachak | Software Engg | Persistent Systems Limited [EMAIL PROTECTED] | Cell: +91 9822204088 | Tel: +91 (20) 3023 2479 Persistent Systems - Innovations in software

Re: user id validation

2008-07-01 Thread Amit Saxena
What if before running this perl code, I modify the 'USER' environment variable ? I have not tried like that but I feel it can be done because the environment variables are not restricted. Assuming that works, then any user can just reset the environment variable to any one among the allowed ones

Re: about perl module uninstallation

2008-07-01 Thread Randal L. Schwartz
> "Amit" == Amit Saxena <[EMAIL PROTECTED]> writes: Amit> Is there a way to convert the perl packages from CPAN to binary packages Amit> in linux like rpm etc. Not without thinking about the overlap problem by hand. This is what ActiveState does for PPM, and why the entire CPAN isn't automat

Re: user id validation

2008-07-01 Thread Randal L. Schwartz
> ""Rajnikant"" == "Rajnikant" <[EMAIL PROTECTED]> writes: "Rajnikant"> I think Work around for this is, "Rajnikant"> My $usr = $ENV { USER }; "Rajnikant"> If ($usr eq "userA") "Rajnikant">Go get it "Rajnikant"> Else "Rajnikant">Access restricted. No, you want scalar getpwwuid ($<).

RE: user id validation

2008-07-01 Thread Rajnikant
Thanks Amit. Yours is the valid doubt. The $ENV { USER } approach is not secure. I'll go with Merlyn >> my $user = getpwuid $<; >> if ($user eq "merlyn") { ... } # it's me! Rajnikant Jachak | Software Engg | Persistent Systems Limited [EMAIL PROTECTED] | Cell: +91 9822204088 | Tel: +91 (20) 302

RE: user id validation

2008-07-01 Thread Rajnikant
Is there any such way to get home directory of user? Rajnikant Jachak | Software Engg | Persistent Systems Limited [EMAIL PROTECTED] | Cell: +91 9822204088 | Tel: +91 (20) 3023 2479 Persistent Systems - Innovations in software product design,development and delivery - www.persistentsys.com

Re: user id validation

2008-07-01 Thread Randal L. Schwartz
> "Rajnikant" == Rajnikant <[EMAIL PROTECTED]> writes: Rajnikant> Is there any such way to get home directory of user? Is there any such way that this might be, perhaps, oh, a FAQ? Oh, yes, let's see. $ perldoc -q tilde Found in /usr/libdata/perl5/pod/perlfaq5.pod How can I

Re: user id validation

2008-07-01 Thread Richard Lee
Randal L. Schwartz wrote: "Rajnikant" == Rajnikant <[EMAIL PROTECTED]> writes: Rajnikant> Is there any such way to get home directory of user? Is there any such way that this might be, perhaps, oh, a FAQ? Oh, yes, let's see. $ perldoc -q tilde Found in /usr/libdata/pe

Re: user id validation

2008-07-01 Thread Randal L. Schwartz
> "Richard" == Richard Lee <[EMAIL PROTECTED]> writes: Richard> But I guess there is no way to get user id.. ? Did you miss my other answer? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Smalltalk/Perl/U

Re: user id validation

2008-07-01 Thread John W. Krahn
Randal L. Schwartz wrote: ""Rajnikant"" == "Rajnikant" <[EMAIL PROTECTED]> writes: "Rajnikant"> I think Work around for this is, "Rajnikant"> My $usr = $ENV { USER }; "Rajnikant"> If ($usr eq "userA") "Rajnikant">Go get it "Rajnikant"> Else "Rajnikant">Access restricted. No, you want

RE: user id validation

2008-07-01 Thread Rajnikant
Hey Richard, I think $< returns user id. Correct me if I'm wrong ;-). Rajnikant Jachak | Software Engg | Persistent Systems Limited [EMAIL PROTECTED] | Cell: +91 9822204088 | Tel: +91 (20) 3023 2479 Persistent Systems - Innovations in software product design,development and delivery - www.pers