Re: help in variable pattern matching

2007-12-19 Thread Gunnar Hjalmarsson
Jin Zhisong wrote: The following code didn't work. My $type = $ARGV[1] my $match = ( $type eq 'bcv' ) ? 'BCV' : 'RAID-5' ; my $pattern = ( $type eq 'bcv' ) ? "${match}\s+N\/Asst" : "${match}\s+N\/Grp" ; while ( )

Re: regexp for two quotes

2007-12-19 Thread Rob Dixon
Dr.Ruud wrote: "Jay Savage" schreef: Corin Lawson wrote: Can you not simply count the number of quotes mod 2? No, you can't just count the number of quotes. An even number of quotes doesn't mean they're all double quotes. Consider something like q|a'b'c''d'e'f|. I haven't read anywhere yet

Re: testing for a file type

2007-12-19 Thread Jenda Krynicky
From: "Chas. Owens" <[EMAIL PROTECTED]> > On Dec 18, 2007 4:49 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > snip > > if (grep { not /\.mdb\z/ } @ARGV) { > >print "All parameters must be MDB files\n"; > >exit; > > } > snip > > Or in Perl 5.10, coming to stores near you soon*, you can use the

Re: Crypt SQLite

2007-12-19 Thread Octavian Rasnita
From: <[EMAIL PROTECTED]> On Dec 9, 7:03 am, [EMAIL PROTECTED] (Octavian Rasnita) wrote: >> I've seen a program made in C# that uses an SQLite database which is >> crypted. > I doubt that. SQLite does not (AFAIK) have an encrypted database > engine. The only way that such a program could do

Re: Crypt SQLite

2007-12-19 Thread fsantiago
On Dec 9, 7:03 am, [EMAIL PROTECTED] (Octavian Rasnita) wrote: > From: "David Filmer" <[EMAIL PROTECTED]> > > > > > > > On Dec 6, 10:47 am, [EMAIL PROTECTED] (Octavian Rasnita) wrote: > >> I've seen a program made in C# that uses an SQLite database which is > >> crypted. > > > I doubt that. SQLite

Re: regexp for two quotes

2007-12-19 Thread Dr.Ruud
"Jay Savage" schreef: > Corin Lawson wrote: >> Can you not simply count the number of quotes mod 2? > > No, you can't just count the number of quotes. An even number of > quotes doesn't mean they're all double quotes. Consider something like > q|a'b'c''d'e'f|. I haven't read anywhere yet that the

Re: regexp for two quotes

2007-12-19 Thread Dr.Ruud
Rob Dixon schreef: > Dr.Ruud wrote: >> Rob Dixon schreef: >>> scooter: Can someone help me with the regexp that will match exactly two quotes(') or no quotes in the string. If a single quote exists, then will break out. eg: aabbcc - Should Match aa''bb''c''c - S

Re: help in variable pattern matching

2007-12-19 Thread Tom Phoenix
On 12/19/07, Jin Zhisong <[EMAIL PROTECTED]> wrote: > The following code didn't work. > my $pattern = ( $type eq 'bcv' ) ? "${match}\s+N\/Asst" : > "${match}\s+N\/Grp" ; Did it not work because it did not use qr//? That's at least part of the problem. It may help you during development if yo

RE: help in variable pattern matching

2007-12-19 Thread Jin Zhisong
Thanks every one that helps. I find my problem. Now how can I have a $pattern that contain some special characters to pass it into regex? I want to extract the line that contains either RAID-5N/Grp'd Or BCV N/Asst'd The following code didn't wor

Re: Hi... Help regarding chdir

2007-12-19 Thread Paul Lalli
On Dec 19, 2:29 am, [EMAIL PROTECTED] (Ravindra Ugaji) wrote: > I am trying the following code to change the directory > > chdir ( '/opt/application') || die ("Can't change directory: $!\n"); > tried this also > chdir "/opt/application" || die "Can't change directory: $!\n"; > > But i am unable to

Re: Hi... Help regarding chdir

2007-12-19 Thread Tom Phoenix
On 12/19/07, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Dec 19, 2007 2:29 AM, Ravindra Ugaji <[EMAIL PROTECTED]> wrote: > > chdir ( '/opt/application') || die ("Can't change directory: $!\n"); > > tried this also > > chdir "/opt/application" || die "Can't change directory: $!\n"; > In addition

Re: testing for a file type

2007-12-19 Thread Chas. Owens
On Dec 18, 2007 4:49 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: snip > if (grep { not /\.mdb\z/ } @ARGV) { >print "All parameters must be MDB files\n"; >exit; > } snip Or in Perl 5.10, coming to stores near you soon*, you can use the smart match operator: @ARGV ~~ /\.mdb\z/ or die "All

Re: Hi... Help regarding chdir

2007-12-19 Thread Chas. Owens
On Dec 19, 2007 2:29 AM, Ravindra Ugaji <[EMAIL PROTECTED]> wrote: > Hi Monks, > I am trying the following code to change the directory > > chdir ( '/opt/application') || die ("Can't change directory: $!\n"); > tried this also > chdir "/opt/application" || die "Can't change directory: $!\n"; snip

Re: Date::manip query

2007-12-19 Thread Gunnar Hjalmarsson
pauld wrote: Gunnar Hjalmarsson wrote: pauld wrote: im using Date::Manip to convert dates and times eg 2007:08:02 12:23 to allow me to sort them, Why are you doing that? C:\home>type test.pl @dates = ( '2007:08:02 12:23', '2007:10:21 04:40', '2007:06:05 16:08', '2007:09:11 22

Re: Date::manip query

2007-12-19 Thread Tom Phoenix
On 12/19/07, pauld <[EMAIL PROTECTED]> wrote: > im sorting it on a key of the hash > my @daylistsorted = sort { $$a{'START_DS'} <=> $$b{'START_DS'} } > @daylist; > generates a > Argument "2007:09:30 13:41" isn't numeric in numeric comparison (<=>) > at ./518573 Have you tried using a string comp

Re: help in variable pattern matching

2007-12-19 Thread Dr.Ruud
"Jin Zhisong" schreef: > I define a $match variable and use it in the patterr below. > However it didn't match anything for the sample data. perldoc -f qr -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] h

Re: help in variable pattern matching

2007-12-19 Thread Tom Phoenix
On 12/19/07, Jin Zhisong <[EMAIL PROTECTED]> wrote: >next unless /\s+BCV\s+N/Grp/; it works Oh, I hope it doesn't work. The number of forward slashes is all wrong. > next unless /\s+BCV\s+N\/Grp/; it didn't work But this one might actually parse. If it doesn't match when it's supposed

Re: help in variable pattern matching

2007-12-19 Thread Roberto Etcheverry
Jin Zhisong wrote: > HI, I'm looking for some advice of how to do this? > > > > I need to match some "variable" pattenrs so > > > > I define a $match variable and use it in the patterr below. > > However it didn't match anything for the sample data. > > > > If I change the match critia to h

Re: Date::manip query

2007-12-19 Thread pauld
im sorting it on a key of the hash my @daylistsorted = sort { $$a{'START_DS'} <=> $$b{'START_DS'} } @daylist; generates a Argument "2007:09:30 13:41" isn't numeric in numeric comparison (<=>) at ./518573 error my @daylistsorted = sort { $$a{'START'} <=> $$b{'START'} } @daylist; works -- To u

Re: Hi... Help regarding chdir

2007-12-19 Thread Tom Phoenix
On 12/18/07, Ravindra Ugaji <[EMAIL PROTECTED]> wrote: > Hi Monks, The Perl Monks are two doors down, on the left. But maybe we can help you here. > I am trying the following code to change the directory > > chdir ( '/opt/application') || die ("Can't change directory: $!\n"); > But i am unable

Re: Hi... Help regarding chdir

2007-12-19 Thread Roberto Etcheverry
It should work unless the user you are using to run the script doesn't have the rights to chdir to that directory. Ravindra Ugaji wrote: > Hi Monks, > I am trying the following code to change the directory > > chdir ( '/opt/application') || die ("Can't change directory: $!\n"); > tried this also >

Hi... Help regarding chdir

2007-12-19 Thread Ravindra Ugaji
Hi Monks, I am trying the following code to change the directory chdir ( '/opt/application') || die ("Can't change directory: $!\n"); tried this also chdir "/opt/application" || die "Can't change directory: $!\n"; But i am unable to change the directory to " /opt/application " from present worki

help in variable pattern matching

2007-12-19 Thread Jin Zhisong
HI, I'm looking for some advice of how to do this? I need to match some "variable" pattenrs so I define a $match variable and use it in the patterr below. However it didn't match anything for the sample data. If I change the match critia to hardcode next unless /\s+BCV\s+N/Grp/;

Re: regexp for two quotes

2007-12-19 Thread Jay Savage
Please don't top post... On Dec 18, 2007 6:41 PM, Corin Lawson <[EMAIL PROTECTED]> wrote: > Hi ab, > > Can you not simply count the number of quotes mod 2? > No, you can't just count the number of quotes. An even number of quotes doesn't mean they're all double quotes. Consider something like q|a

Re: out to keyboard

2007-12-19 Thread Jay Savage
On Dec 18, 2007 1:28 PM, Ryan <[EMAIL PROTECTED]> wrote: > Here's something I've never done before and I need some help. > > I want to control a terminal program that is proprietary and Curses > and such won't work. So instead I'd like to have my perl program > output chars to the keyboard or mous