regex require a period

2003-10-09 Thread perl
here's the rules: starts with alphanumeric 4 chars long require one period /^[a-zA-Z][\w\-\.]{3,}$/ I think my regex is not doing the required period. thanks, -rkl - eMail solutions by http://www.swanmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTE

Re: how do I pass null arguement?

2003-10-09 Thread perl
thanks. it works! -rkl > Try 'undef'. > > eg. my procByLastName{ mySubA(undef, "doe"); } > > On Fri, 2003-10-10 at 16:39, [EMAIL PROTECTED] wrote: >> How do I pass a null variable as an argument? Sometime I may want a >> wrapper sub as below: >> >> Example, >> ... >> sub procName >> { my $fname =

Re: how do I pass null arguement?

2003-10-09 Thread simran
Try 'undef'. eg. my procByLastName{ mySubA(undef, "doe"); } On Fri, 2003-10-10 at 16:39, [EMAIL PROTECTED] wrote: > How do I pass a null variable as an argument? Sometime I may want a > wrapper sub as below: > > Example, > ... > sub procName > { my $fname = $_[0]; > my $lname = $_[1]]; > } >

how do I pass null arguement?

2003-10-09 Thread perl
How do I pass a null variable as an argument? Sometime I may want a wrapper sub as below: Example, ... sub procName { my $fname = $_[0]; my $lname = $_[1]]; } my procByLastName{ mySubA(null, "doe"); } ... This is the error message: Bareword "null" not allowed while "strict subs" in use thanks

finding a spot in a file

2003-10-09 Thread chad kellerman
Hello, I am opening up a file (actually a my.conf). I only want 2 lines in the file. port and datadir The problem I am running into is that there is a port = 3324 in both the [client] section and the [mysqld] section. I want to open the file and go straight to the [mysqld] section and

Re: grep argument list too long...how to get around it?

2003-10-09 Thread Randal L. Schwartz
> "Rob" == Rob Dixon <[EMAIL PROTECTED]> writes: Rob> Randal L. Schwartz wrote: >> >> > "Dan" == Dan Muey <[EMAIL PROTECTED]> writes: >> Dan> for(`ls /files/`) { Dan> if(`cat $_ |grep $string`) { push(@matchedfiles,$_); } Dan> } >> >> Hmm. Where to begin? >> >> - Dangerous use of ls.

Re: Exponential numbers

2003-10-09 Thread david
John W. Krahn wrote: > David wrote: >> >> brain dead approach: >> >> #!/usr/bin/perl -w >> use strict; >> >> for(qw~ 0.203E-20.203E+9 0.203e-9 >> 0.20233E-12 0.123e+3 3435E+15 ~){ >> >> /(\d+)E(.)(\d+)/i; >> my $l = $2 eq '+' ? 0 : length($1) + $3; > > You shouldn't

File::Path question

2003-10-09 Thread Prasad Karpur
I initially set $value1, $value2 and $value3 to null values $value1 = ""; $value2 = ""; $value3 = ""; I get the values of $value1, $value2 and $value from input $valuexyz = "$value1$value2$value3"; mkpath(["$TMPDIR/$valuexyz"], 1, 0777); $valuexyz does not get evaluated. But if i set $value = "a

Re: undefined subroutine

2003-10-09 Thread Dodo
Dynamic page...just some server side include and a menu. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regular Expression question

2003-10-09 Thread James Edward Gray II
On Thursday, October 9, 2003, at 03:43 PM, Dan Muey wrote: I wrote this s/([A-Za-z]*)/\n$1/g; Try this: s/\W//g; That looks like a capital W to me, though your explanation used the correct w. \W matches any NON-word character and thus wouldn't work here. James -- To unsubscribe, e-mail: [E

RE: Regular Expression question

2003-10-09 Thread Hanson, Rob
Like Jeff said, you can just use \w if you are allowing numbers as well. > s/([A-Za-z]_*)/\n$1/g; This will take a little bit of explaining, so bear with me. [ ... ] - Brackets represent a "character class". A char class will match a SINGLE char that is inside of it. So if I wanted to match "a

RE: Regular Expression question

2003-10-09 Thread Dan Muey
> I wrote this > > > s/([A-Za-z]*)/\n$1/g; Try this: s/\W//g; \w matches letters number and underscores \W matches anythgiin not letters numbers or underscores. Take a look at tr also it may be able to help you out. HTH Dmuey > > > It only gets the letters, but I am not sure how to wr

Sound in Perl?

2003-10-09 Thread Jamie Martin
Hi, I am trying to mess around with sound a little bit. I want to write an ear-training exercise in which you practice distinguishing intervals smaller than a semitone. Can I generate tones in Perl? Can I specify them in cents (hundreths of a semitone . . . a semitone is the distance between two a

Re: Regular Expression question

2003-10-09 Thread Jeff Westman
Trina Espinoza <[EMAIL PROTECTED]> wrote: > How do you create a regular expression that allows you to have files like > ths: > Stuff_Dev > Greg_Files > myThings_ > _default > > I wrote this > > s/([A-Za-z]*)/\n$1/g; Your expression above only asked to get the letters :) You specified a chara

Regular Expression question

2003-10-09 Thread Trina Espinoza
How do you create a regular expression that allows you to have files like ths: Stuff_Dev Greg_Files myThings_ _default I wrote this s/([A-Za-z]*)/\n$1/g; It only gets the letters, but I am not sure how to write in the underscore. Any attemps I have made on adding the _ get the wrong results e.

RE: grep argument list too long...how to get around it?

2003-10-09 Thread Bakken, Luke
> > Dan> for(`ls /files/`) { > > Dan> if(`cat $_ |grep $string`) { push(@matchedfiles,$_); } > > Dan> } > > > > Hmm. Where to begin? > > > > - Dangerous use of ls. > > - Useless use of cat. > > - Dangerous use of backticks. > > - Shelling out when every one of those steps is done as well > > or

Re: getting end of an array

2003-10-09 Thread Rob Dixon
Dan Anderson wrote: > > > And I still think you should be writing a bash script! > > I forgot to mention that bash scripts are not necessarily portable. > There are lots of *BSDers out there who have Perl on their system but > don't install bash. The OpenBSD community comes to mind. > > So if port

Re: getting end of an array

2003-10-09 Thread Dan Anderson
> And I still think you should be writing a bash script! I forgot to mention that bash scripts are not necessarily portable. There are lots of *BSDers out there who have Perl on their system but don't install bash. The OpenBSD community comes to mind. So if portability were an issue Perl might

Re: getting end of an array

2003-10-09 Thread Dan Anderson
> And I still think you should be writing a bash script! TMTOWTDI :-D -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: grep argument list too long...how to get around it?

2003-10-09 Thread Rob Dixon
Randal L. Schwartz wrote: > > > "Dan" == Dan Muey <[EMAIL PROTECTED]> writes: > > Dan> for(`ls /files/`) { > Dan> if(`cat $_ |grep $string`) { push(@matchedfiles,$_); } > Dan> } > > Hmm. Where to begin? > > - Dangerous use of ls. > - Useless use of cat. > - Dangerous use of backticks. > - Shel

Re: grep argument list too long...how to get around it?

2003-10-09 Thread Randal L. Schwartz
> "Dan" == Dan Muey <[EMAIL PROTECTED]> writes: Dan> for(`ls /files/`) { Dan>if(`cat $_ |grep $string`) { push(@matchedfiles,$_); } Dan> } Hmm. Where to begin? - Dangerous use of ls. - Useless use of cat. - Dangerous use of backticks. - Shelling out when every one of those steps is done

Re: getting end of an array

2003-10-09 Thread Rob Dixon
Hi Rob. I'm trying to help. Really I am. But first of all it looks like you should be writing a bash script file (Perl isn't a scripting language). Please explain: Rmck wrote: > > I have a script that I what the last part of the element of > an array? So I can restart the script with the same el

getting end of an array

2003-10-09 Thread rmck
Hi, I have a script that I what the last part of the element of an array? So I can restart the script with the same element. Help: #!/bin/perl use strict; # Need IP of current procees so I can re-start it. # How it is returned: # root 6762 1355 0 Oct 05 pts/20:00 /bin/perl -w ./sc

Perl Debugger

2003-10-09 Thread Jeff Westman
Hi, I'm using perl version 5.6.1 for Unix (HPUX-11). I would like to be able to retain my 'watches' and breakpoints in between debug sessions. Is there a way to do this with the standard debug library that comes with perl? (I know I can save these with the ptkdb package, but I cannot get that t

Re: Exponential numbers

2003-10-09 Thread david
Pedro Antonio Reche wrote: > Dear all, > I have a table that has exponential numbers of the type 0.203E-2 and I > will like to reformat getting rid off the exponential so that the > previous number would look when printed as 0.00203. > Is there any easy way to do this? > Any help welcome. brain d

RE: grep argument list too long...how to get around it?

2003-10-09 Thread Kevin Old
On Thu, 2003-10-09 at 12:13, Dan Muey wrote: > > Hello everyone, > > Howdy > > > > > We use the Barracuda Spam appliance (barracudanetworks.com) > > to filter our spam and their web based interface is written > > in Perl. They have a form that allows the user to search > > messages for key w

RE: grep argument list too long...how to get around it?

2003-10-09 Thread Dan Muey
> Hello everyone, Howdy > > We use the Barracuda Spam appliance (barracudanetworks.com) > to filter our spam and their web based interface is written > in Perl. They have a form that allows the user to search > messages for key words. Evidentally it stores the each > message in a file in a

RE: grep argument list too long...how to get around it?

2003-10-09 Thread Bakken, Luke
> We use the Barracuda Spam appliance (barracudanetworks.com) to filter > our spam and their web based interface is written in Perl. > They have a > form that allows the user to search messages for key words. > Evidentally > it stores the each message in a file in a directory and when trying to

RE: grep argument list too long...how to get around it?

2003-10-09 Thread Wiggins d'Anconia
On 09 Oct 2003 11:54:00 -0400, Kevin Old <[EMAIL PROTECTED]> wrote: > Hello everyone, > > We use the Barracuda Spam appliance (barracudanetworks.com) to filter > our spam and their web based interface is written in Perl. They have a > form that a

Re: grep argument list too long...how to get around it?

2003-10-09 Thread Steve Grazzini
On Thu, Oct 09, 2003 at 11:54:00AM -0400, Kevin Old wrote: > We use the Barracuda Spam appliance (barracudanetworks.com) [ snip ] > egrep: argument list too long > > It looks like their using grep via a system command or the grep function > in Perl. It's definitely the external grep... > I kno

grep argument list too long...how to get around it?

2003-10-09 Thread Kevin Old
Hello everyone, We use the Barracuda Spam appliance (barracudanetworks.com) to filter our spam and their web based interface is written in Perl. They have a form that allows the user to search messages for key words. Evidentally it stores the each message in a file in a directory and when trying

Monitoring application runtime

2003-10-09 Thread Steve . E . Pittman
I am using Win32::Spawn($application, $cmdLine, $processID) to launch a non-windows app..is there a method to determine when the application has ended? I obviously have the PID but I have not found a WIN32 function to monitor the process. Regards, Steve -- To unsubscribe, e-mail: [EMAIL P

RE: undefined subroutine

2003-10-09 Thread Dan Muey
> I'm trying to convert so I can use a server that doesn't > support PHP, but I'm giving up. With my limited knowledge I That's a good server. I've had more trouble with php on our webservers I'd almost get rid of it,. But one guy use the PHPBB forum so I can't unless he stops using it! > thi

Re: required help

2003-10-09 Thread James Edward Gray II
Last warning: You are still sending messages to my private address, which is inappropriate. I read the beginner's list and will see any messages you send there, so do many other people who my be able to help you better/faster than me. These people want to help you, that's why the list exists

RE: stop/start

2003-10-09 Thread Tristram Nefzger
Regarding writing a unix daemon in perl, you might have a look at http://www.webreference.com/perl/tutorial/9/index.html -tristram -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Holding File handles in a {} anonymous hash

2003-10-09 Thread Rob Dixon
Rob Dixon wrote: > > Dan Anderson wrote: > > > > I have a module that works with a couple of different file handles. Is > > it possible to hide them within an anonymous hash? {} (i.e. the objects > > data). Right now I have: > > > > if (condition_is_met()) { > > open("FILE"," > } > > > > This