RE: Help with fileglob: Unix vs. Windows?

2004-01-21 Thread Perry, Alan
On Wednesday, January 21, 2004 10:53, McMahon, Chris queried: > >But this script doesn't do right in Windows: Modify the code as shown, and it should work: >use warnings; >use strict; >my $dir = "E:\\Documents and Settings\\cmcmahon\\Desktop"; You have to escape the spaces, and for some reas

RE: Split question

2003-12-15 Thread Perry, Alan
On Monday, December 15, 2003 03:05, John W. Krahn wrote: >Here is a little quiz for you beginners out there. split() treats its >first argument as a regular expression. There are TWO exceptions where >the first argument does not behave the same as a normal regular >expression. What are they? T

RE: Regular Exprections

2003-11-25 Thread Perry, Alan
Hacksaw wrote: > > $str =~ s/--\%\%.*?\%\%--/--\%\%\%\%--/sg; You don't need all those backslashes. This works as well (and IMHO is easier to read): $str =~ s/--%%.*?%%--/----/sg; Alan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Top-posting

2003-11-05 Thread Perry, Alan
Rob Dixon wrote: > Scott E Robinson wrote: >> >> Randal wrote: >>> >>> Scott E Robinson wrote: >>> (And, sorry for the top-posting. I haven't figured out how to fix that!) >>> >>> Uh, press the down arrow about a dozen times. How *hard* is that? >> >> Lotus Notes adds a header to

RE: complex condition

2003-10-30 Thread Perry, Alan
Andrew Gaffney wrote: > >Steve Gilbert wrote: >> I know there must be a way to do the following: >> >> if (($foobar > 3) || ($foo="t" && $bar = "b")) {print >> "yup"} > >if (($foobar > 3) || ($foo eq "t" && $bar eq "b")) {print "yup"} > >Your problem is that a single '=' is assignment, not equalit

RE: Regex searches including spaces

2003-10-23 Thread Perry, Alan
Paul Harwood wrote: >I am trying to parse through the following line: > >TUITimer> TUI Dead Air Timer::1828ms:: > >I want to extract the 1828 value. The regex I have is: > >if ( /TUI Dead Air(\d+)/ ) { > >I know this is wrong but I have tried every variation >of \s that I can think of with no su

RE: Trivial 'unless' Question

2003-10-21 Thread Perry, Alan
On Tuesday, October 21, 2003 16:01, Kevin Pfeiffer wrote: >In article <[EMAIL PROTECTED]>, Steve Grazzini wrote: > >> On Tue, Oct 21, 2003 at 01:06:44PM -0700, Jeff Westman wrote: >>> Steve Grazzini <[EMAIL PROTECTED]> wrote: >>> > On Tue, Oct 21, 2003 at 12:17:17PM -0700, Jeff Westman wrote: >>>

RE: Perl Newbie - Need good book recommendation

2003-09-30 Thread Perry, Alan
>> Big advice #2. Ebay. I buy all new books and expensive books through >> trusted sellers for about a 50-60% savings. Make sure you can pay media >> rate on the shipping. $4.00. I routinely buy books for $15-20 here. > >I do the same thing, and would add the following sites: > >http://www.ali

RE: Getting rid of white space...

2003-09-04 Thread Perry, Alan
On Thursday, September 04, 2003 11:11, Marshall, Stephen wrote: > >Got it working this way fror the important line, but theres probably a slicker way of doing it. > >$line =~ s/(\s)+/ /g; > This will work, but may leave an extraneous space at the beginning and/or end of the line. This text: "

RE: reverse range (10..1)

2003-08-27 Thread Perry, Alan
On Wednesday, August 27, 2003 08:30, James Edward Gray II wrote: > >On Wednesday, August 27, 2003, at 05:39 AM, Ramprasad A Padmanabhan >wrote: > >> IMHO this list is not for solving puzzles or doing school homework , >> It is for people learning perl who are getting stuck due to pure perl >> p

RE: quick re help

2003-08-14 Thread Perry, Alan
Robert J Taylor wrote: > >[EMAIL PROTECTED] inquired: > > >> This regex looks familiar. I'm going to suggest a big change in a > >> bit. > >> Oh, and [\s|\S], which could be [\s\S], is kind of awkward. > > > what is less awkward than [\s|\S] for 'match anything?' > >. > >Yes ->.<- > >Dot, period,

RE: What is qr for in reg expressions in a a string?

2003-08-14 Thread Perry, Alan
On Wednesday, August 13, 2003 10:45, [EMAIL PROTECTED] wrote: >I've been reading the previous post and was wondering about what qr does in >this code. > >use strict; >  use warnings; > >  my @array = ( >    qr'^to: myprog'mi, >    qr'^from: [EMAIL PROTECTED]'mi >  ); > >  my $str = 'To: myprog wi

RE: What is qr for in reg expressions in a a string?

2003-08-14 Thread Perry, Alan
On Wednesday, August 13, 2003 11:42, Rob Dixon wrote: > >Alan Perry wrote: >> <[EMAIL PROTECTED]> wrote: >> > I've been reading the previous post and was wondering about what qr does > >[snip] > >> For the second array item, the line translates to: >> print "found\n" if $str =~ '^from: [EMAIL PRO

RE: quick re help

2003-08-14 Thread Perry, Alan
Jeff 'japhy' Pinyan wrote: > >On Aug 14, Perry, Alan said: > >>So, /[\s\S]/ would match a "\n", while /./ would not. The equivalent of >>/[\s\S]/, using period notation, would be /[.\n]/ > >Not so much; the . in a character class matches just itse

RE: SOLVED: how do i list the methods connected to a object?

2003-08-07 Thread Perry, Alan
On Thursday, August 07, 2003 11:28, Dan Muey wrote: >>>sub dump_functions { >>>use Class::Inspector; >>>my $r = ref $_[0]; >>>return [ grep /^$r/, @{ >>>Class::Inspector->methods($r,'full','public')} ] } >> >> Yeah. The 'return' keyword can even be left out. > >Nice! I'll leave it i

RE: While loop on a file handle

2003-08-06 Thread Perry, Alan
On Tuesday, August 05, 2003 12:13, Trevor Morrison wrote: > >Hi, > >I am trying to step through each line of a file that contains orders that >were place through a internet shopping cart. I have this code: > > open(ORDER,$order) or die "Error opening \"$order\": $OS_ERROR\n"; > >print "HI\n"; > wh

RE: starting off

2003-07-16 Thread Perry, Alan
Paul D. Kraus wrote: > >> need any tips as to start perl programming , so if you could help i would >really appreciate it . Iam really good with batch file programming , anda >bit > of C++ so if any help could be shot this way i would make it worth >your while ;D > >http://www.amazon.com/exec/obido

RE: Array Question

2003-06-25 Thread Perry, Alan
Oops, the second batch of code has a problem... It should read: print "Name your friends: "; $friends = ; chomp($friends); @names = split(/ +/, ); print "I know $names[1].\n"; Sorry about that... - Alan -Original Message----- From: Perry, Alan [mailto:[EMAIL PROTEC

RE: Array Question

2003-06-25 Thread Perry, Alan
Unlike others that are suggesting that you forget about user input, I thought you might want to see how it can work on Windows. I know that it would bug me as to how to do this if I were in your position... print "Name your friends: "; @names = split(/[ \n]+/, ); print "I know $names[1].\n"; The

RE: how can I delete a line?

2003-03-26 Thread Perry, Alan
Rob Dixon wrote: > >Michael Weber wrote: >> I know this is a perl list, but just because you have a hammer in your >> hand doesn't make everything a nail, right? >> >> How about >> >> sed '132,134d' datafile > newfile > >I also have a solution involving a hydraulic jack and a pint of >whipped crea

RE: Removing duplicates from an array

2003-02-10 Thread Perry, Alan
See below. Beau E. Cox wrote: > Hi - > >> From: R. Joseph Newton [mailto:[EMAIL PROTECTED]] >> Subject: Re: Removing duplicates from an array >> >> Troy May wrote: >> >>> Hello, >>> >>> What's the best and cleanest way to remove duplicates from an array? I >>> have an array that reads entries

RE: Tk with Perl

2003-01-23 Thread Perry, Alan
Tony Esposito wrote: > I am using ActiveState Perl 5.6.1. That does not seem too old to me. > Is there an ftp site where I can download Tk.pm? > Then I will install Tk using the Perl Package Mgr. There is actually no need for that, as long as you have Internet access. If you type (note the "ppm3

RE: other new news ???

2003-01-21 Thread Perry, Alan
[EMAIL PROTECTED] wrote: > Hi all, > > i have head that switch is introduced from perl 5.8. what are all the > other new additions to the perl??? For a complete list of changes, go to: http://dev.perl.org/perl5/news/2002/07/18/580ann/perldelta.html Alan -- To unsubscribe, e-mail: [EMAIL PROTE

RE: Top Posting Preferences (was navigate the directories)

2003-01-09 Thread Perry, Alan
Perry, Alan wrote: > And, top-posters can configure it so that they can still top-post, > but the >> 's will still get fixed! Well, I guess it's not perfect... :-) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Top Posting Preferences (was navigate the directories)

2003-01-09 Thread Perry, Alan
Bob Showalter wrote: > Rob Dixon wrote: >> I personally choose to top-post so that anybody reading through a >> thread won't have to page to the end of each post to get to new >> content. > > Since all the top-posters are weighing in, I better add my vote > against it. Responses should be in-line

RE: Editors

2002-12-19 Thread Perry, Alan
A better (IMHO) implementation of VI is at http://www.vim.org. The Windows version can be downloaded at ftp://ftp.vim.org/pub/vim/pc/gvim61.exe. Enjoy! -Original Message- From: Dylan Boudreau [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 10:19 To: [EMAIL PROTECTED] Subject

RE: parse out parts of dir / files /

2002-12-10 Thread Perry, Alan
Not sure if this will help, but something like this would work... foreach ( `ls -d1 $source/06/*` ) { # each line of output goes into $_ @group = split(m|/|, $_); # split out filename parts $pcgname = pop(@group); # gets filename $bu = pop(@group); #

RE: Special Name for @ Element

2002-11-19 Thread Perry, Alan
Yep, just leave off the "$element" from the statement you wrote. Then you can use $_ for the current element. Example: @array = ("first", "second", "third", "fourth"); foreach (@array) { print "$_\n"; } would print first second third fourth - Alan -Original Message- From: Sturdevan

RE: Hide password entry

2002-11-19 Thread Perry, Alan
>From perlfaq8, How do I ask the user for a password? (This question has nothing to do with the web. See a different FAQ for that.) There's an example of this in crypt in the perlfunc manpage. First, you put the terminal into ``no echo'' mode, then just read the password normally. You may do thi

RE: Hash Sorting?

2002-11-06 Thread Perry, Alan
I think the second example should be: foreach(sort {$hash{$a} cmp $hash{$b}} keys %hash){ do something... } Notice the %hash (and not $hash) at the end. -Original Message- From: Timothy Johnson [mailto:tjohnson@;sandisk.com] Sent: Wednesday, November 06, 2002 17:07 To: 'Kurtis'; [EMAI