Rob == Rob Dixon rob.di...@gmx.com writes:
Rob I don't have Try::Tiny installed, but will take a look.
I have an addressbar query shortcut of:
http://search.cpan.org/perldoc/#query#
aliased to perldoc, so I can type perldoc Try::Tiny and get the
latest manpage on it directly from the CPAN
Rob == Rob Dixon rob.di...@gmx.com writes:
Rob For me, the bottom line is that try / catch is a funky showpiece that
Rob pushes Perl syntax beyond its limits. No one who sees your code will
Rob thank you for using it, and you should remove it in preference of a
Rob simple check on $@.
Hi,
I was getting this error message for one of my script.
The reason came out out to be, I had not place a semi-colon at the end of
try-catch block.
try {
something
} catch some_exception {
do something
}
After I placed the semi-colon, I am no longer getting this error (Can't use
string
something
}
After I placed the semi-colon, I am no longer getting this error (Can't use
string (1) as a HASH ref while strict refs)
try {
something
} catch some_exception {
do something
};
My questions is I have quite a few scripts that are using the SAME try-catch
block without
no longer getting this error (Can't use
string (1) as a HASH ref while strict refs)
try {
something
} catch some_exception {
do something
};
My questions is I have quite a few scripts that are using the SAME try-catch
block without a semi-colon but those are working seamlessly. They why was I
apps that use FormFu.
Regards,
Shlomi Fish
From: Rajeev Prasad rp.ne...@yahoo.com
To:
Cc: Perl Beginners beginners@perl.org
Sent: Wednesday, September 7, 2011 11:34 AM
Subject: Re: form POST string parser
Uri,
thx. I like that suggestion, i totally missed
On 07/09/2011 01:15, Rajeev Prasad wrote:
which of the two is better? thx.
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg;
or
$value =~ s/%(..)/chr(hex($1))/ge;
in both cases if the input string has \ in it, it is being converted to \\
i read...
chr = function is used
Uri,
thx. I like that suggestion, i totally missed that earlier. I will explore cgi
module.
From: Uri Guttman u...@stemsystems.com
To: Rajeev Prasad rp.ne...@yahoo.com
Cc: Perl Beginners beginners@perl.org
Sent: Tuesday, September 6, 2011 7:24 PM
Subject: Re: form POST string parser
RP
7, 2011 11:34 AM
Subject: Re: form POST string parser
Uri,
thx. I like that suggestion, i totally missed that earlier. I will explore cgi
module.
From: Uri Guttman u...@stemsystems.com
To: Rajeev Prasad rp.ne...@yahoo.com
Cc: Perl Beginners beginners@perl.org
Sent: Tuesday, September 6
hi,
which of the two is better? thx.
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg;
or
$value =~ s/%(..)/chr(hex($1))/ge;
in both cases if the input string has \ in it, it is being converted to \\
i read...
chr = function is used to convert ASCII or Unicode values
RP == Rajeev Prasad rp.ne...@yahoo.com writes:
RP hi,
RP
RP which of the two is better? thx.
RP
RP $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg;
RP
RP or
RP $value =~ s/%(..)/chr(hex($1))/ge;
both are bad because parsing your own http data is a bad thing. it
Hi Rajeev,
On Sun, 4 Sep 2011 08:05:52 -0700 (PDT)
Rajeev Prasad rp.ne...@yahoo.com wrote:
Shlomi Fish,
this is not complete code but part of it, '...' in top and bottom denote
that, strict warning etc is used.
Well, first of all, it would be a good idea to include the complete code. Using
]);
} else {
my $count = $tmpAR[$x-1] =~ tr/,/,/; #try for something more
correct like... =~ m/\,/g); $k = $k + $count;
push(@modline,STRING.$k);
}
This code exhibits a lot of the bad elements I've commented about here:
http://www.nntp.perl.org/group/perl.beginners/2011/09
(@modline,STRING.$k);
}
print @modline;
this replaces fields in quotes with STRING-field number.
That rather complicated code could be replaced with:
my $k = 1;
my @tmpAR = split //, $line;
for ( my $x = 0; $x = $#tmpAR; $x += 2 ) {
$k += $tmpAR[ $x ] =~ tr/,//;
push @modline
.
From: Shlomi Fish shlo...@shlomifish.org
To: Rajeev Prasad rp.ne...@yahoo.com
Cc: Perl Beginners beginners@perl.org
Sent: Sunday, September 4, 2011 1:25 AM
Subject: Re: [solved] parsing and adding back this string
Hi Rajeev,
please acknowledge you have received and read
On 02/09/2011 23:33, Rajeev Prasad wrote:
friends,
I am now trying to parse this string in this way...
x= could be anything including special character
string = xx:ABC,xx,x,x,x,x,x,x,x,x,x,x,x,x
string0=ABC
string2=x,x,x
string3=x,x
string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x
final
rob.di...@gmx.com
To: Perl Beginners beginners@perl.org
Cc: Rajeev Prasad rp.ne...@yahoo.com
Sent: Saturday, September 3, 2011 4:13 AM
Subject: Re: parsing and adding back this string
On 02/09/2011 23:33, Rajeev Prasad wrote:
friends,
I am now trying to parse this string in this way...
x= could
...
...
$k=1;
my $arSZ = @tmpAR=split(//,$line);
for $x (0..$arSZ-1){
if ($x % 2 == 0) {
push(@modline,$tmpAR[$x]);
} else {
my $count = $tmpAR[$x-1] =~ tr/,/,/; #try for something more correct
like... =~ m/\,/g);
$k = $k + $count;
push(@modline,STRING.$k
friends,
I am now trying to parse this string in this way...
x= could be anything including special character
string = xx:ABC,xx,x,x,x,x,x,x,x,x,x,x,x,x
string0=ABC
string2=x,x,x
string3=x,x
string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x
final string is string1
On 02/09/2011 23:33, Rajeev Prasad wrote:
friends,
I am now trying to parse this string in this way...
x= could be anything including special character
string = xx:ABC,xx,x,x,x,x,x,x,x,x,x,x,x,x
string0=ABC
string2=x,x,x
string3=x,x
string1=xx:string0,tt,x,x,x,string2,x,x,x,string3,x
final
On Fri, Sep 2, 2011 at 6:54 PM, Rob Dixon rob.di...@gmx.com wrote:
I'm afraid your post doesn't make very much sense to me, and doesn't
contain a question. Can you give an example showing what you want from
some real data?
Agreed. As you describe, x can be anything, yet your sample is full
of
Hi all,
I have a string like *abcd efgh ijkl mnop* i want to reverse the string
like this *dcba hgfe lkji ponm*
can any one tell me how to get the required output?
thanks in advance..
--
Regards,
Narasimha Madineedi
Hi Narasimha,
On Tue, 30 Aug 2011 15:08:51 +0530
Narasimha Madineedi simha...@gmail.com wrote:
Hi all,
I have a string like *abcd efgh ijkl mnop* i want to reverse the string
like this *dcba hgfe lkji ponm*
can any one tell me how to get the required output?
thanks in advance
On 11-08-30 05:38 AM, Narasimha Madineedi wrote:
Hi all,
I have a string like *abcd efgh ijkl mnop* i want to reverse the string
like this *dcba hgfe lkji ponm*
can any one tell me how to get the required output?
thanks in advance..
perl -e'@words=split/\s+/,$ARGV[0];$_=reverse
On 30/08/2011 10:38, Narasimha Madineedi wrote:
Hi all,
I have a string like *abcd efgh ijkl mnop* i want to reverse the string
like this *dcba hgfe lkji ponm*
can any one tell me how to get the required output?
thanks in advance..
Like this perhaps?
use strict;
use warnings;
my $str
On 30/08/2011 16:02, Shawn H Corey wrote:
On 11-08-30 05:38 AM, Narasimha Madineedi wrote:
Hi all,
I have a string like *abcd efgh ijkl mnop* i want to reverse the
string like this *dcba hgfe lkji ponm*
can any one tell me how to get the required output? thanks in
advance..
perl -e
that Narasimha will easily
wrap his head around the first two.
Regards,
Emeka
On Tue, Aug 30, 2011 at 4:30 PM, Rob Dixon rob.di...@gmx.com wrote:
On 30/08/2011 16:02, Shawn H Corey wrote:
On 11-08-30 05:38 AM, Narasimha Madineedi wrote:
Hi all,
I have a string like *abcd efgh ijkl mnop* i want
On 30/08/2011 17:54, Emeka wrote:
$s =~ s{(\w+)}{scalar reverse($1)}eg; --- From Shlomi Fish
perl -e'@words=split/\s+/,$ARGV[0];$_=reverse$_
for@words;print@words\n;' 'abcd efgh ijkl mnop' Shawn Corey
print join ' ', map scalar reverse($_), split ' ', $str; Rob Dixon
It is time we
elements
# see `perldoc -f split`
my @words = split ' ', $line;
# do each word, one at a time
foreach my $word ( @words ){
# reverse each word w/ Perl's reverse(). See `perldoc -f reverse`
# since this is scalar context, the string is reversed
# since $word
word, one at a time
foreach my $word ( @words ){
# reverse each word w/ Perl's reverse(). See `perldoc -f reverse`
# since this is scalar context, the string is reversed
# since $word is the `for` iteration variable,
# any changes to it are stored back in @words
$word = reverse
Hi Rob,
On Tue, 30 Aug 2011 16:21:34 +0100
Rob Dixon rob.di...@gmx.com wrote:
On 30/08/2011 10:38, Narasimha Madineedi wrote:
Hi all,
I have a string like *abcd efgh ijkl mnop* i want to reverse the string
like this *dcba hgfe lkji ponm*
can any one tell me how to get the required
On 11-08-30 02:50 PM, Shlomi Fish wrote:
2. May not handle different separators than whitespace correctly. For example
if you have words separated by hyphens (e.g: Over-the-top) or different
punctuation or whatever. I'm not sure what should be the exact behaviour here,
but it may not be handled
-Original Message-
From: Matt [mailto:lm7...@gmail.com]
Sent: Tuesday, August 16, 2011 10:04
To: beginners@perl.org
Subject: Sorting a String
I believe you can sort an array like so:
sort @my_array;
I need to sort a string though.
I have $a_string that contains:
4565 line1
2345 line2
Hi,
On Tue, 16 Aug 2011 11:09:35 -0500
Wagner, David --- Sr Programmer Analyst --- CFS david.wag...@fedex.com
wrote:
-Original Message-
From: Matt [mailto:lm7...@gmail.com]
Sent: Tuesday, August 16, 2011 10:04
To: beginners@perl.org
Subject: Sorting a String
I believe you can
Shlomi Fish wrote:
Wagner, David --- Sr Programmer Analyst --- CFSdavid.wag...@fedex.com
wrote:
Since a \n is at end, then could use split like:
for my $dtl ( sort {$a= $b} split(/\n/, $a_string) ) {
One can also do split(/^/m, $a_string) to split into lines while preserving
I believe you can sort an array like so:
sort @my_array;
I need to sort a string though.
I have $a_string that contains:
4565 line1
2345 line2
500 line3
etc.
Obviously \n is at end of every line in the string. I need it sorted.
How would I approach this?
--
To unsubscribe, e-mail
sort like string or like numbers?
On Tue, Aug 16, 2011 at 18:04, Matt lm7...@gmail.com wrote:
I believe you can sort an array like so:
sort @my_array;
I need to sort a string though.
I have $a_string that contains:
4565 line1
2345 line2
500 line3
etc.
Obviously \n is at end of every
On Tue, Aug 16, 2011 at 12:04 PM, Matt lm7...@gmail.com wrote:
I believe you can sort an array like so:
sort @my_array;
I need to sort a string though.
I have $a_string that contains:
4565 line1
2345 line2
500 line3
etc.
Obviously \n is at end of every line in the string. I need
Matt wrote:
I believe you can sort an array like so:
sort @my_array;
That should be:
@my_array = sort @my_array;
I need to sort a string though.
I have $a_string that contains:
4565 line1
2345 line2
500 line3
etc.
Obviously \n is at end of every line in the string. I need it sorted
On 2011-07-28 15:23, Khabza Mkhize wrote:
I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg breathtaking on my string is only bre.
$string = This is an awe-inspiring tour
On 01/08/2011 19:14, Dr.Ruud wrote:
my ($rtioverview) = $string =~ /(.{0,100})\b/;
That would have to be
my ($rtioverview) = $string =~ /(.{0,99})\S\b/;
to avoid terminating at the start of a non-space sequence.
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
the space and just count
words then, the string indicated in the original mail will be 21 not 100!
Maybe like you said it all depends on what Khabza means as word - a single
alphabeth or a collection of alphabeth to make words!
For me, in context of the original mail I think Khabza wants words
checkStr{} you see dat it confirm what you are pointing out. However,
I
think the point there is the number of words the programmers wants!
[Khabza,
correct me if am wrong].
Since, split function as indicated will remove the space and just
count
words then, the string indicated in the original mail
I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg breathtaking on my string is only bre.
$string = This is an awe-inspiring tour to the towering headland
known as Cape Point
On Thu, Jul 28, 2011 at 3:23 PM, Khabza Mkhize khabza@gmail.com wrote:
I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg breathtaking on my string is only bre.
$string
Hi Rob Coops,
I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg breathtaking on my string is only bre.
-- If you count your $string alphabeth by alphabeth from 0 to 100 including
every
Hello Khabza,
I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg breathtaking on my string is only bre.
-- If you count your $string alphabeth by alphabeth from 0 to 100 including
every
On 28/07/2011 14:23, Khabza Mkhize wrote:
I want to substring words, I might be using wrong terminology. But I tried
the following example the only problem I have it cut word any where it
likes. eg breathtaking on my string is only bre.
$string = This is an awe-inspiring tour
Hi Rob,
I wasn't quite sure at first what you meant by passing the file handle
DATA in the while loop when $fh already existed,
so I changed the code slightly like this:
my $file = file.txt;
open(my $fh, , $file) or die $!;
while ($fh) {
Works like a charm, thanks again!
Regards,
Wernher
On 28/06/2011 18:28, Wernher Eksteen wrote:
Rob
use strict;
use warnings;
use Fcntl 'SEEK_SET';
my $format;
my $fh = *DATA; # Replace with the appropriate 'open my $fh, '', ... or die
$!;
I wasn't quite sure at first what you meant by passing the file handle
DATA in the while loop
That's exactly right. I meant that, if you were using an external file,
you only needed to replace the line
my $fh = *DATA;
with
open my $fh, '', 'myfile.txt' or die $!;
which is pretty much what you have done. Unfortunately I made a mistake
and wrote
while (DATA) {
in the first
that.
The program grabs everything in the file that is aligned with the row
of hyphens beneath the captions. It works by finding the first line in
the file that contains only hyphens or spaces, and scanning that to
build an unpack string using the @- and @+ arrays that hold the offsets
On 24/06/2011 08:45, Wernher Eksteen wrote:
Hi,
I've attached a text file containing the original and required
format and avoid the format being lost by just pasting it in the
email body.
The original format is separated by a space, but need to replace the
space with a comma, so it will
or spaces, and scanning that to
build an unpack string using the @- and @+ arrays that hold the offsets
of the start and end of the previous successful regex match.
Unlike my previous solution, empty (all-space) fields are handled
correctly: the 'A' unpack format discards trailing spaces, and my
Hi,
I've attached a text file containing the original and required format and
avoid the format
being lost by just pasting it in the email body.
The original format is separated by a space, but need to replace the space
with a comma,
so it will become a comma delimited csv file which I will then
On 24 June 2011 08:45, Wernher Eksteen wekst...@gmail.com wrote:
Hi,
I've attached a text file containing the original and required format and
avoid the format
being lost by just pasting it in the email body.
The original format is separated by a space, but need to replace the space
with a
Hi,
Thanks for the tip, will try to figure it out on the weekend and come back
if I'm
stuck.
Just a few questions before I try this...
Does these modules have the ability to add the commas in the way I need them
to be?
The CVS_XS.pm module seems more flexible/powerful than the CVS.pm one
or am
On 24 June 2011 09:53, Wernher Eksteen wekst...@gmail.com wrote:
Hi,
Thanks for the tip, will try to figure it out on the weekend and come back
if I'm
stuck.
Just a few questions before I try this...
Does these modules have the ability to add the commas in the way I need them
to be?
At 9:45 AM +0200 6/24/11, Wernher Eksteen wrote:
Hi,
I've attached a text file containing the original and required
format and avoid the format
being lost by just pasting it in the email body.
The original format is separated by a space, but need to replace the
space with a comma,
so it
hi
I got a string like this
$string = ' [a b c d]'
i need to get a b c d in to a array called @all.
i was was trying to so a split with delimiter '\s+' but still i get
[a
b
c
d]
but i want
a
b
c
d
any idea how to get this done , thanks
--
Regards
Agnello D'souza
--
To unsubscribe
On Sat, May 14, 2011 at 3:57 AM, Agnello George
agnello.dso...@gmail.com wrote:
I got a string like this
$string = ' [a b c d]'
i need to get a b c d in to a array called @all.
i was was trying to so a split with delimiter '\s+' but still i get
[a
b
c
d]
but i want
a
b
c
d
On Sat, May 14, 2011 at 1:37 PM, Brandon McCaig bamcc...@gmail.com wrote:
On Sat, May 14, 2011 at 3:57 AM, Agnello George
agnello.dso...@gmail.com wrote:
I got a string like this
$string = ' [a b c d]'
i need to get a b c d in to a array called @all.
i was was trying to so a split
On 14/05/2011 08:57, Agnello George wrote:
I got a string like this
$string = ' [a b c d]'
i need to get a b c d in to a array called @all.
i was was trying to so a split with delimiter '\s+' but still i get
[a
b
c
d]
but i want
a
b
c
d
any idea how to get this done , thanks
Hi there,
Hereby I have a string parsing problem to ask. The sample strings look
like this:
: CC02 0565 8E93 D501 0100 6273 .eb
: 6800 0500 9093 D501 0100 1400 h...
What I am interested is the the 21st and 22nd byte value. In the above
2011/5/4 loudking loudk...@gmail.com:
Hi there,
Hereby I have a string parsing problem to ask. The sample strings look
like this:
: CC02 0565 8E93 D501 0100 6273 .eb
: 6800 0500 9093 D501 0100 1400 h...
What I am interested
Hi there,
Hereby I have a string parsing problem to ask. The sample strings look
like this:
: CC02 0565 8E93 D501 0100 6273 .eb
: 6800 0500 9093 D501 0100 1400 h...
What I am interested is the the 21st and 22nd byte value
On 04/05/2011 13:30, loudking wrote:
Hi there,
Hereby I have a string parsing problem to ask. The sample strings look
like this:
: CC02 0565 8E93 D501 0100 6273 .eb
: 6800 0500 9093 D501 0100 1400 h...
What I am interested
You probably want something like:
substr $x, 10, -10, ... if length $x 25;
Very neat Paul. My hat's off to you.
Worked perfectly too. Thanks Paul.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
M == Matt lm7...@gmail.com writes:
You probably want something like:
substr $x, 10, -10, ... if length $x 25;
Very neat Paul. My hat's off to you.
M Worked perfectly too. Thanks Paul.
the real question is whether you read the docs on substr and understand
how that
I am looking for a perl function or easy way to shorten a long string
if its over X characters.
Say I have:
Doe, John; 56943 Walnut Drive; SomeCity, NY
It messes up the display of my html form. So I would like it changed to:
Doe, John; . meCity, NY
Keep first 10 and last 10 characters
On Tue, Apr 05, 2011 at 04:25:12PM -0500, Matt wrote:
I am looking for a perl function or easy way to shorten a long string
if its over X characters.
Say I have:
Doe, John; 56943 Walnut Drive; SomeCity, NY
It messes up the display of my html form. So I would like it changed to:
Doe
On 05/04/2011 22:56, Paul Johnson wrote:
On Tue, Apr 05, 2011 at 04:25:12PM -0500, Matt wrote:
I am looking for a perl function or easy way to shorten a long string
if its over X characters.
Say I have:
Doe, John; 56943 Walnut Drive; SomeCity, NY
It messes up the display of my html form
Uri Guttman wrote:
BL == Ben Lavery ben.lav...@gmail.com writes:
BL #Here, using a hash looks much cleaner than
iterating through an array
hashes are almost always better for token lookups than scanning
arrays. don't doubt yourself in this area.
Jim Gibson wrote:
On
On 3/9/11 Wed Mar 9, 2011 9:22 AM, Brian F. Yulga
byu...@langly.dyndns.org scribbled:
Uri and Jim have hit upon one of my major stumbling blocks with learning
Perl. There seems to be a difference of opinion on the proper times to
use hashes vs. arrays/lists...and how best to use them. For
Jim Gibson wrote:
On 3/9/11 Wed Mar 9, 2011 9:22 AM, Brian F. Yulga
byu...@langly.dyndns.org scribbled:
foreach ( @word_list ) { if ( /^$temp_word$/i ) { push(
@all_combinations, ( $_ )); } }
That is pretty much what the grep function is doing. It has to
iterate over the entire array
On 9 Mar 2011, at 03:01, Ben Lavery wrote:
I shall change from a hash to an array and use grep, or looking into it I may
use List::MoreUtils as it has a first_value sub which should make it
somewhat more efficient.
OK, so about an hour after I wrote this I was on the train home thinking
there must be a slight trade-off... the processing required to initialize the
hash table with it's keys and values is probably more intensive than defining
an array with its respective values? Unless, internally, Perl stores arrays
as hashes, with the indexes as the keys.
I would have
Ben Lavery wrote:
there must be a slight trade-off... the processing required to
initialize the hash table with it's keys and values is probably
more intensive than defining an array with its respective values?
Unless, internally, Perl stores arrays as hashes, with the indexes
as the keys.
On Wed, Mar 9, 2011 at 2:22 PM, Brian F. Yulga byu...@langly.dyndns.orgwrote:
Uri and Jim have hit upon one of my major stumbling blocks with learning
Perl. There seems to be a difference of opinion on the proper times to use
hashes vs. arrays/lists...and how best to use them.
Thanks for the reading suggestions!
Brian Fraser wrote:
On Wed, Mar 9, 2011 at 2:22 PM, Brian F. Yulga
byu...@langly.dyndns.org mailto:byu...@langly.dyndns.org wrote:
Uri and Jim have hit upon one of my major stumbling blocks with
learning Perl. There seems to be a difference of
Hello,
I got the form value from web client, and I want to validate the value string
include Chinese words only.
How to do this?
Thanks in advance.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On 2011-03-06 17:22, Shlomit Afgin wrote:
I have a data that contain unseen characters that I want to delete.
The unseen characters can be ^L, ^N and other sign that I cannot copy but I
see them in my data.
Is someone know which regular can help me.
See perldoc perlre, specifically
Hi all,
I have a script which takes a string of alphabetic characters as an argument,
generates all combinations of the characters and all permutations of the
combinations, then looks up each result in a list of valid words, if the result
is a valid word it gets stored in an array.
I would
:
Hi all,
I have a script which takes a string of alphabetic characters as an
argument, generates all combinations of the characters and all permutations
of the combinations, then looks up each result in a list of valid words, if
the result is a valid word it gets stored in an array.
I would
Hi Rob,
Thank you for your response, sorry it wasn't as clear as I thought it might
have been.
I have a script, and I want to feed it a special thing to let it know that
any character (A-Z or a-z does upper lower case matter?) is valid, but I
also want to use other characters at the same
BL == Ben Lavery ben.lav...@gmail.com writes:
BL use warnings;
BL use strict;
good!
BL use Math::Combinatorics;
BL #Read list of valid words into hash
BL my $WORDFILE='Words';
BL open(WORDFILE, $WORDFILE) or die can't open $WORDFILE: $!;
BL while (WORDFILE) {
BL chomp;
BL
and end of the string
so that only full words match, and I have used the i modifier for
case-insensitivity. If everything is in the same case, you can dispense with
the /i modifier for a little more efficiency; just lower-case your input
pattern first.
--
To unsubscribe, e-mail: beginners
Hi Jim, thanks for replying :)
$word_list{$_} = 0;
If you assign 1 to the hash value, you can dispense with the 'exists' in
your test, below.
#Here, using a hash looks much cleaner than iterating through an array
push(@all_combinations, $temp_word) if (exists $word_list{$temp_word});
Hi,
I have a data that contain unseen characters that I want to delete.
The unseen characters can be ^L, ^N and other sign that I cannot copy but I
see them in my data.
Is someone know which regular can help me.
Shlomit.
I have a data that contain unseen characters that I want to delete.
The unseen characters can be ^L, ^N and other sign that I cannot copy but I
see them in my data.
Is someone know which regular can help me.
May you try the dos2unix command?
--
To unsubscribe, e-mail:
On 06/03/2011 16:22, Shlomit Afgin wrote:
I have a data that contain unseen characters that I want to delete.
The unseen characters can be ^L, ^N and other sign that I cannot
copy but I see them in my data.
Is someone know which regular can help me.
Hi Shlomit.
It would be better to list
Hi Perl users, Quick question, I have a one long string with tab delimited
values separated by a newline character (in rows)
Here is a snippet of the the string:
chr1ucscexon226488874 226488906 0.00
- . gene_id NM_173083; transcript_id NM_173083;
chr1
2066701 2066786 0.00+ .
gene_id NM_001033581; transcript_id NM_001033581;
~Parag
On Sat, Feb 26, 2011 at 12:06 PM, Richard Green gree...@uw.edu wrote:
Hi Perl users, Quick question, I have a one long string with tab delimited
values separated by a newline character
not able to substitute at the end of each row in the
string.
What is $gene_id? Are you by any chance using '$' at the beginning
of your search pattern instead of the end?
Why are you escaping the quote marks?
Why is there no space after 'gene_id'?
JD
--
To unsubscribe, e-mail: beginners-unsubscr
PK == Parag Kalra paragka...@gmail.com writes:
PK use strict;
PK use warnings;
PK while(DATA){
PK chomp;
why are you chomping here when you add in the \n later?
PK if ($_ =~ /NM_(\d+)/){
PK my $found = $1;
PK $_ =~ s/$found/$found:12345/g;
many issues
On Sat, Feb 26, 2011 at 12:34 PM, Uri Guttman u...@stemsystems.com wrote:
PK == Parag Kalra paragka...@gmail.com writes:
PK use strict;
PK use warnings;
PK while(DATA){
PK chomp;
why are you chomping here when you add in the \n later?
Agreed and corrected in the example at the
--
Uri Guttman -- u...@stemsystems.com http://www.sysarch.com --
- Perl Code Review , Architecture, Development, Training, Support --
- Gourmet Hot Cocoa Mix http://bestfriendscocoa.com -
--
To unsubscribe, e-mail:
PK == Parag Kalra paragka...@gmail.com writes:
why are you doing s/// against $_? by default it does that.
you didn't rectify this one.
PK Sorry. Hope this reply is better and so as the following code:
much better.
PK use strict;
PK use warnings;
PK while(DATA){
PK $_
=~ s/$gene_id\NM_001033581\\; transcript_id
\NM_001033581\\;/\NM_001033581:12346\\; \NM_001033581:12346\\;/g;
I don't know why I am not able to substitute at the end of each row in the
string.
What is $gene_id? Are you by any chance using '$' at the beginning of your
search pattern instead
On Sat, Feb 26, 2011 at 12:56 PM, Uri Guttman u...@stemsystems.com wrote:
PK == Parag Kalra paragka...@gmail.com writes:
why are you doing s/// against $_? by default it does that.
you didn't rectify this one.
Oops. Missed that.
PK Sorry. Hope this reply is better and so as the
201 - 300 of 2693 matches
Mail list logo