Re: auto completion by crtl + space is not working with eclipse -epic module , Good IDE for beginner

2014-07-15 Thread Benjamin Fernandis
Hi, I read document and tried to test by typing trigger characters ":" and ">" also by CTRL - SPACE. but not working. Is there anything else require to install on top of elipse + perl plugin. As my current system has centos 7 + fresh perl install + eclipse + perl plugi

Re: auto completion by crtl + space is not working with eclipse -epic module , Good IDE for beginner

2014-07-15 Thread Shaji Kalidasan
Dear Benjamin, Excerpt from the documentation The autocompletion suggestions will pop up automatically after you have typed a trigger character. Triggers are ":" and ">". Alternatively, it can be triggered by pressing CTRL-SPACE. Currently the Indirect Object Invocation i

auto completion by crtl + space is not working with eclipse -epic module , Good IDE for beginner

2014-07-15 Thread Benjamin Fernandis
Hi, I installed Ecplise standard version but auto completion of syntax is not working while pressing CTL + SPACE key. Is there any configuration required for this ? Any other good IDE for beginner ? Thx

Re: What name(space) is suitable for My::Module?

2012-03-10 Thread Narazaka Nanigashi
On Fri, 09 Mar 2012 21:19:29 -0800 David Christensen wrote: > > or... some other module for my purpose already exists? > > Have you tried browsing or searching CPAN? > > http://www.cpan.org/ > > http://search.cpan.org/ > Yes, but since I may have missed modules that I want, I asked

Re: What name(space) is suitable for My::Module?

2012-03-09 Thread David Christensen
On 03/09/2012 06:53 AM, Narazaka Nanigashi wrote: I'm going to release a Perl module for the first time but cannot determine the name of the module. ... My module is for input and output of "config" / "BBS log" files whose records are separated by some delimiters. Please see: http://ww

Re: What name(space) is suitable for My::Module?

2012-03-09 Thread Narazaka Nanigashi
On Fri, 09 Mar 2012 11:14:25 -0500 Shawn H Corey wrote: > On 12-03-09 10:56 AM, Narazaka Nanigashi wrote: > > Oh, I missed checking it. > > > > My purpose is to process multiple delimiters, so Text::CSV is not enough... > > but Text::* can be one of the choice of namespace? > > If it involves o

Re: What name(space) is suitable for My::Module?

2012-03-09 Thread Shawn H Corey
On 12-03-09 10:56 AM, Narazaka Nanigashi wrote: Oh, I missed checking it. My purpose is to process multiple delimiters, so Text::CSV is not enough... but Text::* can be one of the choice of namespace? If it involves only text. If it works on other things, like say packed strings, then someth

Re: What name(space) is suitable for My::Module?

2012-03-09 Thread Narazaka Nanigashi
Oh, I missed checking it. My purpose is to process multiple delimiters, so Text::CSV is not enough... but Text::* can be one of the choice of namespace? On Fri, 09 Mar 2012 10:18:29 -0500 Shawn H Corey wrote: > On 12-03-09 09:53 AM, Narazaka Nanigashi wrote: > > or... some other module for my

Re: What name(space) is suitable for My::Module?

2012-03-09 Thread Shawn H Corey
On 12-03-09 09:53 AM, Narazaka Nanigashi wrote: > or... some other module for my purpose already exists? have you checked out Text::CSV ? I sounds similar to what you're proposing. -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication a

What name(space) is suitable for My::Module?

2012-03-09 Thread Narazaka Nanigashi
Hello, I'm going to release a Perl module for the first time but cannot determine the name of the module. Please suggest some names or let me know a place suitable for asking this issue. I'm mainly hesitating to decide the namespace of the module. My module is for input and output of "config" /

Re: Extract substring from offset to space or full stop

2010-04-18 Thread Akhthar Parvez K
>$str =~ m{ \A ( .{0,15} .*? ) \s }msx; Yeah, this would do. I talked about the scenario where you didn't put "{0,15}", but just "{15}". In that case, it wouldn't work if the value given in the match string (15 as per above eg.) is greater than the character count of the particular string

Re: Extract substring from offset to space or full stop

2010-04-18 Thread John W. Krahn
it can help me achieve what I need to. Let's say I have: $s = "The black cat climbed the green tree"; How can I have this return the whole word climbed rather than the c (i.e. I need to get "The black cat climbed")? I need to get the remaining characters from the length till

Extract substring from offset to space or full stop

2010-04-18 Thread Mimi Cafe
offset I used, so I should be fine I think. Mimi -Original Message- From: John W. Krahn [mailto:jwkr...@shaw.ca] Sent: 18 April 2010 17:03 To: Perl Beginners Subject: Re: Extract substring from offset to space or full stop Mimi Cafe wrote: > I used MySQL substr function to extra 10

Re: Extract substring from offset to space or full stop

2010-04-18 Thread John W. Krahn
the green tree"; my $substring = substr( $s, 1, 15 ); print $substring; ' he black cat cl How can I have this return the whole word climbed rather than the c (i.e. I need to get "The black cat climbed")? I need to get the remaining characters from the length till the next white spac

Re: Extract substring from offset to space or full stop

2010-04-18 Thread Shawn H Corey
Akhthar Parvez K wrote: Hi Shawn, $str =~ m{ \A ( .{15} .*? ) \s }msx; I don't think this would work if the value given in the match string (15 as per above eg.) is greater than the character count of the particular string. Right? No, it will fail if $str is less than 15 characters. Try:

Re: Extract substring from offset to space or full stop

2010-04-18 Thread Akhthar Parvez K
Hi, > It works fine and I like it. My regex is not that good, but I can see what > is doing. I modified it a bit (to capture up till a full stop sign). Kewl. Good to hear that! Regards, Akhthar Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple operating system, but you have to be

RE: Extract substring from offset to space or full stop

2010-04-18 Thread Mimi Cafe
lto:akht...@sysadminguide.com] Sent: 18 April 2010 15:45 To: beginners@perl.org Subject: Re: Extract substring from offset to space or full stop Hi Shawn, > $str =~ m{ \A ( .{15} .*? ) \s }msx; I don't think this would work if the value given in the match string (15 as per above eg.) is gr

Re: Extract substring from offset to space or full stop

2010-04-18 Thread Akhthar Parvez K
Hi Shawn, > $str =~ m{ \A ( .{15} .*? ) \s }msx; I don't think this would work if the value given in the match string (15 as per above eg.) is greater than the character count of the particular string. Right? Regards, Akhthar Parvez K http://Tips.SysAdminGUIDE.COM UNIX is basically a simple ope

Re: Extract substring from offset to space or full stop

2010-04-18 Thread Shawn H Corey
the remaining characters from the length till the next white space or end of a phrase. #!/usr/bin/perl use strict; use warnings; my $str = "The black cat climbed the green tree"; print "string: $str\n"; $str =~ m{ \A ( .{15} .*? ) \s }msx; my $extracted = $1; print

Re: Extract substring from offset to space or full stop

2010-04-18 Thread Akhthar Parvez K
Hi Mimi, > How can I have this return the whole word climbed rather than the c (i.e. I > need to get "The black cat climbed")? I need to get the remaining characters > from the length till the next white space or end of a phrase. > Any other way to overcome this limitation

Extract substring from offset to space or full stop

2010-04-18 Thread Mimi Cafe
ack cat climbed the green tree"; $substring = substr( $s, 1, 15); # this will return "The black cat c". How can I have this return the whole word climbed rather than the c (i.e. I need to get "The black cat climbed")? I need to get the remaining characters from the l

Re: Strange Data space wipe out with hashes

2009-09-17 Thread Uri Guttman
> "JR" == Jerry Rocteur writes: JR> my %sib_master_hoa = ( JR> => [ ' ' ] , JR> _ERSALL => [ ' ', 'ERS CRCODOSS ', 'ERS ENVDOSS ', 'ERS ENVVAL ' ], JR> _ERSOTHERS => [ ' ', 'ERS CRCODOSS ', 'ERS ENVVAL ' ], JR> );

Re: Strange Data space wipe out with hashes

2009-09-17 Thread Shawn H Corey
Jerry Rocteur wrote: Hi, I came across this problem and thought I'd run it by the list so that perhaps someone can explain to me what is going on Given a script with the following hash definition #!/usr/bin/perl use warnings; use strict; my %sib_master_hoa = ( => [

Strange Data space wipe out with hashes

2009-09-17 Thread Jerry Rocteur
Hi, I came across this problem and thought I'd run it by the list so that perhaps someone can explain to me what is going on Given a script with the following hash definition #!/usr/bin/perl use warnings; use strict; my %sib_master_hoa = ( => [ ' ' ] , XXX

name space and invoking code with eval

2009-01-11 Thread okey
I can run a function this way (in the main package namespace): &main::aMainFunctionName(@param); How do I run it with a namespace var? $space = 'main'; eval \&${space}::aMainFunctionName(\@); Then, when and if that is possible, can I pass namespace to another package and

Re: dump all name space?

2008-09-27 Thread Sandy lone
On Sun, Sep 28, 2008 at 2:42 AM, Jenda Krynicky <[EMAIL PROTECTED]> wrote: > From: oldyork90 <[EMAIL PROTECTED]> >> Is there a way to dump the name space; show all var names and values? > > print Dumper(\%main::); Not so right. This can only dump the

Re: dump all name space?

2008-09-27 Thread Jenda Krynicky
From: oldyork90 <[EMAIL PROTECTED]> > Is there a way to dump the name space; show all var names and values? print Dumper(\%main::); HTH, Jenda = [EMAIL PROTECTED] === http://Jenda.Krynicky.cz = When it comes to wine, women and song, wizards are allowed to get

Re: dump all name space?

2008-09-27 Thread Sandy lone
On Sat, Sep 27, 2008 at 3:11 AM, oldyork90 <[EMAIL PROTECTED]> wrote: > Is there a way to dump the name space; show all var names and values? > > If the name space is an object, you could show its structure with Data::Dumper. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

dump all name space?

2008-09-27 Thread oldyork90
Is there a way to dump the name space; show all var names and values? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to remove white space from middle of string?

2008-06-13 Thread Jeff Peng
$string =~ s/\s+//g; On Fri, Jun 13, 2008 at 3:00 PM, sivasakthi <[EMAIL PROTECTED]> wrote: > Hi all, > > How to remove white space from middle of the string? for example, > > $string="hello world welcome"; > > I want to print helloworldwelcome > > >

How to remove white space from middle of string?

2008-06-13 Thread sivasakthi
Hi all, How to remove white space from middle of the string? for example, $string="hello world welcome"; I want to print helloworldwelcome Thanks, Siva

Re: Q: how to rename file with space in filename

2008-03-20 Thread John W. Krahn
ciwei wrote: # ls -l -rw-r--r-- 1 root other 0 Mar 19 16:24 this is the first file -rw-r--r-- 1 root other 0 Mar 19 16:24 this is the second file -rw-r--r-- 1 root other 0 Mar 19 16:24 this is the third file I want to rename the files, to say, first, second, etc # ls -1 | perl -ne 'pri

Q: how to rename file with space in filename

2008-03-20 Thread ciwei
# ls -l -rw-r--r-- 1 root other 0 Mar 19 16:24 this is the first file -rw-r--r-- 1 root other 0 Mar 19 16:24 this is the second file -rw-r--r-- 1 root other 0 Mar 19 16:24 this is the third file I want to rename the files, to say, first, second, etc # ls -1 | perl -ne 'print $1,"\n" if

Re: space in variable referencing

2008-01-12 Thread John W. Krahn
ciwei wrote: Question from a newbie: how to properly use space when reference to variables, array, hash etc. please see the code below: why the first line, second, and third line all output differiently. thanks. ciwei code below == #!/usr/bin/perl The next two lines should be

Re: space in variable referencing

2008-01-12 Thread Tom Phoenix
On Jan 11, 2008 3:03 PM, ciwei <[EMAIL PROTECTED]> wrote: > Question from a newbie: how to properly use space > when reference to variables, array, hash etc. Don't put any spaces inside a variable name, especially when interpolating it. > print "first line : $us

space in variable referencing

2008-01-12 Thread ciwei
Question from a newbie: how to properly use space when reference to variables, array, hash etc. please see the code below: why the first line, second, and third line all output differiently. thanks. ciwei code below == #!/usr/bin/perl my %ttys =(); open ( WHO, "who|") o

Re: empty displayed data except "space" and "newline"

2007-11-05 Thread John W . Krahn
On Monday 05 November 2007 11:25, Tom Phoenix wrote: > On 11/5/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED]; > > splice(@k,0,$z); > > If I'm not mistaken, that splice() is the hard way to write this: > > unshift @k, $z; > > > [EMAIL PROTECTED]; > > spli

Re: empty displayed data except "space" and "newline"

2007-11-05 Thread Tom Phoenix
On 11/5/07, Patrik Hasibuan <[EMAIL PROTECTED]> wrote: > I am trying to remove all the space (empty character) in a variable($k_tmp) > in > order to put them in an array, one cell only for one word. You don't need to remove spaces to put words into an array. You sound li

Re: empty displayed data except "space" and "newline"

2007-11-05 Thread John W . Krahn
On Monday 05 November 2007 09:47, Patrik Hasibuan wrote: > Dear my friends... Hello, > I am exhausted by a programming case which may be easy for you all. I > am trying to remove all the space (empty character) in a > variable($k_tmp) in order to put them in an array, one cell on

empty displayed data except "space" and "newline"

2007-11-05 Thread Patrik Hasibuan
Dear my friends... I am exhausted by a programming case which may be easy for you all. I am trying to remove all the space (empty character) in a variable($k_tmp) in order to put them in an array, one cell only for one word. The value of the variable ($k_tmp) is a page of google which I did

Re: White space split

2007-09-20 Thread Rob Dixon
yitzle wrote: --- yitzle <[EMAIL PROTECTED]> wrote: Note: split splits on whitespace by default, so these two are the same: split /\s+/, @array; split @array; Technically, the two /are/ the same, and my point is valid. The fact that I used an array instead of a string was a mistake. I blame

Re: White space split

2007-09-20 Thread yitzle
--- yitzle <[EMAIL PROTECTED]> wrote: > Note: split splits on whitespace by default, so these two are the same: > split /\s+/, @array; > split @array; Technically, the two /are/ the same, and my point is valid. The fact that I used an array instead of a string was a mistake. I blame it on the lack

Re: White space split

2007-09-20 Thread John W. Krahn
[EMAIL PROTECTED] wrote: --- yitzle <[EMAIL PROTECTED]> wrote: Note: split splits on whitespace by default, so these two are the same: split /\s+/, @array; split @array; Not right.You split a string,not an array or a list. all below are wrong: It depends what you mean by "wrong". split @

Re: White space split

2007-09-20 Thread Rob Dixon
yitzle wrote: Note: split splits on whitespace by default, so these two are the same: split /\s+/, @array; split @array; Not true: use strict; use warnings; my @list; for (' A B C ') { @list = split /\s+/, $_; print scalar @list, "\n"; @list = split; print scalar @list, "\n"; } **OUT

Re: RE: White space split

2007-09-20 Thread Chas Owens
On 9/20/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: > Andrew Curry schreef: > > > (split/\s+/,$cmd) > > Very often, (split ' ', $cmd) is the better alternative. snip For the uninitiated: split ' ', $string does what split /\s+/, $string does, but also removes leading whitespace. The following code pri

Re: RE: White space split

2007-09-20 Thread Dr.Ruud
Andrew Curry schreef: > (split/\s+/,$cmd) Very often, (split ' ', $cmd) is the better alternative. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: White space split

2007-09-20 Thread John W. Krahn
yitzle wrote: Note: split splits on whitespace by default, so these two are the same: split /\s+/, @array; split @array; $ perl -le' @array = "a" .. "z"; $_ = "@{[ 10 .. 40 ]}"; print for split /\s+/, @array; ' 26 split /\s+/, @array; Is the same as: split /\s+/, '26', 0; $ perl -le' @ar

Re: RE: White space split

2007-09-20 Thread useperl-jeff
--- yitzle <[EMAIL PROTECTED]> wrote: > Note: split splits on whitespace by default, so these two are the same: > split /\s+/, @array; > split @array; > Not right.You split a string,not an array or a list. all below are wrong: split @array; split (11,22,33); split $string; see `perldoc -f spli

Re: RE: White space split

2007-09-20 Thread yitzle
Note: split splits on whitespace by default, so these two are the same: split /\s+/, @array; split @array; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: RE: White space split

2007-09-20 Thread manojkumarg
Yep...I got it !! .. - Original Message - From: [EMAIL PROTECTED] Date: Thursday, September 20, 2007 5:44 pm Subject: Re: RE: White space split To: [EMAIL PROTECTED], Andrew Curry <[EMAIL PROTECTED]> Cc: beginners@perl.org > --- [EMAIL PROTECTED] wrote: > > >

RE: RE: White space split

2007-09-20 Thread Andrew Curry
Try my $cmd1 = (split/\s+/,$cmd)[0]; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 September 2007 13:04 To: [EMAIL PROTECTED]; Andrew Curry Cc: beginners@perl.org Subject: Re: RE: White space split --- [EMAIL PROTECTED] wrote: > Thanks Andrew

Re: RE: White space split

2007-09-20 Thread useperl-jeff
--- [EMAIL PROTECTED] wrote: > Thanks Andrew and Jeff. > ($cmd1, $rest)=split/\s+/,cmd$; worked for me. > my ($cmd1) = split/\s+/,$cmd; is still giving me the length... > I wanted to use something like above ... you may type something wrong?see the test, $ cat t3.pl my $cmd = "maheshverama

Re: RE: White space split

2007-09-20 Thread manojkumarg
<[EMAIL PROTECTED]> Date: Thursday, September 20, 2007 5:33 pm Subject: RE: White space split To: [EMAIL PROTECTED], beginners@perl.org > Split returns an array > So you need to do something like > > #!/bin/perl > $cmd="maheshverama #XX#&q

RE: White space split

2007-09-20 Thread Andrew Curry
Appologies typo, I know the difference thanks. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 20 September 2007 12:57 To: beginners@perl.org Subject: RE: White space split --- Andrew Curry <[EMAIL PROTECTED]> wrote: > Split returns an array retur

RE: White space split

2007-09-20 Thread useperl-jeff
--- Andrew Curry <[EMAIL PROTECTED]> wrote: > Split returns an array returns a list not array. see `perldoc -q "What is the difference between a list and an array?"` Sick of deleting your inbox? Yahoo

RE: White space split

2007-09-20 Thread Andrew Curry
tember 2007 12:56 To: beginners@perl.org Subject: White space split Hello, I am trying to do this #!/bin/perl $cmd="maheshverama #XX#"; $cmd1=split /\s+/,$cmd; print $cmd1; Wanted the first part to be taken its giving me some numbers as output. Thanks Ma

Re: White space split

2007-09-20 Thread useperl-jeff
--- [EMAIL PROTECTED] wrote: > Hello, > > I am trying to do this > > #!/bin/perl > $cmd="maheshverama #XX#"; > $cmd1=split /\s+/,$cmd; > print $cmd1; > > Wanted the first part to be taken its giving me some numbers as output. > Hello, because split return a lis

White space split

2007-09-20 Thread manojkumarg
Hello, I am trying to do this #!/bin/perl $cmd="maheshverama #XX#"; $cmd1=split /\s+/,$cmd; print $cmd1; Wanted the first part to be taken its giving me some numbers as output. Thanks Manoj -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-m

Re: finding methods and attributes in a name space

2007-08-31 Thread Chas Owens
On 8/31/07, Hunter Barrington <[EMAIL PROTECTED]> wrote: > how would i find out what attributes and methods are in a name space? > for example i have an object in my code and im not sure what type it is, > what attributes are associated with it, what methods etc etc how can i > f

finding methods and attributes in a name space

2007-08-31 Thread Hunter Barrington
how would i find out what attributes and methods are in a name space? for example i have an object in my code and im not sure what type it is, what attributes are associated with it, what methods etc etc how can i find out. in python there was dir() and type() which was a big help. anything

Re: paths with space in

2006-10-17 Thread Beginner
On 17 Oct 2006 at 17:19, Rob Dixon wrote: > Beginner wrote: > > On 17 Oct 2006 at 15:09, Rob Dixon wrote: > >> > >> my @tif = glob("'$d/*tif'"); > > > > I am pretty sure I had tied this, it looks like it from my post. > > > > No. Check the quotes carefully. You had > > my @tif = glob("$d/*tif

Re: paths with space in

2006-10-17 Thread Rob Dixon
Beginner wrote: On 17 Oct 2006 at 15:09, Rob Dixon wrote: my @tif = glob("'$d/*tif'"); I am pretty sure I had tied this, it looks like it from my post. No. Check the quotes carefully. You had my @tif = glob("$d/*tif"); and I wrote my @tif = glob("'$d/*tif'"); so that the string itself

Re: paths with space in

2006-10-17 Thread Beginner
On 17 Oct 2006 at 15:09, Rob Dixon wrote: > Beginner wrote: > > > > On 17 Oct 2006 at 13:16, Perl beginners wrote: > >> > >> Hi All, > >> > >> I am knocking my head against a wall trying to work with directories > >> with spaces. > >> > >> I need to translate some file paths like the one

Re: paths with space in

2006-10-17 Thread Rob Dixon
Beginner wrote: > > On 17 Oct 2006 at 13:16, Perl beginners wrote: >> >> Hi All, >> >> I am knocking my head against a wall trying to work with directories >> with spaces. >> >> I need to translate some file paths like the one below: >> >> /data/scanning/phil/edits/gary/finished/STI 9-10-06/E0102.

Re: paths with space in

2006-10-17 Thread Beginner
On 17 Oct 2006 at 13:16, Perl beginners wrote: > Hi All, > > I am knocking my head against a wall trying to work with directories > with spaces. > > I need to translate some file paths like the one below: > > /data/scanning/phil/edits/gary/finished/STI 9-10-06/E0102.tif > > into > /var/www/p

paths with space in

2006-10-17 Thread Beginner
Hi All, I am knocking my head against a wall trying to work with directories with spaces. I need to translate some file paths like the one below: /data/scanning/phil/edits/gary/finished/STI 9-10-06/E0102.tif into /var/www/phil/pix/E0102.jpg (I need the path to the tif to make the jpeg). If

Re: Space Filling the End of Record

2006-08-14 Thread John W. Krahn
AIL PROTECTED]> > Content-Description: image001.jpg > Content-Location: image001.jpg Please don't send JPEG graphics files to the mailing list and if possible send only plain text instead of quoted-printable or HTML. TIA. > I am new to perl scripting. I have a record that I am

Space Filling the End of Record

2006-08-14 Thread Gloria Hairston
To Whom It May Concern:   I am new to perl scripting.  I have a record that I am writing to a file and the last field in the record is space filled.  How do I fill this record with spaces so that my entire record length is 95 characters?    Sample of record:   format HEADERNINE

RE: Splitting on white space

2006-03-15 Thread John Bruin
Thanks very much - I has completely missed whitespace before the slash. John > -Original Message- > From: Timothy Johnson [mailto:[EMAIL PROTECTED] > Sent: 16 March 2006 14:41 > To: John Bruin; beginners@perl.org > Subject: RE: Splitting on white space > > > I

Re: Splitting on white space

2006-03-15 Thread Tom Phoenix
On 3/15/06, John Bruin <[EMAIL PROTECTED]> wrote: > my $string = 'one two threefour'; > my @temp = split(/ \s{1,}/,$string); Your pattern matches a space followed by one or more whitespace characters (such as tab, space, or newline). There's just a single spa

RE: Splitting on white space

2006-03-15 Thread Timothy Johnson
It isn't splitting on the 'two three' because it doesn't match. / \s{1,}/ matches a space followed by one or more whitespace characters (you have a space in front of your \s) -Original Message- From: John Bruin [mailto:[EMAIL PROTECTED] Sent: Wednesday, March

Splitting on white space

2006-03-15 Thread John Bruin
Hi everyone Can anyone please tell me why the code below is not splitting the 'two three'? If I use '\s*' instead of 's{1,}' it works but I would have thought the code below would have been more precise. my $string = 'one two threefour'; my @temp = split(/ \s{1,}/,$string); my $count_tem

Re: Need to get number of charictors to the first blank (white space) space

2006-03-10 Thread John W. Krahn
Gallagher, Tim (NE) wrote: > Lets say that I have a variable; > > My $test = "asdfjaslfkjasdf lksaflksajfalksjf fsalkjsaflkjsafd fajd > alsjfk"; > > I want a way to count the number of characters to the first space. Is > there an easy function to do th

Re: Need to get number of charictors to the first blank (white space) space

2006-03-10 Thread Tom Phoenix
On 3/10/06, Gallagher, Tim (NE) <[EMAIL PROTECTED]> wrote: > My $test = "asdfjaslfkjasdf lksaflksajfalksjf fsalkjsaflkjsafd fajd > alsjfk"; > I want a way to count the number of characters to the first space. Is > there an easy function to do this??? The easy func

RE: Need to get number of charictors to the first blank (white space) space

2006-03-10 Thread Timothy Johnson
Have you seen the length() function? perldoc -f length If you use a pattern match to grab all of the characters up to the first space, you can check the length of $1. -Original Message- From: Gallagher, Tim (NE) [mailto:[EMAIL PROTECTED] Sent: Friday, March 10, 2006 12:16 PM To

Need to get number of charictors to the first blank (white space) space

2006-03-10 Thread Gallagher, Tim \(NE\)
Lets say that I have a variable; My $test = "asdfjaslfkjasdf lksaflksajfalksjf fsalkjsaflkjsafd fajd alsjfk"; I want a way to count the number of characters to the first space. Is there an easy function to do this??? Thanks Tim

Re: trimming white space in data

2006-03-04 Thread Jeff Pang
> >$string =~ s/^\s+//; # Trim leading white-space >$string =~ s/\s+$//; # Trim trailing white-space > You could get it more shorter as: $string =~ s/^\s+|\s+$//g; :-) -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] Fo

Re: trimming white space in data

2006-03-04 Thread Chris Weller
I use a much shorter regex. I don't have my code in front of me, but if I can remember correctly it is: $string =~ s/^\s+//; # Trim leading white-space $string =~ s/\s+$//; # Trim trailing white-space Hope this helps...just another way of doing it. - Chris

Re: trimming white space in data

2006-03-04 Thread John W. Krahn
David Gilden wrote: > I am trying to trim white space, at the front and end of a string. perldoc -q "How do I strip blank space from the beginning/end of a string" John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: trimming white space in data

2006-03-04 Thread JupiterHost.Net
David Gilden wrote: I am trying to trim white space, at the front and end of a string. The following is not working #!/usr/bin/perl $name = " Dave Gilden"; $name =~ s/^\s*([\w .-]{1,120})\s*$/$1/; print "|$name|"; # This gets the front but not the back!

trimming white space in data

2006-03-04 Thread David Gilden
I am trying to trim white space, at the front and end of a string. The following is not working #!/usr/bin/perl $name = " Dave Gilden"; $name =~ s/^\s*([\w .-]{1,120})\s*$/$1/; print "|$name|"; # This gets the front but not the back! $name = " Dave Gilden

Re: white space between roam and act

2005-10-19 Thread Jeff 'japhy' Pinyan
On Oct 19, K.Moeng said: The problem got solved by if ($msg =~ /roam\s*act/i) this will allow you to get the whole word without space or take it with space. though when you query you have to put the words under " ". Well, yes. Running your program as perl myprog.pl roam act i

Re: white space between roam and act

2005-10-19 Thread K.Moeng
The problem got solved by if ($msg =~ /roam\s*act/i) this will allow you to get the whole word without space or take it with space. though when you query you have to put the words under " ". - Original Message - From: "Jeff 'japhy' Pinyan" <[EMAIL

Re: white space between roam and act

2005-10-19 Thread Jeff 'japhy' Pinyan
On Oct 19, Suvajit Sengupta said: To ignore the white space in between ROAM and ACT use /x modifier of Perl RE to extend your pattern's legibility by permitting whitespace and comments. Hope that will serve your purpose. Instead of if ($msg =~ /roam act/i) Use if ($msg =~ /roam a

Re: white space between roam and act

2005-10-19 Thread JupiterHost.Net
K.Moeng wrote: Hello again, Hello, Please turn of read receipts when posting to a list, thanks. I have rephrased my question from yesterday, And are still not using strict or warnings, shame shame... I want to be able to ignore the white space in between ROAM and ACT By "the

Re: white space between roam and act

2005-10-19 Thread K.Moeng
Hello again folks. It now works- I had to put the characters inside " " during the query. i have used if ($msg =~ /roam\s*act/i) therefore i will run c:\perl\bin->perl activate.pl "roam(space) act" Thanks all for your help especially Beau E. Cox Elie De Brauwer

Re: white space between roam and act

2005-10-19 Thread John W. Krahn
Beau E. Cox wrote: > > Whitespace is \s ( by default ( |\t|\n) ) Actually the \s character class is the same as [ \t\n\r\f]. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: white space between roam and act

2005-10-18 Thread Thomas Bätzler
K.Moeng <[EMAIL PROTECTED]> asked: > I have rephrased my question from yesterday, > > I want to be able to ignore the white space in between ROAM > and ACT that is return the query as ROAM ACT without falling > to the else statement. > > $msg = $ARGV[0]; > >

Re: white space between roam and act

2005-10-18 Thread Suvajit Sengupta
Hi, To ignore the white space in between ROAM and ACT use /x modifier of Perl RE to extend your pattern's legibility by permitting whitespace and comments. Hope that will serve your purpose. Instead of if ($msg =~ /roam act/i) Use if ($msg =~ /roam act/ix) Regards, Suvajit K.

Re: white space between roam and act

2005-10-18 Thread Elie De Brauwer
Elie De Brauwer wrote: K.Moeng wrote: Hello again, I have rephrased my question from yesterday, I want to be able to ignore the white space in between ROAM and ACT that is return the query as ROAM ACT without falling to the else statement. $msg = $ARGV[0]; $msg =~ s/\"/' /ig;

Re: white space between roam and act

2005-10-18 Thread Beau E. Cox
Hi K.Moeng - At 2005-10-18, 20:00:28 you wrote: >Hello again, > >I have rephrased my question from yesterday, > >I want to be able to ignore the white space in between ROAM and ACT >that is return the query as ROAM ACT without falling to the else statement. > >$msg

Re: white space between roam and act

2005-10-18 Thread Elie De Brauwer
K.Moeng wrote: Hello again, I have rephrased my question from yesterday, I want to be able to ignore the white space in between ROAM and ACT that is return the query as ROAM ACT without falling to the else statement. $msg = $ARGV[0]; $msg =~ s/\"/' /ig; $found = 0; if ($msg =~ /

white space between roam and act

2005-10-18 Thread K.Moeng
Hello again, I have rephrased my question from yesterday, I want to be able to ignore the white space in between ROAM and ACT that is return the query as ROAM ACT without falling to the else statement. $msg = $ARGV[0]; $msg =~ s/\"/' /ig; $found = 0; if ($msg =~ /roam act/i

Re: Space problem

2005-10-14 Thread John Doe
1" (without quotes; these are handled by the shell). Apart from that, your program could be formulated much shorter. When I understand right, you want your program accept arguments of the form string "gu", then optionally space(s), then a number between

Re: Space problem

2005-10-14 Thread Marcello
{ $vote = 'gu11'; $found = 1; } if ($found == 1) { $statement = "insert into t_count (time_in, sender, code) values (now(),'$source','$msg')"; #insert into a database $sth= $dbh->prepare("$statement"); $sth->execute; print "Yo

Space problem

2005-10-14 Thread Martha kavishe
= 1) { $statement = "insert into t_count (time_in, sender, code) values (now(),'$source','$msg')"; #insert into a database $sth= $dbh->prepare("$statement"); $sth->execute; print "You entered $vote .\n"; } else { print "Error message or an

Re: Space proplem

2005-10-14 Thread pan
even there (you can see if you print $msg). Then change line #2# to: if($msg =~ /gu ?1/i) Then a single space is allowed, if you would like to allow more whitespace there (any number of tabs or spaces), you could also do if($msg =~ /gu[ \t]*1/i) Maybe you should also extend your code to c

Space proplem

2005-10-14 Thread Martha kavishe
Hi There;   i have this problem of space in my program. The program requires a user to send in Either GU1 or TR1. When they send GU1 or TR1 it accepts it and that is fine. But My concern is; if they send GU 1 or TR 1(Leaving spaces before the number) then the program doesn't accept. It

Re: how to replace multiple whit space with ", ".

2005-09-02 Thread Bernard van de Koppel
Hi, Both solutions work great $omschrijving=~s/ +/, /g; $omschrijving=~s/\s+/, /g; Many thanks, Bernard On Wednesday 31 August 2005 02:18, John W. Krahn wrote: > Bernard van de Koppel wrote: > > Hi, > > Hello, > > > How can I replace multiple white space with ", &

Re: how to replace multiple whit space with ", ".

2005-08-30 Thread Jeff Pan
s/\s+/, /g; On Wed, 31 Aug 2005 01:40:38 +0200, "Bernard van de Koppel" <[EMAIL PROTECTED]> said: > Hi, > > How can I replace multiple white space with ", " (comma space). > > "thisis a space" > > should be changed to >

  1   2   3   4   >