RE: Using a regular expression to remove all except certaincharacters.

2006-08-25 Thread Timothy Johnson
Didn't see this one before I hit 'Send'. -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Friday, August 25, 2006 6:28 PM To: Perl Beginners Subject: Re: Using a regular expression to remove all except certaincharacters. John W. Krahn wrote: Or remove the /d

RE: Using a regular expression to remove all except certaincharacters.

2006-08-25 Thread Timothy Johnson
Comments below. -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Friday, August 25, 2006 6:25 PM To: Perl Beginners Subject: Re: Using a regular expression to remove all except certaincharacters. Dr.Ruud wrote: >> >> You might actually be looking for this: >> >>

Accessing Clickbank Data

2006-08-25 Thread Mike Blezien
Hello, we are trying to setup an remote system to obtain account data records for our client, which can be exported out as HTML or CSV file. The problem is after the script remotely logs in, clickbank system sets a encrypted cookie called 'token' for secure connections only. we pass the init

Re: Using a regular expression to remove all except certain characters.

2006-08-25 Thread John W. Krahn
Mumia W. wrote: > On 08/25/2006 04:26 PM, Jim Schueckler wrote: >> Hi, >> I need to remove all characters from a string except 'a'..'z', 'A'..'Z', >> and '0'..'9'. >> [...] > > $newstring = $oldstring; > $newstring =~ s/[^[:alnum:]]+//g; > > Everything that's not alphanumeric gets zapped to nothi

Re: Using a regular expression to remove all except certaincharacters.

2006-08-25 Thread John W. Krahn
John W. Krahn wrote: > Dr.Ruud wrote: >>Jim Schueckler schreef: >> >>>I need to remove all characters from a string except 'a'..'z', >>>'A'..'Z', and '0'..'9'. >>> >>>Could somebody please tell me the magicWords for: >>> $newstring = magicWords($oldstring);??? >>> >>>I am absolutely new to Per

Re: Using a regular expression to remove all except certaincharacters.

2006-08-25 Thread John W. Krahn
Dr.Ruud wrote: > Jim Schueckler schreef: > >>I need to remove all characters from a string except 'a'..'z', >>'A'..'Z', and '0'..'9'. >> >>Could somebody please tell me the magicWords for: >> $newstring = magicWords($oldstring);??? >> >>I am absolutely new to Perl and regular expressions, so

Re: Using a regular expression to remove all except certain characters.

2006-08-25 Thread Mumia W.
On 08/25/2006 04:26 PM, Jim Schueckler wrote: Hi, I need to remove all characters from a string except 'a'..'z', 'A'..'Z', and '0'..'9'. [...] $newstring = $oldstring; $newstring =~ s/[^[:alnum:]]+//g; Everything that's not alphanumeric gets zapped to nothing. HTH -- To unsubscribe, e-mail

Re: Using a regular expression to remove all except certaincharacters.

2006-08-25 Thread Dr.Ruud
Jim Schueckler schreef: > I need to remove all characters from a string except 'a'..'z', > 'A'..'Z', and '0'..'9'. > > Could somebody please tell me the magicWords for: >$newstring = magicWords($oldstring);??? > > I am absolutely new to Perl and regular expressions, so please don't > assum

subroutine in LWP - in order to get 700 forum threads

2006-08-25 Thread jobst müller
hello dear Perl-addicted, to admit - i am a Perl-novice and ihave not so much experience in perl. But i am willing to learn. i want to learn perl. As for now i have to solve some tasks for the college. I have to do some investigations on a board where i have no access to the db. first of -

Re: smtp authentication

2006-08-25 Thread Dr.Ruud
Alan Sanders schreef: > defined ($smtp->auth($username, $password)) > or die "Can't authenticate: $!\n"; > > $smtp->auth($username, $password); Why twice? -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTEC

Re: smtp authentication

2006-08-25 Thread Tom Phoenix
On 8/25/06, Alan Sanders <[EMAIL PROTECTED]> wrote: my $mail_server = "mailhost"; my $username = "login"; my $password = "password"; I hope you're using the real values when you run your code for real. my $smtp = Net::SMTP->new($mail_server, Hello => 'mailhost', Port => 587, Timeout => 60,

smtp authentication

2006-08-25 Thread Alan Sanders
Hey, I'm trying to send mail over my server (1and1.com). They require smtp authentication in order to send. I'm using windows XP. Here is my code: #!/usr/bin/perl -w use strict; use Net::SMTP; my $mail_server = "mailhost"; my $username = "login"; my $password = "password"; my $msg = "This is

Re: -F vs split

2006-08-25 Thread Tom Phoenix
On 8/25/06, John W. Krahn <[EMAIL PROTECTED]> wrote: See the link in my post for the "bug" report I already filed on this. Ah, I see that it's been fixed (or at least documented). Thanks. --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comma

Re: Using a regular expression to remove all except certain characters.

2006-08-25 Thread John W. Krahn
Jim Schueckler wrote: > Hi, Hello, > I need to remove all characters from a string except 'a'..'z', 'A'..'Z', > and '0'..'9'. > > Could somebody please tell me the magicWords for: > $newstring = magicWords($oldstring);??? > > I am absolutely new to Perl and regular expressions, so please

RE: Using a regular expression to remove all except certaincharacters.

2006-08-25 Thread Timothy Johnson
How about this? #Substitute any character that is not one of the ones in #our character class with nothing $newstring =~ s/[^a-zA-Z0-9]//g; Note the '^' at the start of the character class. In a character class it means "not", as in "not these characters". If you see it at the start

Using a regular expression to remove all except certain characters.

2006-08-25 Thread Jim Schueckler
Hi, I need to remove all characters from a string except 'a'..'z', 'A'..'Z', and '0'..'9'. Could somebody please tell me the magicWords for: $newstring = magicWords($oldstring);??? I am absolutely new to Perl and regular expressions, so please don't assume I know anything that everybody el

Re: CGI redirect question, slightly OT

2006-08-25 Thread Mumia W.
On 08/25/2006 02:58 PM, Michael Weber wrote: Greetings, perlers! Greetings, Michael. [...] # Now that we're done, redirect the user to an "all done" page... print "Location: file:///Y:/Public_Info/IS/whitelist_done.html\r\n\r\n"; You can only redirect to web-servers. Redirection to locat

Re: replace multiple tokens

2006-08-25 Thread John W. Krahn
Moon, John wrote: > I have the follows code > perl -e ' > @a=(q{a...x name=taga_1 #...d name=tagb_1 f...r name=tagc_1 xxnn}, > q{h...e name=taga_4 t...g name=tagb_4 k name=tagc_4 nn}); > $ndx = 0; > foreach $ln (@a) { > print "b4 = $ln\n"; > $ln =~s/(name=.*)\d+/\1$ndx/g; You should u

Re: -F vs split

2006-08-25 Thread John W. Krahn
Tom Phoenix wrote: > On 8/25/06, Robert Citek <[EMAIL PROTECTED]> wrote: > >> $ echo 'a: b' | perl -F'/: /' -lane 'print join("--", @F)' >> a: b > > For some reason, the space character seems not to match a space > character. I'd call it a bug. Other ways to match a space, like \s and > \x20, all

Re: replace multiple tokens

2006-08-25 Thread Robin Norwood
"Moon, John" <[EMAIL PROTECTED]> writes: > I have the follows code > perl -e ' > @a=(q{a...x name=taga_1 #...d name=tagb_1 f...r name=tagc_1 xxnn}, > q{h...e name=taga_4 t...g name=tagb_4 k name=tagc_4 nn}); > $ndx = 0; > foreach $ln (@a) { > print "b4 = $ln\n"; > $ln =~s/(name=.*)\d+

Re: -F vs split

2006-08-25 Thread Dr.Ruud
Robert Citek schreef: > Why do these two commands not produce the same output? > > $ perl -le 'print join("--", split(/: /, "a: b"))' > a--b > > $ echo 'a: b' | perl -F'/: /' -lane 'print join("--", @F)' > a: b > > From reading 'perldoc perlrun' the -F option should behave just like > the pattern

Re: -F vs split

2006-08-25 Thread Tom Phoenix
On 8/25/06, Robert Citek <[EMAIL PROTECTED]> wrote: $ echo 'a: b' | perl -F'/: /' -lane 'print join("--", @F)' a: b For some reason, the space character seems not to match a space character. I'd call it a bug. Other ways to match a space, like \s and \x20, all seem to work: echo 'a: b' | p

Re: -F vs split

2006-08-25 Thread Robert Citek
On Aug 25, 2006, at 3:30 PM, John W. Krahn wrote: This is a "feature" :-) This thread may help explain: http://groups.google.com/group/perl.perl5.porters/browse_frm/thread/ 2eca0c52a1b299c4/f655bddfdbf2d0d6? lnk=st&q=&rnum=1&hl=en#f655bddfdbf2d0d6 One way to do what you want: $ echo 'a:

replace multiple tokens

2006-08-25 Thread Moon, John
I have the follows code perl -e ' @a=(q{a...x name=taga_1 #...d name=tagb_1 f...r name=tagc_1 xxnn}, q{h...e name=taga_4 t...g name=tagb_4 k name=tagc_4 nn}); $ndx = 0; foreach $ln (@a) { print "b4 = $ln\n"; $ln =~s/(name=.*)\d+/\1$ndx/g; print "af = $ln\n"; $ndx++

Re: -F vs split

2006-08-25 Thread John W. Krahn
Robert Citek wrote: > > Why do these two commands not produce the same output? > > $ perl -le 'print join("--", split(/: /, "a: b"))' > a--b > > $ echo 'a: b' | perl -F'/: /' -lane 'print join("--", @F)' > a: b > > From reading 'perldoc perlrun' the -F option should behave just like > the patt

hash look up table for rolling logs

2006-08-25 Thread Derek B. Smith
All, I am trying to run logic that will copy/delete 3 versions of log.\d+ files to their respective directories. Because there are so many directories, I have built a hash table instead of using a bunch of "if else conditions" with reg exps. My problem is it is not returning the words_num trans

CGI redirect question, slightly OT

2006-08-25 Thread Michael Weber
Greetings, perlers! I am trying to create a web page on my intranet that grabs some user input, and puts the results in a file for later parsing. Everything works except the last line... sometimes. What the user is supposed to see is a web page that says "Thank you". Most users do. Some will n

Re: -F vs split

2006-08-25 Thread Robert Citek
On Aug 25, 2006, at 2:43 PM, Robert Citek wrote: Why do these two commands not produce the same output? $ perl -le 'print join("--", split(/: /, "a: b"))' a--b $ echo 'a: b' | perl -F'/: /' -lane 'print join("--", @F)' a: b From reading 'perldoc perlrun' the -F option should behave just lik

-F vs split

2006-08-25 Thread Robert Citek
Why do these two commands not produce the same output? $ perl -le 'print join("--", split(/: /, "a: b"))' a--b $ echo 'a: b' | perl -F'/: /' -lane 'print join("--", @F)' a: b From reading 'perldoc perlrun' the -F option should behave just like the pattern to split. What am I missing? Rega

perl/Tk and piping questions

2006-08-25 Thread John Cortland Morgan \(ZG/ETK\)
Hi, Anyone know of a good online reference/tutorial for perl/Tk, especially in area of layouts (pack/grid/?)? Can't seem to get things lined up as I'd like. Also, anyone know how to (easily) get a script to act more like a pipe, ie: like Unix cat, head, etc... What I would like to be able to

Re: [OT] perldoc typo

2006-08-25 Thread Adriano Ferreira
Many, many fixes have been done to docs in bleadperl (and some already found their way to the more recent stable version - 5.8.8). A bug report (even in docs) is more valuable when an accurate description of how to reproduce the issue is given (and that includes knowing the perl version you are us