Re: how to construct 2 consecutive if conditions?

2004-01-24 Thread Owen
On Sat, 24 Jan 2004 17:41:13 -0700 danield <[EMAIL PROTECTED]> wrote: > > I do have file where is: > > Summary Log (generated: Tue Apr 1 22:02:29 MST 2003) > > And I do have a script which goes through this file line by line. The > first 'if' condition checks whether I have found the line I am

the same script, the final step, and again does not do what I wnat it to do

2004-01-24 Thread danield
Hello all, Thanks to Charles and Tim, I have advanced to the final step with my script. After the script verifies that there is line (Summary Log...) and that the log is from correct year and month. I want it to find a line where is " Impressions: XX" and retrieve that value. However I g

RE: binary perl

2004-01-24 Thread Tim Johnson
Short answer: No. There are programs like PerlApp that will package the interpreter with your code and make it into an executable file, but anyone who is determined enough can still get your source from the computer's memory. Your best bet is the old "security by obscurity" approach of either

how to construct 2 consecutive if conditions?

2004-01-24 Thread danield
Hello all, I do have file where is: Summary Log (generated: Tue Apr 1 22:02:29 MST 2003) And I do have a script which goes through this file line by line. The first 'if' condition checks whether I have found the line I am interested in (Summary log...) The second 'if' then should check whether

Re: simple probability problem using PERL

2004-01-24 Thread drieux
On Jan 24, 2004, at 3:31 PM, Charles Lu wrote: $probability = { '1' => 0.1, '2' => 0.1, '3' => 0.7, '4 => 0.1 } What if you did it the other way around? my $probability= {0 => 1, 1 => 2, 9 => 4};

Re: simple probability problem using PERL

2004-01-24 Thread James Edward Gray II
On Jan 24, 2004, at 5:31 PM, Charles Lu wrote: Hi If I want to randomly generate a dice (4 side) roll, I can use the following expression: $roll = 1 + int( rand(4)); This assumes that every side of this dice has equal chance of being rolled (0.25). Thats easy. Now What if I say, that th

simple probability problem using PERL

2004-01-24 Thread Charles Lu
Hi If I want to randomly generate a dice (4 side) roll, I can use the following expression: $roll = 1 + int( rand(4)); This assumes that every side of this dice has equal chance of being rolled (0.25). Thats easy. Now What if I say, that the probability of rolling a 3 is 70% and the pro

Re: binary perl

2004-01-24 Thread Dan Anderson
On Fri, 2004-01-23 at 20:44, Dan Brow wrote: > Is it possible to make a perl script/program a binary file? There is an experimental perl compiler. It's not recommended for production use but is a cool toy. When Perl 6 comes out that will all change though... -Dan -- To unsubscribe, e-mail:

Re: binary perl

2004-01-24 Thread Bob Showalter
Dan Brow wrote: > Is it possible to make a perl script/program a binary file? For bundling, yes. For hiding source, not really. > I have a > few scripts some one wants but I don't want them to have the source. > I tried perlcc but I want it to remain perl not c, if that's possible > or realisti

Re: can i do it with perl ?

2004-01-24 Thread drieux
On Jan 24, 2004, at 12:48 PM, Dan Anderson wrote: On Fri, 2004-01-23 at 20:49, John McKown wrote: On Fri, 23 Jan 2004, Dan Anderson wrote: Give me a little bit of time with a soldering iron, some wire, and a laptop connected to your home network and your dishwasher and that can be rectified. :-D

Re: can i do it with perl ?

2004-01-24 Thread Dan Anderson
On Fri, 2004-01-23 at 20:49, John McKown wrote: > On Fri, 23 Jan 2004, Dan Anderson wrote: > > > > > Give me a little bit of time with a soldering iron, some wire, and a > > laptop connected to your home network and your dishwasher and that can > > be rectified. :-D > > > > -Dan > > I don't th

Top-of-the-page format

2004-01-24 Thread Perl
I am printing a report and use this FORMAT function. However, I just want it to print once, not the default of once every 60 lines. I've read the special variable "$=" is what governs it but not matter what I put in there, it still doesn't stop it. How do I disable this? Thanks. --Paul

installing Tk on macosx 10.2.6

2004-01-24 Thread Johan Meskens CS3 jmcs3
- installing Tk on macosx 10.2.6 with perl 5.6 hola i agree it is not a pure perl question yet but it will be one soon i downloaded Tk800.025.tar.gz from cpan % perl Makefile.pl gives me this outpouring : perl is installed in /System/Library/Perl/darwin okay PPM for perl5.006 Test Compiling conf

Re: Regexp help

2004-01-24 Thread John McKown
On Sat, 24 Jan 2004, Marcelo wrote: > Which regular expression would you use to remove the and > from a line like this one: > > Here goes a webpage's title > > Thanks a lot in advance. > Did you what that _exact_ input? I.e. always ...? If so, that's rather easy. $line =~ s/(.*)<\/title>

RE: Why is this not a match?

2004-01-24 Thread Charles K. Clarkson
danield <[EMAIL PROTECTED]> wrote: : : I am unable to find out why is this not matching: : :[snip] : : if ( / Summary Log (generated:/ ) { The open parenthesis '(' has to be escaped. if ( / Summary Log \(generated:/ ) { HTH, Charles K. Clarkson -- Head Bottle Washer, Clarkson En

Why is this not a match?

2004-01-24 Thread danield
Hello All, I am unable to find out why is this not matching: I do have a file where the second line contains: Summary Log (generated: Tue Apr 1 22:02:29 MST 2003) I am processing this file by this script: #!usr/bin/perl -w use strict; use Fcntl qw[:flock]; my $impressions = 0; my $iofile =

Re: String concatenation qn

2004-01-24 Thread drieux
On Jan 23, 2004, at 5:24 PM, wolf blaum wrote: For Quality purpouses, Ajey Kulkarni 's mail on Saturday 24 January 2004 17:52 may have been monitored or recorded as: i would like to quickly append a string to a variable. open NEWFH, "> $filename.new" or die "new procmailrc err"; where $filename

Re: Is it necessary to set the headers when using LWP::UserAgent->post

2004-01-24 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Dan Anderson) writes: >I noticed in the POD for LWP::UserAgent that the post method doesn't >have an option to add headers. Are headers (like UserAgent:) not needed >for POSTing? Or am I missing how to do it? Sure you can add headers explicitly

Re: binary perl

2004-01-24 Thread Wiggins d'Anconia
Dan Brow wrote: Is it possible to make a perl script/program a binary file? I have a few scripts some one wants but I don't want them to have the source. I tried perlcc but I want it to remain perl not c, if that's possible or realistic. thanks, Dan. perldoc -q 'hide the source' http://danconi

Re: interfacing with Python using Perl

2004-01-24 Thread Andrew Gaffney
Jeff 'japhy' Pinyan wrote: On Jan 23, Andrew Gaffney said: I don't know Python and I really have no desire to learn it, but I do have a decent amount of experience with Perl. Is there a module(s) that will let Perl interface with existing Python code/modules? Specifically, I want to write a Perl

Re: Regexp help

2004-01-24 Thread Andrew Gaffney
Marcelo wrote: Which regular expression would you use to remove the and from a line like this one: Here goes a webpage's title Thanks a lot in advance. Try something like: s/<\/?title>// Although, I can remember if < and > are special regex characters so you might need to escape them (\< and

Re: Array creation with a existing variable

2004-01-24 Thread Ravi Malghan
Wiggins: basically what I was trying to do is track a counter value for each router in my network. These routers may come and go. At some time I may have 10 routers at other times 100. $Counter{$router1} = {n1, n2, n3, ...nN} $Counter{$router2} = {m1, m2, m3, ...mN} ... $Counter{$routerX} = I

netadmin & change password

2004-01-24 Thread Saadat Saeed
Hello, I have been reading about the change password function in NetAdmin (Win32). Now it says I need to input the old password. What is I am in the domain admin group and I do not know the old password. Any thingy in perl that'll help me change local computer user accounts without needed to know

Regexp help

2004-01-24 Thread Marcelo
Which regular expression would you use to remove the and from a line like this one: Here goes a webpage's title Thanks a lot in advance.

binary perl

2004-01-24 Thread Dan Brow
Is it possible to make a perl script/program a binary file? I have a few scripts some one wants but I don't want them to have the source. I tried perlcc but I want it to remain perl not c, if that's possible or realistic. thanks, Dan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona