Re: Variable to refer to program name

2009-08-21 Thread asmith9983
Hi Erez You may also be surprised to learn that all perl features are well documented. You get the index with "perldoc perl", and the page referring to the one you needed "perldoc perlvar". I'd recommend reading all the online docs as they describe all the features of the language. -- Andr

Re: Syntax query

2009-04-15 Thread asmith9983
I'd suggest placing your pipeline of commands into a bash shell script and running it manually from the command line and carefully observing it running. That way you are then dealing with a known quantity outwith any Perl issues. As someone else replied, consider using the "qx" command rather th

Re: "Programming Perl" vs perldoc

2009-04-08 Thread asmith9983
I've found the site:- http://www.pdf-search-engine.com/perl-pdf.html very useful for things I've worked on for examples. I would say, if you find a book thats good show respect to the author ande purchase a copy. -- Andrew in Edinburgh Scotland On Wed, 8 Apr 2009, Brian J. Miller wrote: Ric

Re: Good Resource (book) for RegEx

2008-12-04 Thread asmith9983
Hi From my experience after reading what has been suggested is to try and do some real examples which test you knowledge to the limit. What is the difference between a Basic Regular Expression and an Extended Regular Expression ? When you think you know, try putting together a 30 minute talk

Re: Delete file if it contains x y or z

2008-09-06 Thread asmith9983
Here's another way, but not necessarily the best Perl, but it does work: #!/usr/bin/env perl use strict; use warnings; my @filelist=; chomp @filelist; my $match_strings=qr '(abc123blue|xyz357green)'; my ($file, ); foreach $file (@filelist) { #print "file=$file\n"; open(FD,"<$file") or die "Cann

Re: Perl and "vi" (not "vim") , ctags like feature in Perl !

2008-08-27 Thread asmith9983
Hi The program is called "screen" just in case you are looking fo it. The first sentence from the man page says "Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells)." On Linux I also use Ctrl-Z whrn in vim to go o

Re: question about text operation using regex.

2008-08-06 Thread asmith9983
The following Perl one-liner will do what you need perl -n -e 's/(.{8,8}).(.*)/$1$2/;print ;' The first set of parentheses strips out the first 8 characters, the second set strips out everything after the 9th character which is lost. My test line was:- (echo "1234567890";echo "abcdefghijkl")|pe

Re: TCP apllications

2008-06-06 Thread asmith9983
Hi Arun You didn't say what you really wanted to achieve. Do yo want to dabble and learn from that experience what using network modules is all about ? -- Andrew Edinburgh,Scotland On Fri, 6 Jun 2008, Arun wrote: Hi, This is Arun here, i am new to Perl so i was just thinking of programming

Re: reference to subroutine???

2008-03-27 Thread asmith9983
Hi I copied the code into a script so I could be sure it was the exactly the same source being used on version 5.8.8 and 5.10.0. I'm running an AMD Athlon64 x2 & Ubuntu 7.10 but that is I think irrelevant. For those not familiar with vim line #2 turns off syntax colouring for this file only.Its

Re: How to read an rfc spec

2008-01-28 Thread asmith9983
Hi everyone It cost nothing to be polite and only a few seconds to be helpful. I was myself looking at RFC822 a few days ago to try to figure out what headers should be in an email message I bounce with my Perl re-wtite script from a procmail recipe. Secret formats and being generally unhelpfu

Re: Array Manipulation

2007-10-25 Thread asmith9983
Hi This will do what you want:- perl -le '@test=(1,2,3,4,5);print join "\n",@test;' The -l option ensures a final newline after the last element of the array is printed. The order of the options is important as changing it to "el" wouldn't work. -- Andrew Edinburgh,Scotland On Thu, 25 Oct

RE: Regex help

2007-09-03 Thread asmith9983
Hi Unless Perl is the only tool available to you in your toolbox and if you're running Linux or similar consider the "tr -s " command in a shell. However if you are strictly limited to Perl then this stand regex works:- echo ","|perl -ane 's/,*/,/;print' Try it by cutting and pasting it.