Stop sent the mail to me
Stop the mail On 10/7/11, Marc sono...@fannullone.us wrote: On Sep 8, 2011, at 10:13 AM, Rob Dixon wrote: my $string = 'The Kcl Group'; $string =~ s/\b([aeiouy]{3,4}|[^aeiouy]{3,4})\b/\U$1/ig; print $string, \n; I'd like to revisit this, if I could. I've modified the above regex so as not to capitalize ordinal numbers, however I've noticed that it produces incorrect output if the word has an apostrophe. Given: my $string = rex's chicken on 51st st. at lkj; $string =~ s/\b([aeiouy]{3,4}|[^aeiouy0123456789]{3,4})\b/uc($1)/eg; the output is: Rex'S Chicken on 51st ST. at LKJ It should be: Rex's Chicken on 51st St. at LKJ I Googled and tried everything I'd found, but I can't fix it. Again, that line should capitalize 3 and 4 letter words that have either all vowels or all capitals. The code I found below works great for capitalization except for that one regex which throws a wrench into it. Thanks, Marc --- # http://daringfireball.net/2008/08/title_case_update use strict; use warnings; use utf8; use open qw( :encoding(UTF-8) :std ); my @small_words = qw( (?!q)a an and as at(?!t) but by en for if in of on or the to v[.]? via vs[.]? ); my $small_re = join '|', @small_words; my $apos = qr/ (?: ['’] [[:lower:]]* )? /x; my $string = rex's chicken on 51st st at lkj; $string =~ s{ \b (_*) (?: ( [-_[:alpha:]]+ [@.:/] [-_[:alpha:]@.:/]+ $apos ) # URL, domain, or email | ( (?i: $small_re ) $apos ) # or small word (case-insensitive) | ( [[:alpha:]] [[:lower:]'’()\[\]{}]* $apos ) # or word w/o internal caps | ( [[:alpha:]] [[:alpha:]'’()\[\]{}]* $apos ) # or some other word ) (_*) \b }{ $1 . ( defined $2 ? $2 # preserve URL, domain, or email : defined $3 ? \L$3 # lowercase small word : defined $4 ? \u\L$4 # capitalize word w/o internal caps : $5 # preserve other kinds of word ) . $6 }exgo; $string =~ # exceptions for small words: capitalize at start and end of title s{ ( \A [[:punct:]]* # start of title... | [:.;?!][ ]+ # or of subsentence... | [ ]['“‘(\[][ ]* ) # or of inserted subphrase... ( $small_re ) \b # ... followed by small word }{ $1\u\L$2 }xigo; $string =~ s{ \b ( $small_re ) # small word... (?= [[:punct:]]* \Z # ... at the end of the title... | ['’†)\]] [ ] ) # ... or of an inserted subphrase? }{ \u\L$1 }xigo; $string =~ s/\b([aeiouy]{3,4}|[^aeiouy0123456789]{3,4})\b/uc($1)/eg; print $string \n; print $string \n; -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ -- Sent from my mobile device -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Stop the mail to me
Stop mail On 10/6/11, Chris Stinemetz chrisstinem...@gmail.com wrote: trying to learn smart matching in an exercise. Why does this program output odd when I input an even number? Thank you, Chris #!/usr/bin/perl use warnings; use strict; use 5.010; say Checking the number $ARGV[0]; my $favorite = 62; given( $ARGV[0] ) { when( ! /^\d+$/ ) { say Not a number! } my @divisors = divisors( $ARGV[0] ); when( @divisors ~~ 2 ) { # 2 is in @divisors say $_ is even; continue; } when( !( @divisors ~~ 2 ) ) { # 2 isn't in @divisors say $_ is odd!; continue; } when( @divisors ~~ $favorite ) { say $_ is divisible by my favorite number; continue; } when( $favorite ) { # $_ ~~ $favorite say $_ is my favorite number; continue; } my @empty; when( @divisors ~~ @empty ) { say Number is prime } default { say $_ is divisible by @divisors } } sub divisors { my $number = shift; my @divisors = (); foreach my $divisor ( 2 .. ($ARGV[0]/2 + 1) ) { push @divisors, $divisor unless $number % $divisor; } return @divisors; -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ -- Sent from my mobile device -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Stop the mail to me
To unsubscribe, e-mail: beginners-unsubscr...@perl.org Read the footer of the mail
Re: Stop the mail to me
Stop spamming us with stop mail requests and use the instructions included at the bottom of the email to unsubscribe. To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ On Fri, Oct 7, 2011 at 6:24 AM, ganesh vignesh vigneshganes...@gmail.comwrote: Stop mail On 10/6/11, Chris Stinemetz chrisstinem...@gmail.com wrote: trying to learn smart matching in an exercise. Why does this program output odd when I input an even number? Thank you, Chris #!/usr/bin/perl use warnings; use strict; use 5.010; say Checking the number $ARGV[0]; my $favorite = 62; given( $ARGV[0] ) { when( ! /^\d+$/ ) { say Not a number! } my @divisors = divisors( $ARGV[0] ); when( @divisors ~~ 2 ) { # 2 is in @divisors say $_ is even; continue; } when( !( @divisors ~~ 2 ) ) { # 2 isn't in @divisors say $_ is odd!; continue; } when( @divisors ~~ $favorite ) { say $_ is divisible by my favorite number; continue; } when( $favorite ) { # $_ ~~ $favorite say $_ is my favorite number; continue; } my @empty; when( @divisors ~~ @empty ) { say Number is prime } default { say $_ is divisible by @divisors } } sub divisors { my $number = shift; my @divisors = (); foreach my $divisor ( 2 .. ($ARGV[0]/2 + 1) ) { push @divisors, $divisor unless $number % $divisor; } return @divisors; -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ -- Sent from my mobile device -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Please Stop (Was: environment variables in perl)
Could someone please remove lel...@claimspages.com from the mailing list so I won't get any more of these annoying messages? Original Message Subject: Re: Re: environment variables in perl Date: Mon, 18 Jul 2011 09:31:05 -0400 From: RightFax E-mail Gatewaylel...@del-exchange1.nationwide.net To: shawnhco...@gmail.com Valid fax destination information could not be found in your mail message. The message was discarded. Examples of properly formatted messages: /name=frank/fax=3217...@faxgate.company.com Frank Smith /name=frank/fax=3217453/ faxg...@company.com The original message information follows: Received: from mx.npci.net ([10.0.1.60]) by mail.claimspages.com with Microsoft SMTPSVC(5.0.2195.7381); Mon, 18 Jul 2011 09:30:33 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.npci.net (Postfix) with ESMTP id 1DA252E46D7 for lel...@claimspages.com; Mon, 18 Jul 2011 13:30:33 + (UTC) X-Virus-Scanned: amavisd-new at nationwide.net, cpdev20.com, claimspages.com Received: from mx.npci.net ([127.0.0.1]) by localhost (del-mx1.nationwide.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MI6gJtK7KlS8 for lel...@claimspages.com; Mon, 18 Jul 2011 09:30:28 -0400 (EDT) Received: from x6.develooper.com (x6.develooper.com [207.171.7.86]) by mx.npci.net (Postfix) with ESMTP id 39AAA2E4605 for lel...@claimspages.com; Mon, 18 Jul 2011 09:30:28 -0400 (EDT) Received: from lists-nntp.develooper.com (localhost.localdomain [127.0.0.1]) by x6.develooper.com (Postfix) with SMTP id 36BB117AFD for lel...@claimspages.com; Mon, 18 Jul 2011 06:30:27 -0700 (PDT) Received: (qmail 9521 invoked by uid 514); 18 Jul 2011 13:29:50 - Mailing-List: contact beginners-h...@perl.org; run by ezmlm Precedence: bulk List-Post: mailto:beginners@perl.org List-Help: mailto:beginners-h...@perl.org List-Unsubscribe: mailto:beginners-unsubscr...@perl.org List-Subscribe: mailto:beginners-subscr...@perl.org List-Id: beginners.perl.org Delivered-To: mailing list beginners@perl.org Received: (qmail 9512 invoked from network); 18 Jul 2011 13:29:50 - Received: from x1.develooper.com (207.171.7.70) by x6.develooper.com with SMTP; 18 Jul 2011 13:29:50 - Received: (qmail 26240 invoked by uid 225); 18 Jul 2011 13:29:50 - Delivered-To: beginners@perl.org Received: (qmail 26236 invoked by alias); 18 Jul 2011 13:29:49 - X-Spam-Check-By: la.mx.develooper.com Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 18 Jul 2011 06:29:44 -0700 Received: by vws4 with SMTP id 4so3098673vws.14 for beginners@perl.org; Mon, 18 Jul 2011 06:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=0oU4EoHhRGGQ+TFWKrCgE8L4pIxsgHBURGWQoZr08zo=; b=vyA9wm2NsoAHFInyWqaAcgbA/r4ZD0qNVc+GISayCEfhqPXBJp/IYx3tPpPXUlbpzx yqJvuwmYlTsvW79qzA/sJiX2RPz/hVElxvy8Ne7lxlIre/W3XiTcIrXOgTBpabZtpDlb 7R+qlmo6qSEIK414Q5LVeoIm4WTVqceWJTxJo= Received: by 10.52.174.113 with SMTP id br17mr2061178vdc.107.1310995780751; Mon, 18 Jul 2011 06:29:40 -0700 (PDT) Received: from [192.168.2.11] (bas3-ottawa10-1279403673.dsl.bell.ca [76.66.38.1 53]) by mx.google.com with ESMTPS id pm1sm1853114vcb.33.2011.07.18.06.29.39 (version=SSLv3 cipher=OTHER); Mon, 18 Jul 2011 06:29:39 -0700 (PDT) Message-ID: 4e243542.9060...@gmail.com Date: Mon, 18 Jul 2011 09:29:38 -0400 From: Shawn H Corey shawnhco...@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/201106 17 Thunderbird/3.1.11 MIME-Version: 1.0 To: beginners@perl.org Subject: Re: environment variables in perl References: 1310988574.50369.yahoomail...@web125509.mail.ne1.yahoo.com 4e241ca7.2080...@gmail.com op.vytgucdan4y...@xenpad.fritz.box In-Reply-To: op.vytgucdan4y...@xenpad.fritz.box Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-Path: beginners-return-117932-lellis=claimspages@perl.org X-OriginalArrivalTime: 18 Jul 2011 13:30:33.0204 (UTC) FILETIME=[DEA54340:01CC4 54E] On 11-07-18 09:24 AM, Christian Walde wrote: On Mon, 18 Jul 2011 13:44:39 +0200, Shawn H Corey shawnhco...@gmail.com wrote: In Windows, there is only one environment. That means if a child process changes it, its parent can access the change. In Linux, each process has its own environment. The child process inherits its parent's at the time of the fork and each is independent thereafter. That is most certainly not the case. On Windows %ENV behaves like it does on Linux: https://gist.github.com/899a1385b703bba7f552 OK, that makes things easier. Use `perldoc perlipc` for both. -- Just my 0.0002 million dollars worth, Shawn
Extract substring from offset to space or full stop
I used MySQL substr function to extra 100 characters from the result of a query, but understandably, I don't get what I want. Now I looked at Perl's substr function and it doesn't look like it can help me achieve what I need to. Let's say I have: $s = The black cat climbed the green tree; $substring = substr( $s, 1, 15); # this will return The black cat c. How can I have this return the whole word climbed rather than the c (i.e. I need to get The black cat climbed)? I need to get the remaining characters from the length till the next white space or end of a phrase. Any other way to overcome this limitation? How can I use regex here?
Re: Extract substring from offset to space or full stop
Hi Mimi, How can I have this return the whole word climbed rather than the c (i.e. I need to get The black cat climbed)? I need to get the remaining characters from the length till the next white space or end of a phrase. Any other way to overcome this limitation? How can I use regex here? This might work for you I guess: Code #!/usr/bin/perl $s = The black cat climbed the green tree; $count = 50; $s =~ /(^[\S\s]{1,$count}\S*)(\s.*|$)/; print $1\n; /Code when $count is 30, it prints: The black cat climbed the green when $count is 50, it prints: The black cat climbed the green tree My knowledge in Perl is limited, so there may be a more apt solution in your case. Regards, Akhthar Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity - Dennie Richie On Sunday 18 Apr 2010, Mimi Cafe wrote: I used MySQL substr function to extra 100 characters from the result of a query, but understandably, I don't get what I want. Now I looked at Perl's substr function and it doesn't look like it can help me achieve what I need to. Let's say I have: $s = The black cat climbed the green tree; $substring = substr( $s, 1, 15); # this will return The black cat c. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Extract substring from offset to space or full stop
Mimi Cafe wrote: $s = The black cat climbed the green tree; $substring = substr( $s, 1, 15); # this will return The black cat c. How can I have this return the whole word climbed rather than the c (i.e. I need to get The black cat climbed)? I need to get the remaining characters from the length till the next white space or end of a phrase. #!/usr/bin/perl use strict; use warnings; my $str = The black cat climbed the green tree; print string: $str\n; $str =~ m{ \A ( .{15} .*? ) \s }msx; my $extracted = $1; print extracted: $extracted\n; __END__ -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. I like Perl; it's the only language where you can bless your thingy. Eliminate software piracy: use only FLOSS. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Extract substring from offset to space or full stop
Hi Shawn, $str =~ m{ \A ( .{15} .*? ) \s }msx; I don't think this would work if the value given in the match string (15 as per above eg.) is greater than the character count of the particular string. Right? Regards, Akhthar Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity - Dennie Richie On Sunday 18 Apr 2010, Shawn H Corey wrote: #!/usr/bin/perl use strict; use warnings; my $str = The black cat climbed the green tree; print string: $str\n; my $extracted = $1; print extracted: $extracted\n; -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
RE: Extract substring from offset to space or full stop
Hi, It works fine and I like it. My regex is not that good, but I can see what is doing. I modified it a bit (to capture up till a full stop sign). Code #!/usr/bin/perl # use strict; use warnings; # my $str = The black cat is trying to climbed the green tree. This time it failed.; print string: $str\n; my $sbstr = substr $str, 0,17; print The substr function with length 17 will capture: $sbstr\n; $str =~ m{ \A ( .{17} .*?\. ) \s }msx; my $extracted = $1; print The pattern with quantifier set 17, extracted: $extracted\n; Code Code Outputs: string: The black cat is trying to climbed the green tree. This time it failed. The substr function with length 17 will capture: The black cat is The pattern with quantifier set 17, extracted: The black cat is trying to climbed the green tree. Cool -Original Message- From: Akhthar Parvez K [mailto:akht...@sysadminguide.com] Sent: 18 April 2010 15:45 To: beginners@perl.org Subject: Re: Extract substring from offset to space or full stop Hi Shawn, $str =~ m{ \A ( .{15} .*? ) \s }msx; I don't think this would work if the value given in the match string (15 as per above eg.) is greater than the character count of the particular string. Right? Regards, Akhthar Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity - Dennie Richie On Sunday 18 Apr 2010, Shawn H Corey wrote: #!/usr/bin/perl use strict; use warnings; my $str = The black cat climbed the green tree; print string: $str\n; my $extracted = $1; print extracted: $extracted\n; -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Extract substring from offset to space or full stop
Hi, It works fine and I like it. My regex is not that good, but I can see what is doing. I modified it a bit (to capture up till a full stop sign). Kewl. Good to hear that! Regards, Akhthar Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity - Dennie Richie On Sunday 18 Apr 2010, Mimi Cafe wrote: Hi, Code #!/usr/bin/perl # use strict; use warnings; # my $str = The black cat is trying to climbed the green tree. This time it failed.; print string: $str\n; my $sbstr = substr $str, 0,17; print The substr function with length 17 will capture: $sbstr\n; $str =~ m{ \A ( .{17} .*?\. ) \s }msx; my $extracted = $1; print The pattern with quantifier set 17, extracted: $extracted\n; Code Code Outputs: string: The black cat is trying to climbed the green tree. This time it failed. The substr function with length 17 will capture: The black cat is The pattern with quantifier set 17, extracted: The black cat is trying to climbed the green tree. Cool -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Extract substring from offset to space or full stop
Akhthar Parvez K wrote: Hi Shawn, $str =~ m{ \A ( .{15} .*? ) \s }msx; I don't think this would work if the value given in the match string (15 as per above eg.) is greater than the character count of the particular string. Right? No, it will fail if $str is less than 15 characters. Try: #!/usr/bin/perl use strict; use warnings; for my $str ( The black cat climbed the green tree, 'A test' ){ my $extracted = extract( $str ); print string: $str\n; print string: $extracted\n; } sub extract { my $str = shift @_; $str =~ m{ \A ( .{0,15} .*? ) \s }msx; my $extracted = $1; return $extracted; } __END__ -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. I like Perl; it's the only language where you can bless your thingy. Eliminate software piracy: use only FLOSS. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Extract substring from offset to space or full stop
Mimi Cafe wrote: I used MySQL substr function to extra 100 characters from the result of a query, but understandably, I don't get what I want. Now I looked at Perl's substr function and it doesn't look like it can help me achieve what I need to. Let's say I have: $s = The black cat climbed the green tree; $substring = substr( $s, 1, 15); # this will return The black cat c. No it will not. It will return he black cat cl because in perl offsets start at 0 and not 1: $ perl -le' my $s = The black cat climbed the green tree; my $substring = substr( $s, 1, 15 ); print $substring; ' he black cat cl How can I have this return the whole word climbed rather than the c (i.e. I need to get The black cat climbed)? I need to get the remaining characters from the length till the next white space or end of a phrase. Any other way to overcome this limitation? How can I use regex here? $ perl -le' my $s = The black cat climbed the green tree; my $length = length $s; my ( $substring ) = $s =~ / \A ( .{15,$length}? \b ) /x; print $substring; ' The black cat climbed John -- The programmer is fighting against the two most destructive forces in the universe: entropy and human stupidity. -- Damian Conway -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Extract substring from offset to space or full stop
It is a bit tricky. Just tried it and Perl warned: The string is: The black cat is. Can't do {n,m} with n m in regex; marked by -- HERE in m/ \A ( .{19,18} -- HERE ?\s+ \b ) / at substr.pl line 10. My strings are not fixed length, but I do they are normally longer that the offset I used, so I should be fine I think. Mimi -Original Message- From: John W. Krahn [mailto:jwkr...@shaw.ca] Sent: 18 April 2010 17:03 To: Perl Beginners Subject: Re: Extract substring from offset to space or full stop Mimi Cafe wrote: I used MySQL substr function to extra 100 characters from the result of a query, but understandably, I don't get what I want. Now I looked at Perl's substr function and it doesn't look like it can help me achieve what I need to. Let's say I have: $s = The black cat climbed the green tree; $substring = substr( $s, 1, 15); # this will return The black cat c. No it will not. It will return he black cat cl because in perl offsets start at 0 and not 1: $ perl -le' my $s = The black cat climbed the green tree; my $substring = substr( $s, 1, 15 ); print $substring; ' he black cat cl How can I have this return the whole word climbed rather than the c (i.e. I need to get The black cat climbed)? I need to get the remaining characters from the length till the next white space or end of a phrase. Any other way to overcome this limitation? How can I use regex here? $ perl -le' my $s = The black cat climbed the green tree; my $length = length $s; my ( $substring ) = $s =~ / \A ( .{15,$length}? \b ) /x; print $substring; ' The black cat climbed John -- The programmer is fighting against the two most destructive forces in the universe: entropy and human stupidity. -- Damian Conway -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Extract substring from offset to space or full stop
Mimi Cafe wrote: From: John W. Krahn [mailto:jwkr...@shaw.ca] Mimi Cafe wrote: I used MySQL substr function to extra 100 characters from the result of a query, but understandably, I don't get what I want. Now I looked at Perl's substr function and it doesn't look like it can help me achieve what I need to. Let's say I have: $s = The black cat climbed the green tree; How can I have this return the whole word climbed rather than the c (i.e. I need to get The black cat climbed)? I need to get the remaining characters from the length till the next white space or end of a phrase. Any other way to overcome this limitation? How can I use regex here? $ perl -le' my $s = The black cat climbed the green tree; my $length = length $s; my ( $substring ) = $s =~ / \A ( .{15,$length}? \b ) /x; print $substring; ' The black cat climbed It is a bit tricky. Just tried it and Perl warned: The string is: The black cat is. Can't do {n,m} with n m in regex; marked by -- HERE in m/ \A ( .{19,18} -- HERE ?\s+ \b ) / at substr.pl line 10. My strings are not fixed length, but I do they are normally longer that the offset I used, so I should be fine I think. $ perl -le' my $s = The black cat climbed the green tree; my $end = length $s; my $start = $end 15 ? $end : 15; my ( $substring ) = $s =~ / \A ( .{$start,$end}? \b ) /x; print $substring; ' The black cat climbed John -- The programmer is fighting against the two most destructive forces in the universe: entropy and human stupidity. -- Damian Conway -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: Extract substring from offset to space or full stop
$str =~ m{ \A ( .{0,15} .*? ) \s }msx; Yeah, this would do. I talked about the scenario where you didn't put {0,15}, but just {15}. In that case, it wouldn't work if the value given in the match string (15 as per above eg.) is greater than the character count of the particular string (36). Code my $str = The black cat climbed the green tree; print string: $str\n; $str =~ m{ \A ( .{50} .*? ) \s }msx; my $extracted = $1; print extracted: $extracted\n; ?Code Result: string: The black cat climbed the green tree Use of uninitialized value in concatenation (.) or string at scripts/test/test2.pl line 14. extracted: But it worked for the OP (the above condition may not have been required for him) and that's what is important :-) Regards, Akhthar Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity - Dennie Richie On Sunday 18 Apr 2010, Shawn H Corey wrote: Akhthar Parvez K wrote: Hi Shawn, $str =~ m{ \A ( .{15} .*? ) \s }msx; I don't think this would work if the value given in the match string (15 as per above eg.) is greater than the character count of the particular string. Right? No, it will fail if $str is less than 15 characters. Try: #!/usr/bin/perl use strict; use warnings; for my $str ( The black cat climbed the green tree, 'A test' ){ my $extracted = extract( $str ); print string: $str\n; print string: $extracted\n; } sub extract { my $str = shift @_; my $extracted = $1; return $extracted; } __END__ -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. I like Perl; it's the only language where you can bless your thingy. Eliminate software piracy: use only FLOSS. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: PLEASE STOP SENDING MIALS
Shawn == Shawn H Corey shawnhco...@gmail.com writes: Shawn Alok Alan wrote: Shawn There is nothing that can be done about mials but if you don't want emails, Shawn see: http://lists.cpan.org/showlist.cgi?name=beginners I don't want any Mials either. I don't know what they are, but they can't be good. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/ Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
PLEASE STOP SENDING MIALS
Re: PLEASE STOP SENDING MIALS
Alok Alan wrote: There is nothing that can be done about mials but if you don't want emails, see: http://lists.cpan.org/showlist.cgi?name=beginners -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. Regardless of how small the crowd is, there is always one in it who has to find out the hard way that the laws of physics apply to them too. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/
Re: how to stop RPC::XML::Server blocking
Robin Sheat [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have a small XML-RPC server I wrote using the RPC::XML::Server module, however I found that if a single task given to it takes some time, then it prevents any more requests from happening. I'd like to have each task started in its own thread (preferably with the ability to specify an upper limit, after which it blocks to stop it getting hammered with thread creation). Is there a nice way to do this without writing my own RPC::XML::Server replacement? Sure. Just run your server in a mod_perl enabled apache: http://search.cpan.org/~rjray/RPC-XML-0.59/lib/Apache/RPC/Server.pm Todd W. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
how to stop RPC::XML::Server blocking
Hi, I have a small XML-RPC server I wrote using the RPC::XML::Server module, however I found that if a single task given to it takes some time, then it prevents any more requests from happening. I'd like to have each task started in its own thread (preferably with the ability to specify an upper limit, after which it blocks to stop it getting hammered with thread creation). Is there a nice way to do this without writing my own RPC::XML::Server replacement? Cheers, Robin. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Stop XML::Parser
Hi, I have a simple question about XML::Parser. Is there a way to stop parsing in progress and how ? Thanks in advance, Andre -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
STOP THREAD ! Can't locate object method new via package
THANK YOU !!! THAT´s IT ! Jose is right. My editor changed the text I filled in... Sorry for nerving with such easy stuff! Best regards posty Mit schönen Grüßen von Yahoo! Mail - http://mail.yahoo.de -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: stop
Casey West wrote: For the record the archives don't lie, the thread will be there. That's precisely why rudeness must be kept in check. So we could be rude, except that it will be recorded so we mustn't? Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
stop
I've requested 50 times to be taken off your mailing list, but you still send me this unwanted mail. I will now report all mail sent to me by you as SPAM Stop sending me spam. 2003 www.hushport.com
RE:[OT] stop
Wow. 50 times. That's some stamina. I imagine that's almost as annoying as getting a humongous Christmas picture background HTML mail in your Perl mailing list... From: David Kapp [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 11:31 AM To: [EMAIL PROTECTED] Subject: stop I've requested 50 times to be taken off your mailing list, but you still send me this unwanted mail. I will now report all mail sent to me by you as SPAM Stop sending me spam. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
[ADMIN] Re: stop
It was Wednesday, January 07, 2004 when David Kapp took the soap box, saying: : I've requested 50 times to be taken off your mailing list, but you still : send me this unwanted mail. : I will now report all mail sent to me by you as SPAM : Stop sending me spam. You can send a message to [EMAIL PROTECTED] and respond to the confirmation request you get as a result. Emailing this list directly will not help you. If that still doesn't work for you, email [EMAIL PROTECTED] with the exact email address you would like removed and the perl.org admins will take care of it. As an aside, this mailing list could never be SPAM to you because you confirmed your subscription to it and thus every message is solicited. Even so, I'm sorry they bother you. Casey West -- Shooting yourself in the foot with APL You hear a gunshot and there's a hole in your foot, but you don't remember enough linear algebra to understand what has happened. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: [OT] stop
Yeah or taking the time to blame the users of the list. Happy New Year!!! Ned Cunningham POS Systems Development Monro Muffler Brake 200 Holleder Parkway Rochester, NY 14615 (585) 647-6400 ext. 310 [EMAIL PROTECTED] -Original Message- From: Tim Johnson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:36 PM To: David Kapp; [EMAIL PROTECTED] Subject:RE:[OT] stop Wow. 50 times. That's some stamina. I imagine that's almost as annoying as getting a humongous Christmas picture background HTML mail in your Perl mailing list... From: David Kapp [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 11:31 AM To: [EMAIL PROTECTED] Subject: stop I've requested 50 times to be taken off your mailing list, but you still send me this unwanted mail. I will now report all mail sent to me by you as SPAM Stop sending me spam. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: stop
I've requested 50 times to be taken off your mailing list, but you still send me this unwanted mail. You've sent 50 emails to [EMAIL PROTECTED] I get no spam from this list ever, maybe it's coming from someone who harvested your email address from a web site or something? I will now report all mail sent to me by you as SPAM What are the headers and ip addresses, I doubt it's coming from the real beginners list or else I'd have gotton spam also since I've subscribed for a while now. Stop sending me spam. I never have and the list hasn't either. It's got to be a harvesting bot, virus, etc... Maybe your IncrediMail or Kazaa or somethgin has spyware in it? HTH DMuey 2003 www.hushport.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: stop
you could always change your email address! Just a thought. - Original Message - From: David Kapp To: [EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 14:31 Subject: stop I've requested 50 times to be taken off your mailing list, but you still send me this unwanted mail. I will now report all mail sent to me by you as SPAM Stop sending me spam. 2003 www.hushport.com 2004.jpgnew_year_01a.jpg
Re: stop
Uhhh...at the bottom of every list message is: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response withold sarcastic comment about thinking before you post / -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: stop
After being part of this list for a month, I don't recall seeing more than just this email requesting removal from the list. Oh well. An amusing message. I see them all the time in the Linux mail lists I participate in. Pity people can't follow directions :-) Uhhh...at the bottom of every list message is: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response withold sarcastic comment about thinking before you post / -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: stop
For the sake of: * giving the guy a break. * expecting some intellect. * realizing he's probably not reading your responses. Notice he didn't say whether he requested to the list, or to the proper email unsubscribe address: just that he had requested multiple times to be removed. The flip side of the coin is that there may very well be a problem with the unsubscription scripts. Yes, this is a far-flung possibility, but besides courtesy in the face of idiocy, one of the things ANY beginner to ANY thing should know is to think things through from ALL angles: just because the answer seems obvious, doesn't mean it is. -- Morbus Iff ( i put the demon back in codemonkey ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Spidering Hacks: http://amazon.com/exec/obidos/ASIN/0596005776/disobeycom icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: stop
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote: : : Oh well. An amusing message. I see them all the time in : the Linux mail lists I participate in. Pity people can't : follow directions :-) Be careful what you wish for. If everyone could follow directions we would be one step closer to everyone being able to *write* directions. Then I would have to become one of those really exceptional programmers instead of just the average one I am today. :) Charles K. Clarkson -- Head Bottle Washer, Clarkson Energy Homes, Inc. Mobile Home Specialists 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: stop
Please tell me this thread will stay in the archives! It's hilarious! I feel kinda bad for Mr. Kapp though, but if you're rude for no good reason what can you expect. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 14:31 Subject: stop I've requested 50 times to be taken off your mailing list, but you still send me this unwanted mail. I will now report all mail sent to me by you as SPAM Stop sending me spam. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: stop
It was Wednesday, January 07, 2004 when Dan Muey took the soap box, saying: : Please tell me this thread will stay in the archives! It's hilarious! : : I feel kinda bad for Mr. Kapp though, but if you're rude for no good : reason what can you expect. Well, around these parts we don't *expect* rudeness in return. I believe that rudeness must conform to the all things in moderation rule whenever it cannot be helped, which /should/ never happen. :-) For the record the archives don't lie, the thread will be there. That's precisely why rudeness must be kept in check. I think now is a good time to stop this thread. Everything that should have been said has been, as well as some things that shouldn't have. :-) Casey West -- Shooting yourself in the foot with Pascal The compiler won't let you shoot yourself in the foot. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: stop
Casey West wrote: It was Wednesday, January 07, 2004 when Dan Muey took the soap box, saying: : Please tell me this thread will stay in the archives! It's hilarious! : : I feel kinda bad for Mr. Kapp though, but if you're rude for no good : reason what can you expect. Well, around these parts we don't *expect* rudeness in return. I believe that rudeness must conform to the all things in moderation rule whenever it cannot be helped, which /should/ never happen. :-) For the record the archives don't lie, the thread will be there. That's precisely why rudeness must be kept in check. I think now is a good time to stop this thread. Everything that should have been said has been, as well as some things that shouldn't have. :-) Casey West Hi Casey, I think there is one point that I have not seen presented here. Unfortunately, many *real* spammers abuse the courtesy [or legal requirement?] of unsubscribe information, and actually use it as a probe to detect live addresses. At least many people believe that this is so. Some people may fear that they would only get enmeshed more deeply by using the unsubscribe link. Thanks for re-asserting the standards of kindness for the list. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
RE: stop/start
Regarding writing a unix daemon in perl, you might have a look at http://www.webreference.com/perl/tutorial/9/index.html -tristram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: stop/start
Given the original script submitted by [EMAIL PROTECTED]: #!/bin/perl $date = `date | awk '{print $4}'`; $snoop = /usr/sbin/snoop; $filename = `date +%y%m%d%H%M`.sno; $logfile = /opt/$filename; $pid = `/bin/pgrep snp.pl`; system(/usr/sbin/snoop -d ge0 -ta $logfile ); until (1 eq 0){ if ($date == 00:00:00){ system(/bin/pkill -P $pid); print === `date` ==\n $logfile; system(/usr/sbin/snoop -d ge0 -ta $logfile ); } } It seems to me that this will run in a busy loop continually checking the time. I see two better alternatives: (1) Use cron as already suggested to eliminate the until loop in the script; (2) Run the script as a daemon that occasionally checks the time and every 24hrs creates a new logfile. I don't see the point of using perl for either since (2) can be done easily with a Bourne shell script, something like this: #!/bin/sh # untested daemon for logging snoop output interval=60 # seconds between checking day change pid = `/bin/pgrep snp.pl` while : do day=`date +%d` date=`date +%y%m%d%H%M` logfile=/opt/${date}.sno echo $date $logfile /usr/sbin/snoop -d ge0 -ta $logfile while : do sleep $interval newday=`date +%d` if [ a$day -ne a$newday ] then kill -9 $pid # I believe in sure kills break # out of inner while loop fi done done This needs testing, particularly regarding the success of the kill, but I would not fix what ain't broke. The use of snoop with your given options and ge0 device descriptor confirms that you are running SunOS: on Linux I would use tcpdump which is available on Solaris also and is more versatile for later analyisis of the logs with some tools including ethereal (www.ethereal.com). If you need an excellent, opensource IDS, Snort's the best beast (www.snort.org). Why else would you dedicate a machine to promiscuous mode? -- Tris Nefzger -Original Message- From: Stephen Hardisty [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2003 5:10 PM To: Perl List Subject: Re: stop/start $SIG{ALRM} = { `this-script`; exit; }; Sorry, didn't think it through (before anybody notices.). Remove the thing that executes the script (the bit in backticks) and just have the process start on a cron job. Tired, apologies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
stop/start
Hi I'm trying to get this to work in perl. I want to start a unix process send it to a log file. Then at midnight kill it and restart it, with the date at the top. I'm starting with the following but the intial start of the proccess is not working right: #!/bin/perl $date = `date | awk '{print $4}'`; $snoop = /usr/sbin/snoop; $filename = `date +%y%m%d%H%M`.sno; $logfile = /opt/$filename; $pid = `/bin/pgrep snp.pl`; system(/usr/sbin/snoop -d ge0 -ta $logfile ); until (1 eq 0){ if ($date == 00:00:00){ system(/bin/pkill -P $pid); print === `date` ==\n $logfile; system(/usr/sbin/snoop -d ge0 -ta $logfile ); } } Any suggestions would be helpfull. thanks rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: stop/start
Hi, you could write a handler for the signal alarm that starts a new process and kills the current: $SIG{ALRM} = { `this-script`; exit; }; At the beginning of the script set the alarm to go off 24 hours later: alarm(84600); DISCLAIMER: haven't really thought it through and it's really hacky, so don't have a go at me (but it is quick to do). Cheers! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: stop/start
$SIG{ALRM} = { `this-script`; exit; }; Sorry, didn't think it through (before anybody notices.). Remove the thing that executes the script (the bit in backticks) and just have the process start on a cron job. Tired, apologies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find regex in Start/Stop segments
Tassilo von Parseval [EMAIL PROTECTED] writes: That's good. and that is why chomp is an excellent choice for this context. Because the OP may not know, or be sure of, that fact. The chomp function is custom-designed for cases of uncertainty,.and is perfectly safe in cases where there is no tail-junk to remove. Please don't discourage its use. I was not discouraging its use. I was rather pointing out that @ARGV does (usually) not contain trailing newlines. chomp() should be used when - conceptually - there could be something to remove. In case of filenames however you either don't have anything to remove or you don't want to remove it. That way this chomp() could even be wrong (as John remarked in his follow-up). I'm the OP, so for clarity here: Why chomp? Well, it was really a typo. It was supposed to say `chop'. During the night some homeless guy slipped in and created a bunch of filenames with control chars in them, like this. `Harry is a jerk^MHarry is a saint' So you can see why `chop' was called for. I need to learn to type better... hehe. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find regex in Start/Stop segments
Tassilo von Parseval wrote: chomp; I don't think that the entries in @ARGV contain newlines at the end. Actually I know they don't. :-) That's good. and that is why chomp is an excellent choice for this context. Because the OP may not know, or be sure of, that fact. The chomp function is custom-designed for cases of uncertainty,.and is perfectly safe in cases where there is no tail-junk to remove. Please don't discourage its use. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find regex in Start/Stop segments
On Fri, Jun 13, 2003 at 03:09:20PM -0700 R. Joseph Newton wrote: Tassilo von Parseval wrote: chomp; I don't think that the entries in @ARGV contain newlines at the end. Actually I know they don't. :-) That's good. and that is why chomp is an excellent choice for this context. Because the OP may not know, or be sure of, that fact. The chomp function is custom-designed for cases of uncertainty,.and is perfectly safe in cases where there is no tail-junk to remove. Please don't discourage its use. I was not discouraging its use. I was rather pointing out that @ARGV does (usually) not contain trailing newlines. chomp() should be used when - conceptually - there could be something to remove. In case of filenames however you either don't have anything to remove or you don't want to remove it. That way this chomp() could even be wrong (as John remarked in his follow-up). Tassilo -- $_=q#,}])!JAPH!qq(tsuJ[{@tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({ pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#; $_=reverse,s+(?=sub).+q#q!'qq.\t$.'!#+sexisexiixesixeseg;y~\n~~;eval -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Find regex in Start/Stop segments
I use a homeboy data base technique to keep info about the scripts I write and other typse of stuff too. Here I'm just dealing with scripts. Its a simple format to enter key information about what a script does. Looks like: # Keywords: SOME WORDS # body # body # DATE # I've written various scripts to search this format in awk and shell. Now trying it in perl. I have several working scripts but wanted to get some ideas from the sharp shooters here how to do this better. My technique seems like it could be streamlined and improved quite a lot. The sample below just handles the basic technique and isn't completed with all tests and etc. Just some basic ones. But really I'm more interested in hearing better ways to accomplish this. The basic task is to locate a formated segment, search its keywords line for regex then print the segment. Also a basic check for misformatted segments. Not too concerned with how the files are aquired but what comes after. ^^ #!/usr/local/bin/perl -w ($myscript = $0) =~ s:^.*/::; $regex = shift; ## Set Keywords start end regex for non script searching (The default) $keyreg = '^# Keywords:'; $keyend = '^# $'; if (!$ARGV[0]) { usage(); exit; } ## Aquire there files in whatever way @files = @ARGV; ## Set a marker to know when we are in a new file $fname_for_line_cnt = ''; for (@files) { chomp; $file = $_; if ($fname_for_line_cnt eq $file) { ## This shouldn't happen print We're reading the same file again .. exiting\n; exit; } else { ## Set lineno to 0 for start of each file $lineno = 0; $fname_for_line_cnt = $file; } if (-f $file) { open(FH,$file) or die Cannot open $file: $!; while (FH) { chomp; $lineno++; $line = $_; if (/$keyreg $regex/) { print $file\n; $hit = TRUE; } if ($hit) { print $lineno $line\n; } if ($hit /$keyend/) { ## We've hit the end of a good segment, print delimiter and null out our vars print -- \n; $hit= ''; $line = ''; } if ($hit /^[^#]/ || $hit eof) { ## If we see this situation it means the format is screwed up ## Notify user of the line number, but null out vars and proceed. print $file:\n INCOMPLETE SEGMENT ENTRY: Line $lineno\n --\n; $hit= ''; $line = ''; } } close(FH); } else { next; } } sub usage { printEOM; Purpose: Search scripts keyword segments (or any file) Usage: \`$myscript REGEX file ... fileN (or glob)' (Where REGEX is a regex to be found in Keyword segment) EOM } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find regex in Start/Stop segments
On Tue, Jun 10, 2003 at 11:49:25PM -0700 Harry Putnam wrote: I use a homeboy data base technique to keep info about the scripts I write and other typse of stuff too. Here I'm just dealing with scripts. Its a simple format to enter key information about what a script does. Looks like: # Keywords: SOME WORDS # body # body # DATE # I've written various scripts to search this format in awk and shell. Now trying it in perl. I have several working scripts but wanted to get some ideas from the sharp shooters here how to do this better. My technique seems like it could be streamlined and improved quite a lot. Yes, it's a little wordy considering it's Perl. The sample below just handles the basic technique and isn't completed with all tests and etc. Just some basic ones. But really I'm more interested in hearing better ways to accomplish this. The basic task is to locate a formated segment, search its keywords line for regex then print the segment. Also a basic check for misformatted segments. Not too concerned with how the files are aquired but what comes after. ^^ #!/usr/local/bin/perl -w ($myscript = $0) =~ s:^.*/::; You are allowed to manipulate $0, too. The new value of $0 is the one that is eventually showing up in your process-table (unless you are using Perl5.8.0 where this does not work due to a bug). $regex = shift; ## Set Keywords start end regex for non script searching (The default) $keyreg = '^# Keywords:'; $keyend = '^# $'; if (!$ARGV[0]) { usage(); exit; } ## Aquire there files in whatever way @files = @ARGV; ## Set a marker to know when we are in a new file $fname_for_line_cnt = ''; for (@files) { chomp; I don't think that the entries in @ARGV contain newlines at the end. Actually I know they don't. :-) $file = $_; if ($fname_for_line_cnt eq $file) { There is no reason to put those variables into quotes. ## This shouldn't happen print We're reading the same file again .. exiting\n; exit; That is better solved using a hash. Fill all the files into a hash (as keys) and iterate over the keys. That way, it's guaranteed you only inspect each file once. } else { ## Set lineno to 0 for start of each file $lineno = 0; $fname_for_line_cnt = $file; } if (-f $file) { open(FH,$file) or die Cannot open $file: $!; while (FH) { chomp; $lineno++; You don't have to keep track of the line numbers yourself. Perl offers the special variable $. for that. $line = $_; if (/$keyreg $regex/) { print $file\n; $hit = TRUE; } if ($hit) { print $lineno $line\n; } if ($hit /$keyend/) { ## We've hit the end of a good segment, print delimiter and null ## out our vars print -- \n; $hit= ''; $line = ''; } if ($hit /^[^#]/ || $hit eof) { ## If we see this situation it means the format is screwed up ## Notify user of the line number, but null out vars and proceed. print $file:\n INCOMPLETE SEGMENT ENTRY: Line $lineno\n --\n; $hit= ''; $line = ''; } } close(FH); } else { next; } } sub usage { printEOM; Purpose: Search scripts keyword segments (or any file) Usage: \`$myscript REGEX file ... fileN (or glob)' (Where REGEX is a regex to be found in Keyword segment) EOM } I'd probably write it like that: #!/usr/local/bin/perl -w use strict; $0 =~ s:.*/::; my $regex = shift; $regex = qr/^# Keywords: $regex/; # could improve performance a little my %files; @files{ @ARGV } = (); # a hash-slice: see 'perldoc perldata' usage(), exit if ! @ARGV; for my $file (keys %files) { next if ! -f $file; open FILE, , $file or die Error opening $file: $!; my $hit; while (FILE) { chomp; $hit++ if /$regex/o;# start of record print $. $_\n if $hit;# $. is the line number $hit-- if /^# $/; # end of record print $file:\n\tINCOMPLETE SEGMENT ENTRY: Line $l.\n--\n and $hit-- if $hit !/^#/ or $hit eof; } } sub usage { ... } I didn't test it but it should produce the same result as your script and doing it considerably more quickly. Please substract any possible syntax errors or logical flaws from the script before running it. ;-) Tassilo -- $_=q#,}])!JAPH!qq(tsuJ[{@tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({ pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#; $_=reverse,s+(?=sub).+q#q!'qq.\t$.'!#+sexisexiixesixeseg;y~\n~~;eval -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find regex in Start/Stop segments
Tassilo von Parseval [EMAIL PROTECTED] writes: You don't have to keep track of the line numbers yourself. Perl offers the special variable $. for that. An awkism I guess, hold over from awk use. Thanks for the tips. I'd probably write it like that: Quite a lot shorter... and to the point. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Find regex in Start/Stop segments
Tassilo Von Parseval wrote: On Tue, Jun 10, 2003 at 11:49:25PM -0700 Harry Putnam wrote: ## Set a marker to know when we are in a new file $fname_for_line_cnt = ''; for (@files) { chomp; I don't think that the entries in @ARGV contain newlines at the end. Actually I know they don't. :-) Well it could happen but you would really have to want it that way. $ perl -le'for(@ARGV){print length; chomp; print length}' one 'two ' three 3 3 4 3 5 5 And of course, if you have a file name with an actual newline in it then you don't want to remove it. :-) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best way to stop array interpolation.
Bakken, Luke wrote: Here's a quickie: I need to create a hash index out of a string that looks like this: loans:a_foo[0] If I build the index like this: $rec-{loans:a_$fld[$i]} = $tmp{$fld} || ''; perl thinks that $fld[$i] is an array element, which it isn't. Here are two solutions I found: $rec-{loans:a_$fld . [$i]} = $tmp{$fld} || ''; $rec-{loans:a_$fld\[$i]} = $tmp{$fld} || ''; Are there any other ways? Just curious. loans:a_${fld}[$i] also works. I like your second version above best. $ perl -MO=Deparse,-q -e 'a_${fld}[$i]' 'a_' . $fld . '[' . $i . ']'; $ perl -MO=Deparse,-q -e 'a_$fld\[$i]' 'a_' . $fld . '[' . $i . ']'; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Best way to stop array interpolation.
Here's a quickie: I need to create a hash index out of a string that looks like this: loans:a_foo[0] If I build the index like this: $rec-{loans:a_$fld[$i]} = $tmp{$fld} || ''; perl thinks that $fld[$i] is an array element, which it isn't. Here are two solutions I found: $rec-{loans:a_$fld . [$i]} = $tmp{$fld} || ''; $rec-{loans:a_$fld\[$i]} = $tmp{$fld} || ''; Are there any other ways? Just curious. Luke -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best way to stop array interpolation.
Here are two solutions I found: $rec-{loans:a_$fld . [$i]} = $tmp{$fld} || ''; $rec-{loans:a_$fld\[$i]} = $tmp{$fld} || ''; Are there any other ways? Just curious. loans:a_${fld}[$i] also works. I like your second version above best. $ perl -MO=Deparse,-q -e 'a_${fld}[$i]' 'a_' . $fld . '[' . $i . ']'; $ perl -MO=Deparse,-q -e 'a_$fld\[$i]' 'a_' . $fld . '[' . $i . ']'; Hmm you know that was the first thing I tried, but I always get this error, indicating it's still looking for @fld: I also have use strict on. C:\tmpperl testadr Global symbol @fld requires explicit package name at testadr line 37. Global symbol @fld requires explicit package name at testadr line 43. BEGIN not safe after errors--compilation aborted at testadr line 48. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best way to stop array interpolation.
Bakken, Luke wrote: Here are two solutions I found: $rec-{loans:a_$fld . [$i]} = $tmp{$fld} || ''; $rec-{loans:a_$fld\[$i]} = $tmp{$fld} || ''; Are there any other ways? Just curious. loans:a_${fld}[$i] also works. I like your second version above best. $ perl -MO=Deparse,-q -e 'a_${fld}[$i]' 'a_' . $fld . '[' . $i . ']'; $ perl -MO=Deparse,-q -e 'a_$fld\[$i]' 'a_' . $fld . '[' . $i . ']'; Hmm you know that was the first thing I tried, but I always get this error, indicating it's still looking for @fld: I also have use strict on. C:\tmpperl testadr Global symbol @fld requires explicit package name at testadr line 37. Global symbol @fld requires explicit package name at testadr line 43. BEGIN not safe after errors--compilation aborted at testadr line 48. You're right. I guess what I wrote is a no-no. Writing something like ${fld}foo is like $fld . foo But the opening square bracket seems to cause problems with strict turned on. Maybe somebody smarter than me (shouldn't be hard to find!) can explain further. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
please stop sending mails
Stop sending me email
Stop sending me email
Stop sending me email
Stop sending me email
Re: Stop sending me email
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Window Services - stop/start (Newbie)...
Hi, I just tried to install both modules (Win32::Service Win32::Lanman). Get the message that I am using the wrong build of Perl. Both files were downloaded from CPAN. Didn't see a make.pl file, but did see an install.pl file. Ran that file and get the error message above. Do I need to create a make.pl file to install the module? Or am I missing something very simple? I am using ActiveState Perl 5.6.1 Build 633. I copied this from the command prompt...using Windows NT 4.0. *** E:\perl -v This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2001, Larry Wall Binary build 633 provided by ActiveState Corp. http://www.ActiveState.com Built 21:33:05 Jun 17 2002 Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. *** Thanks. Alex -- From: Timothy Johnson[SMTP:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 4:34 PM To: 'Yuen, Alex'; 'Perl Beginners' Subject: RE: Window Services - stop/start (Newbie)... Check out Win32::Service or Win32::Lanman. Lanman is a whole lot to chew, but it can do just about anything involving remote administration of NT/2000/XP machines. -Original Message- From: Yuen, Alex [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 1:33 PM To: 'Perl Beginners' Subject: Window Services - stop/start (Newbie)... Hi, Does anyone know if Perl can stop or start a Service in Windows NT or 2000? Trying to write a script to stop the Service of an application, archive the log files and then restart the Service. Plus, record this transaction to a seperate log file. Another plus, send out an e-mail notification if an error were to occur in any step of the Perl script. Haven't decided to attach the log to the e-mail or not. But would be using Mime::Lite for this. Thanks. Alex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Window Services - stop/start (Newbie)...
Why don't you install it via PPM? If it's not in the Activestate repository, you can install it using Dave Roth's PPM repository. PPM set repository dave http://www.roth.net/perl/packages PPM set save PPM install win32-service For Win32::Lanman (and many other useful modules), use Jenda's repository: http://jenda.krynicky.cz/perl -Original Message- From: Yuen, Alex [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 11:50 AM To: 'Perl Beginners' Subject: RE: Window Services - stop/start (Newbie)... Hi, I just tried to install both modules (Win32::Service Win32::Lanman). Get the message that I am using the wrong build of Perl. Both files were downloaded from CPAN. Didn't see a make.pl file, but did see an install.pl file. Ran that file and get the error message above. Do I need to create a make.pl file to install the module? Or am I missing something very simple? I am using ActiveState Perl 5.6.1 Build 633. I copied this from the command prompt...using Windows NT 4.0. *** E:\perl -v This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2001, Larry Wall Binary build 633 provided by ActiveState Corp. http://www.ActiveState.com Built 21:33:05 Jun 17 2002 Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. *** Thanks. Alex -- From: Timothy Johnson[SMTP:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 4:34 PM To: 'Yuen, Alex'; 'Perl Beginners' Subject: RE: Window Services - stop/start (Newbie)... Check out Win32::Service or Win32::Lanman. Lanman is a whole lot to chew, but it can do just about anything involving remote administration of NT/2000/XP machines. -Original Message- From: Yuen, Alex [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 1:33 PM To: 'Perl Beginners' Subject: Window Services - stop/start (Newbie)... Hi, Does anyone know if Perl can stop or start a Service in Windows NT or 2000? Trying to write a script to stop the Service of an application, archive the log files and then restart the Service. Plus, record this transaction to a seperate log file. Another plus, send out an e-mail notification if an error were to occur in any step of the Perl script. Haven't decided to attach the log to the e-mail or not. But would be using Mime::Lite for this. Thanks. Alex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Window Services - stop/start (Newbie)...
Tim, Thanks for this information. I managed to install Win32::Lanman using PPM. But I still got an error message installing Win32::Service. I'm going to see how difficult Lanman is before racking my head with Win32::Service. But here is the error I got if anyone is interested. :) * E:\ppm PPM interactive shell (2.1.6) - type 'help' for available commands. PPM set repository dave http://www.roth.net/perl/packages PPM set save PPM install win32-service Install package 'win32-service?' (y/N): y Installing package 'win32-service'... Error installing package 'win32-service': Read a PPD for 'win32-service', but it is not intended for this build of Perl (MSWin32-x86-multi-thread) PPM quit Quit! * Thanks. Alex -- From: Timothy Johnson[SMTP:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 4:13 PM To: 'Yuen, Alex'; 'Perl Beginners' Subject: RE: Window Services - stop/start (Newbie)... Why don't you install it via PPM? If it's not in the Activestate repository, you can install it using Dave Roth's PPM repository. PPM set repository dave http://www.roth.net/perl/packages PPM set save PPM install win32-service For Win32::Lanman (and many other useful modules), use Jenda's repository: http://jenda.krynicky.cz/perl -Original Message- From: Yuen, Alex [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 11:50 AM To: 'Perl Beginners' Subject: RE: Window Services - stop/start (Newbie)... Hi, I just tried to install both modules (Win32::Service Win32::Lanman). Get the message that I am using the wrong build of Perl. Both files were downloaded from CPAN. Didn't see a make.pl file, but did see an install.pl file. Ran that file and get the error message above. Do I need to create a make.pl file to install the module? Or am I missing something very simple? I am using ActiveState Perl 5.6.1 Build 633. I copied this from the command prompt...using Windows NT 4.0. ** ** *** E:\perl -v This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2001, Larry Wall Binary build 633 provided by ActiveState Corp. http://www.ActiveState.com Built 21:33:05 Jun 17 2002 Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. ** ** *** Thanks. Alex -- From: Timothy Johnson[SMTP:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 4:34 PM To: 'Yuen, Alex'; 'Perl Beginners' Subject:RE: Window Services - stop/start (Newbie)... Check out Win32::Service or Win32::Lanman. Lanman is a whole lot to chew, but it can do just about anything involving remote administration of NT/2000/XP machines. -Original Message- From: Yuen, Alex [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 1:33 PM To: 'Perl Beginners' Subject: Window Services - stop/start (Newbie)... Hi, Does anyone know if Perl can stop or start a Service in Windows NT or 2000? Trying to write a script to stop the Service of an application, archive the log files and then restart the Service. Plus, record this transaction to a seperate log file. Another plus, send out an e-mail notification if an error were to occur in any step of the Perl script. Haven't decided to attach the log to the e-mail or not. But would be using Mime::Lite for this. Thanks. Alex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Window Services - stop/start (Newbie)...
It looks like you might want to do a full uninstall/reinstall of ActivePerl and see if that clears it up. -Original Message- From: Yuen, Alex [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 1:33 PM To: 'Perl Beginners'; 'Timothy Johnson' Subject: RE: Window Services - stop/start (Newbie)... Tim, Thanks for this information. I managed to install Win32::Lanman using PPM. But I still got an error message installing Win32::Service. I'm going to see how difficult Lanman is before racking my head with Win32::Service. But here is the error I got if anyone is interested. :) * E:\ppm PPM interactive shell (2.1.6) - type 'help' for available commands. PPM set repository dave http://www.roth.net/perl/packages PPM set save PPM install win32-service Install package 'win32-service?' (y/N): y Installing package 'win32-service'... Error installing package 'win32-service': Read a PPD for 'win32-service', but it is not intended for this build of Perl (MSWin32-x86-multi-thread) PPM quit Quit! * Thanks. Alex -- From: Timothy Johnson[SMTP:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 4:13 PM To: 'Yuen, Alex'; 'Perl Beginners' Subject: RE: Window Services - stop/start (Newbie)... Why don't you install it via PPM? If it's not in the Activestate repository, you can install it using Dave Roth's PPM repository. PPM set repository dave http://www.roth.net/perl/packages PPM set save PPM install win32-service For Win32::Lanman (and many other useful modules), use Jenda's repository: http://jenda.krynicky.cz/perl -Original Message- From: Yuen, Alex [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 11:50 AM To: 'Perl Beginners' Subject: RE: Window Services - stop/start (Newbie)... Hi, I just tried to install both modules (Win32::Service Win32::Lanman). Get the message that I am using the wrong build of Perl. Both files were downloaded from CPAN. Didn't see a make.pl file, but did see an install.pl file. Ran that file and get the error message above. Do I need to create a make.pl file to install the module? Or am I missing something very simple? I am using ActiveState Perl 5.6.1 Build 633. I copied this from the command prompt...using Windows NT 4.0. ** ** *** E:\perl -v This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) Copyright 1987-2001, Larry Wall Binary build 633 provided by ActiveState Corp. http://www.ActiveState.com Built 21:33:05 Jun 17 2002 Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. ** ** *** Thanks. Alex -- From: Timothy Johnson[SMTP:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 4:34 PM To: 'Yuen, Alex'; 'Perl Beginners' Subject:RE: Window Services - stop/start (Newbie)... Check out Win32::Service or Win32::Lanman. Lanman is a whole lot to chew, but it can do just about anything involving remote administration of NT/2000/XP machines. -Original Message- From: Yuen, Alex [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 1:33 PM To: 'Perl Beginners' Subject: Window Services - stop/start (Newbie)... Hi, Does anyone know if Perl can stop or start a Service in Windows NT or 2000? Trying to write a script to stop the Service of an application, archive the log files and then restart the Service. Plus, record this transaction to a seperate log file. Another plus, send out an e-mail notification if an error were to occur in any step of the Perl script. Haven't decided to attach the log to the e-mail or not. But would be using Mime::Lite for this. Thanks. Alex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Window Services - stop/start (Newbie)...
Hi, Does anyone know if Perl can stop or start a Service in Windows NT or 2000? Trying to write a script to stop the Service of an application, archive the log files and then restart the Service. Plus, record this transaction to a seperate log file. Another plus, send out an e-mail notification if an error were to occur in any step of the Perl script. Haven't decided to attach the log to the e-mail or not. But would be using Mime::Lite for this. Thanks. Alex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Window Services - stop/start (Newbie)...
Check out Win32::Service or Win32::Lanman. Lanman is a whole lot to chew, but it can do just about anything involving remote administration of NT/2000/XP machines. -Original Message- From: Yuen, Alex [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 1:33 PM To: 'Perl Beginners' Subject: Window Services - stop/start (Newbie)... Hi, Does anyone know if Perl can stop or start a Service in Windows NT or 2000? Trying to write a script to stop the Service of an application, archive the log files and then restart the Service. Plus, record this transaction to a seperate log file. Another plus, send out an e-mail notification if an error were to occur in any step of the Perl script. Haven't decided to attach the log to the e-mail or not. But would be using Mime::Lite for this. Thanks. Alex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Window Services - stop/start (Newbie)...
Try Win32::Service. Functions of interest are: StopService($hostName, $svcName); StartService($hostName, $svcName); PauseService($hostName, $svcName); ResumeService($hostName, $svcName); You can execute any of the functions of this module on remote-servers attached to the same network that you are and you should have ADMINISTRATOR level privileges on those machines so as to control their services, via remote-registry. Cheers, Rex --- Yuen, Alex [EMAIL PROTECTED] wrote: Hi, Does anyone know if Perl can stop or start a Service in Windows NT or 2000? Trying to write a script to stop the Service of an application, archive the log files and then restart the Service. Plus, record this transaction to a seperate log file. Another plus, send out an e-mail notification if an error were to occur in any step of the Perl script. Haven't decided to attach the log to the e-mail or not. But would be using Mime::Lite for this. Thanks. Alex -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Yahoo! - We Remember 9-11: A tribute to the more than 3,000 lives lost http://dir.remember.yahoo.com/tribute -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
I am confused with looping to stop repeat accurances of a entryies ina log for a report
I am trying to parse a squid log file to let It management know where people are browsing too. my plan block diagram goes a follows 1. open log 2. seperate by IP address , list only one at a time no repeats of the same IP address 3. list only one instance of a visited site , per IP address 4. print HTML file but I guess the best route would be dump each log entry in its own array ( by ip address of client machine) but I am not getting the desired results . I have a file for debuging called scratch.txt here is the code open(LOG,/var/log/squid/access.log); logmess = LOG; close(LOG); open XML log for writing open(LOGXML,/var/log/squid/access.xml); print LOGXML ?xml version=\1.0\?\n; print LOGXML list\n; ## ## open scratch open(scratch,/var/log/squid/scratch.txt); foreach $message(logmess) { chomp($message); fields = split(/\s+/, $message); $time = $fields[0]; $site_visited = $fields[6]; $userip = $fields[2]; $userip1 = $userip; $userip1 =~ s/\./_/g; $xml_ip = $userip1..txt; scratch = test; # dump into array #do loop search foreach $el(scratch){ $found = no; print IP : $xml_ip ... $el\n; if($xml_ip eq $el) { $found = yes; print Yes !!\n; } if($found ne yes) { push(scratch, $xml_ip); } } foreach $rt(scratch){ print scratch $rt\n; } close(scratch); open(XML_IP,$xml_ip); # holding file per IP addresses $fetch = $fields[8]; $type = $fields[9]; # ## Dump each into its own variable ## # visited = split(/\//,$site_visited); # add date , dump into array print XML_IP $userip $visited[2]\n; close(XML_IP); my scratch file looks like this test 192_168_1_68.txt there are more clients that that any suggestions ? thanks Jim
RE: remove the stop words
Is there a good method to do this? I need to remove the stop words from the comment field of every record. There are about 20,000 records. The comments look like this: Yersinia pestis strain Nepal (aka CDC 516 or 369 isolated from human) 16S-23S in tergenic region amplified with 16UNIX and 23UNII primers. Sequencing primers were UNI1 and UNI2 5/25/99^^ I should remove 'and' 'in' 'with' 'The', etc. I have set up the stop words array. Is there a efficient way to do this? How about: code #!perl -w use strict; my ($r,$tmp) = '' x 2; my $input = 'blah srand and spin in with within the their'; my @s_words = qw(and in with the); for(@s_words) { $tmp .= \\b$_\\b; $tmp .= '|' unless $_ eq $s_words[$#s_words]; } $r = qr/$tmp/is; print $r; print \n\n$input\n\n; $input =~ s/$r//g; print $input\n; end It builds a regex using your search words and then applies it to a string. HTH, -dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: remove the stop words
Ying Liu wrote at Mon, 03 Jun 2002 17:11:22 +0200: Is there a good method to do this? I need to remove the stop words from the comment field of every record. There are about 20,000 records. The comments look like this: Yersinia pestis strain Nepal (aka CDC 516 or 369 isolated from human) 16S-23S in tergenic region amplified with 16UNIX and 23UNII primers. Sequencing primers were UNI1 and UNI2 5/25/99^^ I should remove 'and' 'in' 'with' 'The', etc. I have set up the stop words array. Is there a efficient way to do this? Let's try: my %stop_words = map {$_ = 1} qw(and in with The); my $text = 'TEXT'; Yersinia pestis strain Nepal (aka CDC 516 or 369 isolated from human) 16S-23S in tergenic region amplified with 16UNIX and 23UNII primers. Sequencing primers were UNI1 and UNI2 5/25/99^^ TEXT my $clean_text = join , grep {! $stop_words{$_}} split /\W+/, $text; (In fact it will remove all dots, commata and so on, too) If you don't want it, try instead: my $clean_text = join , grep {! $stop_words{$_}} split /(\W+)/, $text; Best Wishes, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
remove the stop words
Hi, Is there a good method to do this? I need to remove the stop words from the comment field of every record. There are about 20,000 records. The comments look like this: Yersinia pestis strain Nepal (aka CDC 516 or 369 isolated from human) 16S-23S in tergenic region amplified with 16UNIX and 23UNII primers. Sequencing primers were UNI1 and UNI2 5/25/99^^ I should remove 'and' 'in' 'with' 'The', etc. I have set up the stop words array. Is there a efficient way to do this? Thanks, Ying Liu - Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup
Re: stop the Madness
on Mon, 20 May 2002 12:25:26 GMT, [EMAIL PROTECTED] (Arran4) wrote: heh thats has already been added to my ever growing signuture hehehe (should shorten it sometimes) I don't think this is funny. Your 'signature' is 24 lines long now, and contains over 1000 bytes. According to learn.perl.org, the beginners list has 3547 members, which means that with every message you send, you waste over 3 MB of bandwidth. Please be nice and consider shorten your signature *now* in stead of 'sometimes'. -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: stop the Madness
heh thats has already been added to my ever growing signuture hehehe (should shorten it sometimes) From: Arran === It is obvious: The only program that parses Perl is perl, and to really be Perl you also have to be perl. The easiest way to turn Perl code into an executable is to embed the perl interpreter! song: If you are sexy and you know it clap your hands Me: im going to go have to sit this one out... If builders built buildings the way programmers wrote programs, then the first woodpecker to come along would destroy civilization. We are the out casts of society, but when they relise its the out casts that create society, we will fall. Everything I know about thermal expansion I learnt from Neon Genesis Evangelion! And there's always those days where you start sending out emails with semicolons at the end of the sentences. Yesterday I even caught myself writing code on a piece of napkin on my lunch. I'm afraid the day will finally come where I start trying to rearrange all of my paragraphs into a single sentence. I mean sure, noone will know what the hell - Original Message - From: Timothy Johnson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 17, 2002 3:44 AM Subject: RE: stop the Madness And there's always those days where you start sending out emails with semicolons at the end of the sentences. Yesterday I even caught myself writing code on a piece of napkin on my lunch. I'm afraid the day will finally come where I start trying to rearrange all of my paragraphs into a single sentence. I mean sure, noone will know what the hell I'm talking about, but look how efficient my speech has become! HELP ME!!! -Original Message- From: A Taylor [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 16, 2002 9:36 AM To: [EMAIL PROTECTED] Subject: Re: stop the Madness SO TRUE ! GLAD I AM NOT ALONE !!! HA HA I feel morally compelled to point out to any of the real Newbies who are on the beginner's mailing list that this READS like the usual form of 'deep denial' that needs to come out in the light of day. Oh sure - today its a little text file manipulation, a bit of CGI work with webFoo, a little DBI interface, whack a GUI front end onto some dog piece of software, you can Kick the Habit Any Time You Want. Or at least that is what you tell your friends. It's really only a small piece of bridge code, and you can just make a little perl module to simplify the interface between the various common applications, nothing serious... Oh but if I just subclass FOO::BAR that you found at [TheCPAN|SourceForge|someCoolWebSite|ThisGuyYouMetInSomeDarkBackAlley] then of course I can adapt it to fix this other bit... I merely wanted to have some better monitoring code for our system wide solution - and I merely downloaded from http://www.kernel.org/software/mon/ and all I have to do is just rework a few bits here and there. I mean that way I can monitor the systems more efficiently so that I can spend more time coding this cool little extension to this perl module But if I adopt the p5ee standards, then I have a common technology that will interoperate between my webFront End and my Database Services on Legacy Architectures, including those older OS's where java has not been ported to yet... People REALLY NEED to be forewarned about the dangers! Do you find yourself seeking work where perl is readily available? Do you find yourself spending more of your time with other people who Perl than with normal people? Do you notice that you are going without the essentials food, water, shelter, simply so that you can perl? Have you ever found yourself waking up in strange places, in clothes you clearly haven't changed in days, with no memory of how you got there, in a littered heap of perl code printouts? People REALLY should think about these things before deciding if they really want to even know perl. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://1cis.com Free E-mail Servers with unlimited mailboxes 1st Class Internet Solutions -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: stop the Madness
Sorry - sent this to the wrong addy by mistake.. :O) A. On Thursday, May 16, 2002, at 05:44 PM, Timothy Johnson wrote: ... Yesterday I even caught myself writing code on a piece of napkin on my lunch I have been doing that for years - just not with perl. I always find the best work is done on the back of a napkin or envelope. A. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
stop the Madness
the sole purpose for me using perl is to: 1) manipulate ascii files with data in . 2) a front end (I.e Tk) to some analysis software we have - ... 3) a bit of fun I feel morally compelled to point out to any of the real Newbies who are on the beginner's mailing list that this READS like the usual form of 'deep denial' that needs to come out in the light of day. Oh sure - today its a little text file manipulation, a bit of CGI work with webFoo, a little DBI interface, whack a GUI front end onto some dog piece of software, you can Kick the Habit Any Time You Want. Or at least that is what you tell your friends. It's really only a small piece of bridge code, and you can just make a little perl module to simplify the interface between the various common applications, nothing serious... Oh but if I just subclass FOO::BAR that you found at [TheCPAN|SourceForge|someCoolWebSite|ThisGuyYouMetInSomeDarkBackAlley] then of course I can adapt it to fix this other bit... I merely wanted to have some better monitoring code for our system wide solution - and I merely downloaded from http://www.kernel.org/software/mon/ and all I have to do is just rework a few bits here and there. I mean that way I can monitor the systems more efficiently so that I can spend more time coding this cool little extension to this perl module But if I adopt the p5ee standards, then I have a common technology that will interoperate between my webFront End and my Database Services on Legacy Architectures, including those older OS's where java has not been ported to yet... People REALLY NEED to be forewarned about the dangers! Do you find yourself seeking work where perl is readily available? Do you find yourself spending more of your time with other people who Perl than with normal people? Do you notice that you are going without the essentials food, water, shelter, simply so that you can perl? Have you ever found yourself waking up in strange places, in clothes you clearly haven't changed in days, with no memory of how you got there, in a littered heap of perl code printouts? People REALLY should think about these things before deciding if they really want to even know perl. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: stop the Madness
See answers of a mid-level (3 years) Perl user below. -Original Message- From: drieux [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 16, 2002 12:11 PM To: [EMAIL PROTECTED] Subject: stop the Madness the sole purpose for me using perl is to: 1) manipulate ascii files with data in . 2) a front end (I.e Tk) to some analysis software we have - ... 3) a bit of fun I feel morally compelled to point out to any of the real Newbies who are on the beginner's mailing list that this READS like the usual form of 'deep denial' that needs to come out in the light of day. Oh sure - today its a little text file manipulation, a bit of CGI work with webFoo, a little DBI interface, whack a GUI front end onto some dog piece of software, you can Kick the Habit Any Time You Want. Or at least that is what you tell your friends. It's really only a small piece of bridge code, and you can just make a little perl module to simplify the interface between the various common applications, nothing serious... Oh but if I just subclass FOO::BAR that you found at [TheCPAN|SourceForge|someCoolWebSite|ThisGuyYouMetInSomeDarkBackAlley] then of course I can adapt it to fix this other bit... I merely wanted to have some better monitoring code for our system wide solution - and I merely downloaded from http://www.kernel.org/software/mon/ and all I have to do is just rework a few bits here and there. I mean that way I can monitor the systems more efficiently so that I can spend more time coding this cool little extension to this perl module But if I adopt the p5ee standards, then I have a common technology that will interoperate between my webFront End and my Database Services on Legacy Architectures, including those older OS's where java has not been ported to yet... People REALLY NEED to be forewarned about the dangers! Do you find yourself seeking work where perl is readily available? Yes, thank goodness, can't imagine work without Perl. Do you find yourself spending more of your time with other people who Perl than with normal people? Yes, and it's lonely at my work place. I am the Perl Guru at work. They call me FMP, Funk Master Perl. Do you notice that you are going without the essentials food, water, shelter, simply so that you can perl? Not really, I have supplies at my desk at all times: Bottle of water, snacks, sweater, deodorant. Have you ever found yourself waking up in strange places, in clothes you clearly haven't changed in days, with no memory of how you got there, in a littered heap of perl code printouts? change perl code printouts to perl doc printouts and you got me on the money. People REALLY should think about these things before deciding if they really want to even know perl. If I knew then, what I know now, I would have Perl-ed at Perl v1.0. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: stop the Madness
HILARIOUS!! :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: stop the Madness
SO TRUE ! GLAD I AM NOT ALONE !!! HA HA I feel morally compelled to point out to any of the real Newbies who are on the beginner's mailing list that this READS like the usual form of 'deep denial' that needs to come out in the light of day. Oh sure - today its a little text file manipulation, a bit of CGI work with webFoo, a little DBI interface, whack a GUI front end onto some dog piece of software, you can Kick the Habit Any Time You Want. Or at least that is what you tell your friends. It's really only a small piece of bridge code, and you can just make a little perl module to simplify the interface between the various common applications, nothing serious... Oh but if I just subclass FOO::BAR that you found at [TheCPAN|SourceForge|someCoolWebSite|ThisGuyYouMetInSomeDarkBackAlley] then of course I can adapt it to fix this other bit... I merely wanted to have some better monitoring code for our system wide solution - and I merely downloaded from http://www.kernel.org/software/mon/ and all I have to do is just rework a few bits here and there. I mean that way I can monitor the systems more efficiently so that I can spend more time coding this cool little extension to this perl module But if I adopt the p5ee standards, then I have a common technology that will interoperate between my webFront End and my Database Services on Legacy Architectures, including those older OS's where java has not been ported to yet... People REALLY NEED to be forewarned about the dangers! Do you find yourself seeking work where perl is readily available? Do you find yourself spending more of your time with other people who Perl than with normal people? Do you notice that you are going without the essentials food, water, shelter, simply so that you can perl? Have you ever found yourself waking up in strange places, in clothes you clearly haven't changed in days, with no memory of how you got there, in a littered heap of perl code printouts? People REALLY should think about these things before deciding if they really want to even know perl. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: stop the Madness
And there's always those days where you start sending out emails with semicolons at the end of the sentences. Yesterday I even caught myself writing code on a piece of napkin on my lunch. I'm afraid the day will finally come where I start trying to rearrange all of my paragraphs into a single sentence. I mean sure, noone will know what the hell I'm talking about, but look how efficient my speech has become! HELP ME!!! -Original Message- From: A Taylor [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 16, 2002 9:36 AM To: [EMAIL PROTECTED] Subject: Re: stop the Madness SO TRUE ! GLAD I AM NOT ALONE !!! HA HA I feel morally compelled to point out to any of the real Newbies who are on the beginner's mailing list that this READS like the usual form of 'deep denial' that needs to come out in the light of day. Oh sure - today its a little text file manipulation, a bit of CGI work with webFoo, a little DBI interface, whack a GUI front end onto some dog piece of software, you can Kick the Habit Any Time You Want. Or at least that is what you tell your friends. It's really only a small piece of bridge code, and you can just make a little perl module to simplify the interface between the various common applications, nothing serious... Oh but if I just subclass FOO::BAR that you found at [TheCPAN|SourceForge|someCoolWebSite|ThisGuyYouMetInSomeDarkBackAlley] then of course I can adapt it to fix this other bit... I merely wanted to have some better monitoring code for our system wide solution - and I merely downloaded from http://www.kernel.org/software/mon/ and all I have to do is just rework a few bits here and there. I mean that way I can monitor the systems more efficiently so that I can spend more time coding this cool little extension to this perl module But if I adopt the p5ee standards, then I have a common technology that will interoperate between my webFront End and my Database Services on Legacy Architectures, including those older OS's where java has not been ported to yet... People REALLY NEED to be forewarned about the dangers! Do you find yourself seeking work where perl is readily available? Do you find yourself spending more of your time with other people who Perl than with normal people? Do you notice that you are going without the essentials food, water, shelter, simply so that you can perl? Have you ever found yourself waking up in strange places, in clothes you clearly haven't changed in days, with no memory of how you got there, in a littered heap of perl code printouts? People REALLY should think about these things before deciding if they really want to even know perl. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: stop the Madness
print Resistance is futile\n; -Original Message- From: Timothy Johnson [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 16, 2002 1:45 PM To: [EMAIL PROTECTED] Subject: RE: stop the Madness And there's always those days where you start sending out emails with semicolons at the end of the sentences. Yesterday I even caught myself writing code on a piece of napkin on my lunch. I'm afraid the day will finally come where I start trying to rearrange all of my paragraphs into a single sentence. I mean sure, noone will know what the hell I'm talking about, but look how efficient my speech has become! HELP ME!!! -Original Message- From: A Taylor [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 16, 2002 9:36 AM To: [EMAIL PROTECTED] Subject: Re: stop the Madness SO TRUE ! GLAD I AM NOT ALONE !!! HA HA I feel morally compelled to point out to any of the real Newbies who are on the beginner's mailing list that this READS like the usual form of 'deep denial' that needs to come out in the light of day. Oh sure - today its a little text file manipulation, a bit of CGI work with webFoo, a little DBI interface, whack a GUI front end onto some dog piece of software, you can Kick the Habit Any Time You Want. Or at least that is what you tell your friends. It's really only a small piece of bridge code, and you can just make a little perl module to simplify the interface between the various common applications, nothing serious... Oh but if I just subclass FOO::BAR that you found at [TheCPAN|SourceForge|someCoolWebSite|ThisGuyYouMetInSomeDarkB ackAlley] then of course I can adapt it to fix this other bit... I merely wanted to have some better monitoring code for our system wide solution - and I merely downloaded from http://www.kernel.org/software/mon/ and all I have to do is just rework a few bits here and there. I mean that way I can monitor the systems more efficiently so that I can spend more time coding this cool little extension to this perl module But if I adopt the p5ee standards, then I have a common technology that will interoperate between my webFront End and my Database Services on Legacy Architectures, including those older OS's where java has not been ported to yet... People REALLY NEED to be forewarned about the dangers! Do you find yourself seeking work where perl is readily available? Do you find yourself spending more of your time with other people who Perl than with normal people? Do you notice that you are going without the essentials food, water, shelter, simply so that you can perl? Have you ever found yourself waking up in strange places, in clothes you clearly haven't changed in days, with no memory of how you got there, in a littered heap of perl code printouts? People REALLY should think about these things before deciding if they really want to even know perl. ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: stop the Madness
--- Timothy Johnson [EMAIL PROTECTED] wrote: And there's always those days where you start sending out emails with semicolons at the end of the sentences. Yesterday I even caught myself writing code on a piece of napkin on my lunch. I'm afraid the day will finally come where I start trying to rearrange all of my paragraphs into a single sentence. I mean sure, noone will know what the hell I'm talking about, but look how efficient my speech has become! HELP ME!!! @_=Just don't play Perl golf!=~/./g; $=,warn@_[0..$_]\nfor+0..25 Jonathan Perlton^WPaton __ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Stop Perf monitor
does anyone have an idea/script to stop and application like performace monitor.. rename the log file and start the application.. Perfmon does not run as a service..it runs as a process __ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
STOP POSTING CUSS WORDS!
Hello: I believe in free speech, etc. However, broadcasting posts with expletives to crowds of people you don't know is bad net-etiquette. I would appreciate it if posts would focus on the issue, and we all reserve major/minor cussing for private communications. I for one will boycott and not respond to such posts, and I suggest others consider doing the same. This is not a holier than though position. The fact is that my employer uses content filtering software, and every explicate, death threat, etc. is logged. Problematic web or email content winds up being filtered and blocked, and I'd appreciate not losing access to the Perl subscription. Thanks, Lance -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please Stop (was: Re: eval problem)
In a message dated Tue, 2 Oct 2001 6:03:06 PM Eastern Daylight Time, Curtis Poe [EMAIL PROTECTED] writes: Mea Culpa. While I do have some reservations about how prototypes were used in a particular example, I'll try to be more sensitive about the beginners aspect of things. Curtis, That's considerate of you to respond humbly. Personally, even when the responses are over my head, I still appreciate them. Thanks for putting so much energy into your posting. If any post is beyond my current understanding, I either: 1. Learn something 2. Learn about the existence of something I want to learn later. Or... 3. Delete it! Personally, I don't want to put a lid on any discussion. I think the characteristic which distinguishes this list as a beginners' list is not the level of the *response*, but rather the willingness of the respondants to address any *question*. Thanks, Nelson -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please Stop (was: Re: eval problem)
--SNIP-- Personally, I don't want to put a lid on any discussion. I think the characteristic which distinguishes this list as a beginners' list is not the level of the *response*, but rather the willingness of the respondants to address any *question*. Thanks, Nelson And to do so in a friendly, non-demeaning manner :-) -- Michael D. Risser Software Engineer = Machine Vision Products, Inc. www.visionpro.com [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please Stop (was: Re: eval problem)
With all due respect, if you're going to discuss the minutae, nuances, and other advanced Perl stuff, could you please do so on another list? This is [EMAIL PROTECTED] Publicly arguing this sort of thing on this list, at least to me, makes it more intimidating to post what will be my silly neophyte questions. I say this because of the recent banter that has been going (and this particular thread isn't the only example), I conclude that I will not be told the simplest way to solve my problem and as such, I won't be improving my fundamental Perl skills. I will be told of the most difficult way to do such. I will not be able to implement it, and will likely grow even more frustrated with my problem rather than having received some courteous help in having it solved, and then moving on. I joined this list to read what other beginners are doing, how and what they're learning, and how they're moving on. I joined in the hope that one day I can get to the point where I can help others. Here's the two problems *I* perceive: - Too many complicated and complex answers to what are simple questions. - A tad to much eagerness to interject one's personal Perl brilliance to the mailing list. Please remember the best way to impress us n0oBs is to answer our simple questions simply. If you are advanced, and are on this list helping us n0oBs out, please don't be defensive reading this. Please consider that someone, who calls himself a beginner is finding this to be a mailing list whose content (much advanced stuff) doesn't match with the title ([EMAIL PROTECTED]). Please also consider that I'm probably not the only n0oB dissatisfied with the list. You could also say Don't like it? Leave. True. However, I am trying to help fix what I perceive to be a problem, instead of leaving. If nothing changes, I will. Thank you for your time and consideration, -Zander At 11:37 AM 10/2/2001 -0800, Michael Fowler wrote: One of the problems with prototypes is that they are not prototypes, at least not in the sense that other programming languages use them. I am aware of this problem, which, personally, I don't consider a problem, because it is documented fairly clearly. Instead, they allow us, amongt other things, to force function arguments into a particular context. In your example, the first argument *doesn't* have to have a scalar value. I wasn't using the prototype to check the parameters, I was using it to ease the use of the function. Without the prototype the function would have to be called thusly: append_and_print(\$stuff_to_print, hi, there\n); The prototype serves simply to enreference $stuff_to_print, so it doesn't have to be enreferenced by the programmer using it. It was meant for nothing more. With both solutions there is the possibility of passing a reference to another type of data. The only solution, if this is considered a serious enough problem, is to check the parameters more thoroughly. The code snippet I gave was but an example of one solution, it was not meant to be used without examination by the person using it. Michael -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please Stop (was: Re: eval problem)
On Wed, 3 Oct 2001, Zander Collier wrote: With all due respect, if you're going to discuss the minutae, nuances, and other advanced Perl stuff, could you please do so on another list? I'm inclined to agree... however, I think it is helpful for beginners also to be amongst more advanced conversation to get a better feel for the language, even if they can't follow a lot of it, without being stuck on one of the really advanced lists (like perl-porters or perl-friends). While the simplest answer is usually the best one (Occam's razor), delving into deeper or more rigorous solutions can never hurt, and the chance that something really cool that can be used in a programmer's toolbox may come about. I have found, being neither a beginner nor an expert like some of the other people on this list, that I can follow the advanced discussions here more easily than I can on the hardcore Perl lists -- the advanced folks here seem to have a better knack at explaining things, which, I guess, is one of the reasons they are on this list -- they like to explain complex topics to make them understandable to those seeking understanding. -- Brett http://www.chapelperilous.net/ Oh, yeah, life goes on, long after the thrill of livin' is gone. -- John Cougar, Jack and Diane -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please Stop (was: Re: eval problem)
--- Zander Collier [EMAIL PROTECTED] wrote: With all due respect, if you're going to discuss the minutae, nuances, and other advanced Perl stuff, could you please do so on another list? This is [EMAIL PROTECTED] Mea Culpa. While I do have some reservations about how prototypes were used in a particular example, I'll try to be more sensitive about the beginners aspect of things. Cheers, Curtis Ovid Poe = Senior Programmer Onsite! Technology (http://www.onsitetech.com/) Ovid on http://www.perlmonks.org/ __ Do You Yahoo!? Listen to your Yahoo! Mail messages from any phone. http://phone.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please Stop (was: Re: eval problem)
While this is true, it's seldom clear to the beginner when this list has diverted to esoterica. It's *critical* for a beginner to know what they *don't* need to pay attention to at the beginning, and we do them a disservice by commingling easy and not-so-easy stuff. So I'd back Zander, and ask people who want to get into advanced stuff to take it somewhere like comp.lang.perl.{misc,moderated}. There are plenty of places for intermediate or advanced talk, but precious few for the beginner. Well, being somewhat of a beginner myself, I think it is very helpful to look at stuff that's above your head. I certainly don't mind the fact that 80% of the stuff on this list is above me, and I think that, when I do start dealing with some of the more advanced stuff, I'll have had a little introduction to it here (Oh yeah, I remember so-and-so mentioned that...). Overall, I think it's beneficial to see stuff that's above your head, no matter what level you're at, as long as it's made clear that total beginners can can ask simple questions and not be flamed for it. Before we try to rid ourselves of advanced topics, I think we should simply try to answer beginners' questions more clearly and nicely. (Less of the just use this regex instead: m/^(?:[a-f\d])*?\.+?[^\d\w]?\d+\s\w+?\s/ig or it already TOLD you to do that and you apparently didn't pay any attention type of stuff.) Well, that's my $0.02. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com -Michael Kelly Email: [EMAIL PROTECTED] The Web: http://jedimike.hypermart.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please Stop (was: Re: eval problem)
At 03:23 PM 10/02/2001 -0700, Michael Kelly wrote: Well, being somewhat of a beginner myself, I think it is very helpful to look at stuff that's above your head. I certainly don't mind the fact that 80% of the stuff on this list is above me, and I think that, when I do start dealing with some of the more advanced stuff, I'll have had a little introduction to it here (Oh yeah, I remember so-and-so mentioned that...). Overall, I think it's beneficial to see stuff that's above your head, no matter what level you're at, as long as it's made clear that total beginners can can ask simple questions and not be flamed for it. I definitely agree with you, Michael. It's kind of like any activity, such as basketball or tennis. If you force yourself to watch and play with people who are much more advanced than you, you'll naturally end up getting better by osmosis. Although a lot of the Perl discussion that goes on in c.l.p.m. goes over my head, I'll end up digging that discussion out of my memory banks (and dejanews) the next time I have a Perl problem, simply by virtue of having seen such a discussion take place. Of course that being said, I suppose is it out of the charter of this mailing list to exercise ones advanced Perl muscle needlessly. I can understand that it does more harm than good to show a newbie some cool and efficient--yet obfuscated--method of getting a simple task done, when said newbie is still in the stages of learning the core language and methodologies first. I can imagine this is why many people are turned off by Perl because they see a lot of compact, read only code written by experienced Perl jockeys :) Just my $.02...Aloha, mel -- mel matsuoka Hawaiian Image Productions Chief Executive Alphageek(vox)1.808.531.5474 [EMAIL PROTECTED](fax)1.808.526.4040 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
stop
unsubscribe
Re: stop
unsubscribe -- THE GREATEST ACHIEVEMENT IN THE HUMAN RACE IS SELF-RESPECT.
stop
unsubscribe __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
RE: stop
RTFM http://learn.perl.org -Original Message- From: Jonathan Macpherson [mailto:[EMAIL PROTECTED]] Sent: 22 May 1997 02:33 To: [EMAIL PROTECTED] Subject: stop unsubscribe --Confidentiality--. This E-mail is confidential. It should not be read, copied, disclosed or used by any person other than the intended recipient. Unauthorised use, disclosure or copying by whatever medium is strictly prohibited and may be unlawful. If you have received this E-mail in error please contact the sender immediately and delete the E-mail from your system.
stop!
unsubscribe GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/tagj.
Re: Please tell your people to stop sending E-mail to me.
he he... i just finished receiving over 700 emails from the list during the weekend. ironic how the pleas to stop actually create more mail for those poor subscribers... i think the unsubscribe script is actually on the homepage at: http://learn.perl.org/ PS, you can try the digest version, which creates way less mail. On Tuesday, June 19, 2001 17:17, Myrian Hernandez [EMAIL PROTECTED] wrote: Please, unsubscribe me too. I can not stand the email flooding anymore. -Mensaje original- De: Rochel Kraus [mailto:[EMAIL PROTECTED]] Enviado el: Martes, 19 de Junio de 2001 16:56 Para: [EMAIL PROTECTED] Asunto: Fwd: Please tell your people to stop sending E-mail to me. I agree!! I've been getting 160+ emails a day and I can't get off this list
How to stop mails from beginners@perl.org
Some people have obviously lost the first email they received from this list, so here's a recap. To unsubscribe to the list, you need to send an email to a special email address that is formed partly from YOUR OWN email address. For example, if your email address is [EMAIL PROTECTED], you should send an email to [EMAIL PROTECTED] - if your email address is [EMAIL PROTECTED], you should send an email [EMAIL PROTECTED] . Simple, yes? --nigel This e-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. ONdigital plc, 346 Queenstown Road, London SW8 4DG. Reg No: 3302715.
Re: How to stop mails from beginners@perl.org
Nigel == Nigel Wetters [EMAIL PROTECTED] writes: Nigel Some people have obviously lost the first email they received Nigel from this list, so here's a recap. Nigel To unsubscribe to the list, you need to send an email to a Nigel special email address that is formed partly from YOUR OWN email Nigel address. For example, if your email address is Nigel [EMAIL PROTECTED], you should send an email to Nigel [EMAIL PROTECTED] - if your Nigel email address is [EMAIL PROTECTED], you should send an email Nigel [EMAIL PROTECTED] . Nigel Simple, yes? No, it's even simpler. Just send to [EMAIL PROTECTED] from your own address. If *that* doesn't work, it tells you what to do next. And *that* is in the *header* of *every* message sent by the mailhandler. It's hard to lose that. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/ Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Please tell your people to stop sending E-mail to me.
I have unsubscribed to all your supposed E-mail subscriptions. You you PLEASE pass the word to your subscribers to stop sending e-mail to me concerning Perl. Your subscribers are flooding me e-mail 90+ e-mail a day. I original subscribed to your server to get some insight into using Perl. I am very sorry I did so. Once more PLEASE pass the word to the people that are connected to your server to QUIT flooding me with there e-mails, I do not want to here from them. PLEASE get the word out. __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/
Fwd: Please tell your people to stop sending E-mail to me.
I agree!! I've been getting 160+ emails a day and I can't get off this list and it's driving me crazy. If this doesn't stop soon, I am going to have to open up a new e-mail account for myself!!! Please unsubscribe me richard kirby [EMAIL PROTECTED] wrote: Date: Tue, 19 Jun 2001 14:11:43 -0700 (PDT) From: richard kirby Subject: Please tell your people to stop sending E-mail to me. To: [EMAIL PROTECTED] I have unsubscribed to all your supposed E-mail subscriptions. You you PLEASE pass the word to your subscribers to stop sending e-mail to me concerning Perl. Your subscribers are flooding me e-mail 90+ e-mail a day. I original subscribed to your server to get some insight into using Perl. I am very sorry I did so. Once more PLEASE pass the word to the people that are connected to your server to QUIT flooding me with there e-mails, I do not want to here from them. PLEASE get the word out. __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/ - Do You Yahoo!? Yahoo! Buzz Index - Spot the hottest trends in music, movies,and more.
RE: Please tell your people to stop sending E-mail to me.
Please, unsubscribe me too. I can not stand the email flooding anymore. -Mensaje original- De: Rochel Kraus [mailto:[EMAIL PROTECTED]] Enviado el: Martes, 19 de Junio de 2001 16:56 Para: [EMAIL PROTECTED] Asunto: Fwd: Please tell your people to stop sending E-mail to me. I agree!! I've been getting 160+ emails a day and I can't get off this list and it's driving me crazy. If this doesn't stop soon, I am going to have to open up a new e-mail account for myself!!! Please unsubscribe me richard kirby [EMAIL PROTECTED] wrote: Date: Tue, 19 Jun 2001 14:11:43 -0700 (PDT) From: richard kirby Subject: Please tell your people to stop sending E-mail to me. To: [EMAIL PROTECTED] I have unsubscribed to all your supposed E-mail subscriptions. You you PLEASE pass the word to your subscribers to stop sending e-mail to me concerning Perl. Your subscribers are flooding me e-mail 90+ e-mail a day. I original subscribed to your server to get some insight into using Perl. I am very sorry I did so. Once more PLEASE pass the word to the people that are connected to your server to QUIT flooding me with there e-mails, I do not want to here from them. PLEASE get the word out. __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/ - Do You Yahoo!? Yahoo! Buzz Index - Spot the hottest trends in music, movies,and more.
this email is comming to me by mistake, Please stop sending.
To subscribers at Perl.org I have received at least 150 emails today, these letters that you all are sending to Perl.org are landing in my email box, and not to perl.org... Sincerly, Over it! -Original Message- From: Teresa Raymond [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 07, 2001 2:52 PM To: beginnerperllist Subject: More Succinctification How can we make this code more succinct? #LOOP TO INITIALIZE VARIABLES + TEST N COMMANDS FOR MATCH IS YES foreach $i (sort(@indata)) {chop($i); ($aptname,$address,$city,$zip,$phone,$location,$bedrooms,$rentmin,$ren tmax,$pets,$laundry,$garage,$comment,$aptweb,$aptemail,$graphic)=split (/\|/,$i); if (($in{'location'} eq All || $location=~/$in{'location'}/ig) ($in{'bedrooms'} eq Any || $bedrooms=~/$in{'bedrooms'}/ig || ($in{'bedrooms'} eq 4 plus Bedrooms ($bedrooms=~/4 Bedrooms/ig || $bedrooms=~/5 Bedrooms/ig || $bedrooms=~/6 Bedrooms/ig))) ($rentmin=$in{'rentmax'} $rentmax=$in{'rentmin'}) ($pets=~/$in{'pets'}/ig || $in{'pets'} eq Doesn't Matter || ($in{'pets'}=~/yes/ig ($pets=~/Cats/ig || $pets=~/Some Units/ig))) ($laundry=~/$in{'laundry'}/ig || $in{'laundry'} eq Doesn't Matter || ($in{'laundry'}=~/yes/ig $laundry=~/Some Units/ig)) ($garage=~/$in{'garage'}/ig || $in{'garage'} eq Doesn't Matter || ($in{'garage'}=~/yes/ig $garage=~/Some Units/ig))) {$match=yes; print trtd rowspan=\5\img src=\$url/aptimages/$graphic\ height=\150\ width=\150\ hspace=\10\ alt=\Apartment Graphic\td colspan=\2\br/td/tr\n; print trtd colspan=\2\biResult/i/b: , $apartment++, /td/tr\n; print trtda href=\http:/$aptweb\$aptname/abr$addressbr$city $zipbr$phonebra href=\$url$urlcgi/aptemailhtml.cgi?aptemail=$aptemailaptname=$aptnam ephone=$phone\Contact Us/a/tdtd width=\350\ valign=\top\ibRent/b/i: $rentmin to $rentmaxbribBedrooms/b/i: $bedrooms/td\n; print /tr\n; print trtdbiPets:/i/b $pets biLaundry:/i/b $laundry biGarage:/i/b $garage/tdtdbr/td\n; print /tr\n; print trtdbiHyde Park Location:/i/b $location/tdtdbr/td\n; print /tr; print trtd colspan=\2\biComments:/i/b$comment/td\n; print /tr\n; } } print /table\n; -Teresa Raymond http://www.mariposanet.com [EMAIL PROTECTED]