Re: Reg:Regular expression

2009-04-14 Thread Emen Zhao
>> I need to replace \/user\/cce\/g_tool with the variable $temp where >> $temp=\/user\ /gowri\/rem2 $string =~ s{\\/user\\/cce\\/g_tool}{$temp} HTH, Thanks, --Emen

AW: if statement being ignored

2009-04-14 Thread Thomas Bätzler
Brian wrote: > could someone please help me with this little problem? > I am trying to include an if statement part way through printing. > When the program reaches the line if ($Lang = fr ) { print " > that line gets ignored and the cgi keeps going to the end. > > thanks > Brian > > > > #!

Reg:Regular expression

2009-04-14 Thread Gowri Chandra Sekhar Barla, TLS, Chennai
Hi all, Please help in writing regular expression for the following scenario I need to replace \/user\/cce\/g_tool with the variable $temp where $temp=\/user\ /gowri\/rem2 Thanks and regards, Gowri DISCLAIMER: ---

if statement being ignored

2009-04-14 Thread Brian
Hi, could someone please help me with this little problem? I am trying to include an if statement part way through printing. When the program reaches the line if ($Lang = fr ) { print " that line gets ignored and the cgi keeps going to the end. thanks Brian #! c:\perl\bin\perl.exe -T use war

SSL decrypt

2009-04-14 Thread Luis Daniel Lucio Quiroz
Hi Camels, I wonder to know if there is a perl module that let me to decrypt ssl traffic (if I have already private key), like ssldump or tshark does. Best regards, LD -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://lea

getSaveFile and warn?

2009-04-14 Thread Thomas H. George
The following bit of code: use Tk; use strict; . . . my $topl = $mw -> Toplevel(-title => 'File Selection'); my $fr1 = $topl -> Frame -> pack; $outfile = $fr1 -> getSaveFile(-filetypes => $types); warn "Over Write?"; open OUTFILE, ">$outfile"; work

Re: Match and split on array help with output

2009-04-14 Thread John W. Krahn
John W. Krahn wrote: p...@highdeck.com wrote: Hi john, Hello, thanks for the prompt reply. Ok, here's what I'd like it to do. #!/usr/bin/perl # # Build Initial list and put into array. @serverlist = `/usr/bin/wget -q -O - http://www.amazon.co.uk`; for ($index = 0; $index

Re: reading files c vs perl

2009-04-14 Thread Chas. Owens
On Tue, Apr 14, 2009 at 11:49, Rick wrote: > is it true that perl will be just as fast as c for reading files ? > > for example > > will  below be as fast as if it were written in c? > I said this because on random posts, I see that perl is optimized to work w/ > text files and it should be as fas

Re: Match and split on array help with output

2009-04-14 Thread John W. Krahn
p...@highdeck.com wrote: Hi john, Hello, thanks for the prompt reply. Ok, here's what I'd like it to do. #!/usr/bin/perl # # Build Initial list and put into array. @serverlist = `/usr/bin/wget -q -O - http://www.amazon.co.uk`; for ($index = 0; $index <= $#serverlist; $inde

reading files c vs perl

2009-04-14 Thread Rick
is it true that perl will be just as fast as c for reading files ? for example will below be as fast as if it were written in c? I said this because on random posts, I see that perl is optimized to work w/ text files and it should be as fast as perl open FILE, $file or die "bad filename: $!"

Re: output record separator in one liner

2009-04-14 Thread Rick
Chas. Owens wrote: On Mon, Apr 13, 2009 at 15:39, Rick wrote: perl -lane' print "$F[0] ", "$F[4]" , " $F[5]";' Is there anyway to incoporate $\ <- output record separtor to do this instead of printing out w/ manual spaces beteween the variables? snip No, you want to use $, or $". Si

Re: Turn off $ anchor greedy behavior

2009-04-14 Thread Chas. Owens
On Tue, Apr 14, 2009 at 10:02, Michael Alipio wrote: > > >> >> Or use split and return the last field: >> >> $ perl -le' >> my $string = "boy, pig, 123, 123:412adbd, d0g, >> lajdlf134><<_ lkadsf !234,\n"; >> my $value = ( split /,\s+/, $string )[ -1 ]; > > Another mind bogling example... :-) > I t

Re: Turn off $ anchor greedy behavior

2009-04-14 Thread Michael Alipio
Aha, found it.. The split returned a list and you've just sliced it. giving [-1] means the list will start running through the elements backwards. --- On Tue, 4/14/09, Michael Alipio wrote: > From: Michael Alipio > Subject: Re: Turn off $ anchor greedy behavior > To: "Perl Beginners" , "Joh

Re: Turn off $ anchor greedy behavior

2009-04-14 Thread Michael Alipio
> > Or use split and return the last field: > > $ perl -le' > my $string = "boy, pig, 123, 123:412adbd, d0g, > lajdlf134><<_ lkadsf !234,\n"; > my $value = ( split /,\s+/, $string )[ -1 ]; Another mind bogling example... :-) I thought I would do: my @value = ( split /,\s+/, $string ); print $

could not connect to Mssqlserver

2009-04-14 Thread perl pra
Hi Gurus, I need to connect to MSSQL SERVER (express edition on remote system) through a perl script. But I get the following error with the code below can any body help me in that. ERROR Use of uninitialized value $Win32::ODBC::ErrConn in concatenation (.) or string at C:/Perl/lib/

Re: Match and split on array help with output

2009-04-14 Thread John W. Krahn
p...@highdeck.com wrote: Hi all, Hello, I have some basic code that I want to pull out the web addresses from web pages. Would like to keep it as basic as possible for easy reading. The line to replace http with newline seems to work ok. however the "match" line doesnt seem to pull out the r

Re: Turn off $ anchor greedy behavior

2009-04-14 Thread John W. Krahn
Michael Alipio wrote: Hi, Hello, Subject: Turn off $ anchor greedy behavior Anchors are not greedy. Anchors don't even match characters. I have a $string that is separated by , and space; boy, pig, 123, 123:412adbd, d0g, lajdlf134><<_ lkadsf !234, Now I want to capture the string(s)

Match and split on array help with output

2009-04-14 Thread perl
Hi all, I have some basic code that I want to pull out the web addresses from web pages. Would like to keep it as basic as possible for easy reading. The line to replace http with newline seems to work ok. however the "match" line doesnt seem to pull out the required lines and I'm not to sure abo

AW: AW: Turn off $ anchor greedy behavior

2009-04-14 Thread Thomas Bätzler
Michael Alipio asked: > > my $string = 'boy, pig, 123, 123:412adbd, d0g, > > lajdlf134><<_ lkadsf !234,'; > > > > if( $string =~ m/,\s*([^,]*),[^,]*$/ ){ > > print "$1\n"; > > } > > How could you guys write this so simple? My regexp was twice this long. Lots of practice? ;-) > the regexp af

Re: AW: Turn off $ anchor greedy behavior

2009-04-14 Thread Michael Alipio
> my $string = 'boy, pig, 123, 123:412adbd, d0g, > lajdlf134><<_ lkadsf !234,'; > > if( $string =~ m/,\s*([^,]*),[^,]*$/ ){ > print "$1\n"; > } How could you guys write this so simple? My regexp was twice this long. the regexp after \s* tells perl to match anything (0 or more) that is not a

Re: Text::Unidecode behaves differently on two machines

2009-04-14 Thread Dr.Ruud
Kelly Jones wrote: I "cpan Text::Unidecode" on 2 machines and then ran this code: use utf8; use Text::Unidecode; print unidecode("\x{5317}\x{4EB0}")."\n"; print unidecode("\xd0\x90\xd0\xbb")."\n"; print unidecode("\xe3\x82\xa2")."\n"; On both machines, the first line correctly prints "Bei Jing

AW: Turn off $ anchor greedy behavior

2009-04-14 Thread Thomas Bätzler
Michael Alipio asked: > I have a $string that is separated by , and space; > > boy, pig, 123, 123:412adbd, d0g, lajdlf134><<_ lkadsf !234, > > > Now I want to capture the string(s) between last two commas. It consists > of anything upto 32 characters. that is, right after d0g,\s+ up to the > la

Turn off $ anchor greedy behavior

2009-04-14 Thread Michael Alipio
Hi, I have a $string that is separated by , and space; boy, pig, 123, 123:412adbd, d0g, lajdlf134><<_ lkadsf !234, Now I want to capture the string(s) between last two commas. It consists of anything upto 32 characters. that is, right after d0g,\s+ up to the last character before the last c