Re: regex optimization

2010-01-09 Thread Erez Schatz
2010/1/9 C.DeRykus : > On Jan 5, 12:13 am, moonb...@gmail.com (Erez Schatz) wrote: >> 2010/1/5 Jeff Peng : >> ... >> >> This is something that Perl  (post version 5.6) does inherently, which >> is compiling a regex only once as long as the pattern isn't modified. > >> Prior to 5.6 you'd need to use

Re: How to make skip an input parameter.

2010-01-09 Thread Jim Gibson
At 2:09 AM +0530 1/10/10, Parag Kalra wrote: Hmmm. Although its sufficing my needs but I wanted a way to pass an undef. May be I will have make it undef manually if an input parameter is an empty string or something like that. The "normal" way to set a variable as undef using command-line arg

Re: PERL pack help

2010-01-09 Thread C.DeRykus
On Jan 7, 7:14 pm, shanmugasundara...@tessolve.com ("Shan") wrote: > Hi All, > > Help me to pack the string to pointer. > > Ex. > > $d="sdfgg"; > $pack=pack("P",$d); > > What above code represents? > Have you read the pack tutorial yet: perldoc perlpacktut -- Charles DeRykus -- To unsubscribe

Re: regex optimization

2010-01-09 Thread C.DeRykus
On Jan 5, 12:13 am, moonb...@gmail.com (Erez Schatz) wrote: > 2010/1/5 Jeff Peng : > ... > > This is something that Perl  (post version 5.6) does inherently, which > is compiling a regex only once as long as the pattern isn't modified. > Prior to 5.6 you'd need to use the /o modifier ( > m/href="h

Re: How to make skip an input parameter.

2010-01-09 Thread Owen
> Hello All, > > This is surely a beginner's question and may even sound silly. :) > > How do you make a Perl script skip an input parameter if it is not > present. > Let me explain it through an example. > > EG: > #!/usr/bin/perl > use strict; > use warnings; > no warnings 'uninitialized'; > prin

Re: How to make skip an input parameter.

2010-01-09 Thread Parag Kalra
Hmmm. Although its sufficing my needs but I wanted a way to pass an undef. May be I will have make it undef manually if an input parameter is an empty string or something like that. Anyway thanks. :) Cheers, Parag On Sun, Jan 10, 2010 at 1:49 AM, Shlomi Fish wrote: > Hi Parag! > > On Satur

Re: How to make skip an input parameter.

2010-01-09 Thread Shlomi Fish
Hi Parag! On Saturday 09 Jan 2010 22:04:40 Parag Kalra wrote: > Or let me put it this way - How can we pass an input parameter as an undef > You can't put an undef in an @ARGV argument from the command line because all command-line arguments are strings. However, you can have it as an empty st

Re: How to make skip an input parameter.

2010-01-09 Thread Parag Kalra
Or let me put it this way - How can we pass an input parameter as an undef Cheers, Parag On Sun, Jan 10, 2010 at 1:23 AM, Parag Kalra wrote: > Hello All, > > This is surely a beginner's question and may even sound silly. :) > > How do you make a Perl script skip an input parameter if it is n

How to make skip an input parameter.

2010-01-09 Thread Parag Kalra
Hello All, This is surely a beginner's question and may even sound silly. :) How do you make a Perl script skip an input parameter if it is not present. Let me explain it through an example. EG: #!/usr/bin/perl use strict; use warnings; no warnings 'uninitialized'; print "1 - $ARGV[0]\n"; print