Chas. Owens wrote:
On Sun, Apr 12, 2009 at 21:58, Gunnar Hjalmarsson nore...@gunnar.cc wrote:
Chas. Owens wrote:
my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /;
my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /;
--^
snip
That depends on who you play with.
Ok.
Also, if you
On Mon, Apr 13, 2009 at 06:12, Gunnar Hjalmarsson nore...@gunnar.cc wrote:
snip
Also, if you make that change you need to check the for loop as well:
for my $i (0 .. 10) {
Actually no.
$ perl -wle '
@rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A/;
print map $_.[cdhs], @rank[10..10+4];
'
Use of
Andrew Fithian wrote:
I have a program that needs to find straights in a hand of cards.
Only straights?
The hand is a string with no whitespace sorted by the cards' ranks,
eg 9d10cJhQsKd. How can I identify if that hand contains a straight
with a single regex?
Why on earth would you want
On Sun, Apr 12, 2009 at 18:34, Andrew Fithian afit...@gmail.com wrote:
Hello everyone,
I have a program that needs to find straights in a hand of cards. The hand
is a string with no whitespace sorted by the cards' ranks, eg 9d10cJhQsKd.
How can I identify if that hand contains a straight with
Chas. Owens wrote:
my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /;
my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /;
--^
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands,
On Sun, Apr 12, 2009 at 21:58, Gunnar Hjalmarsson nore...@gunnar.cc wrote:
Chas. Owens wrote:
my @rank = qw/ 2 3 4 5 6 7 8 9 10 J Q K A /;
my @rank = qw/A 2 3 4 5 6 7 8 9 10 J Q K A /;
--^
snip
That depends on who you play with. Also, if you make that change you
need to
Is it the if ($MGMTCMNT =~ /$MGMTNM/) part that is tripping you up? I
believe you could change it to if ($MGMTCMNT =~ /\Q$MGMTNM\E/) if you
need to keep the regular expression. Another idea might be to change it
to
if ( ($start = index($MGMTCMNT, $MGMTNM ()) 0) {
-Original Message-
Paul Nowosielski schreef:
The
script will die if the is a + sign in the fields its parsing.
perldoc -f quotemeta
--
Affijn, Ruud
Gewoon is een tijger.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
should probably escape the + sign with \+
$field =~ s/\+/\\+/g;
On 5/30/06, Paul Nowosielski [EMAIL PROTECTED] wrote:
Dear All,
I have a perl script that runs nightly. It create a data feed. The script will
die if the is a + sign in the fields its parsing.
Here is the snippet:
while
So would this be the correct solution:
while (($PKEY, $MGMTCMNT, $manager_id, $MGMTNM, $UPDATE1, $UPDATE2) =
$sth-fetchrow_array) {
$comment = ;
# added to escape the plus sign
$MGMTCMNT = ~ s/\+/\\+/g;
$MGMTNM = ~ s/\+/\\+/g;
if ($MGMTCMNT =~
Paul Nowosielski wrote:
Dear All,
Hello,
I have a perl script that runs nightly. It create a data feed. The script
will
die if the is a + sign in the fields its parsing.
Here is the snippet:
while (($PKEY, $MGMTCMNT, $manager_id, $MGMTNM, $UPDATE1, $UPDATE2) =
$sth-fetchrow_array)
Kevin Old am Mittwoch, 1. Februar 2006 13.44:
Hello everyone,
I have a large chunk of data that I need to insert into a text or blob
field in mysql. I've tried all the usually escaping it, but nothing
seems to work. I'm even using dbh-quote as I thought it might help.
Here's my code:
my
Hi,
Thanks for the warning.
As far as the specs are, a semicolon is not allowed as data in the datastream
(yet) (of an electronic banking backend application).
Some files however don't use the doublequote combined with the semicolon, but
just the semicolon to identify fields.
So far the
On Tuesday 30 August 2005 04:16 pm, Bernard van de Koppel wrote:
bla bla;bla bla;bla bla
cat test.file | sed 's/\//g' editedfile
--
Eric Walker
EDA/CAD Engineer
Work: 208-368-2573
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Eric Walker wrote:
On Tuesday 30 August 2005 04:16 pm, Bernard van de Koppel wrote:
bla bla;bla bla;bla bla
cat test.file | sed 's/\//g' editedfile
Good solution for sed list and if you like redirtecting from a pipe and
using multiple program when unnecessary (do you also where mits
Eric Walker wrote:
On Tuesday 30 August 2005 04:16 pm, Bernard van de Koppel wrote:
bla bla;bla bla;bla bla
cat test.file | sed 's/\//g' editedfile
Quick someone get the can of UUoC Be Gone ... ;-)
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Eric,
thanks for the response.
After some fideling, I found a solution.
$text=~ tr/\042/ /;
Thanks.
On Tuesday 30 August 2005 22:20, Eric Walker wrote:
On Tuesday 30 August 2005 04:16 pm, Bernard van de Koppel wrote:
bla bla;bla bla;bla bla
cat test.file | sed 's/\//g' editedfile
--
Bernard van de Koppel said:
Hi,
How can I get all the characters out of a csv file.
Input looks like
bla bla;bla bla;bla bla
and it has to look like
bla bla;bla bla; bla bla
I tried $text=~ tr(#\##);
but perl keeps complaining about Might be a runaway multi-line ;;
starting on the
Scott Taylor wrote:
Hi,
How can I get all the characters out of a csv file.
Input looks like
bla bla;bla bla;bla bla
and it has to look like
bla bla;bla bla; bla bla
I tried $text=~ tr(#\##);
but perl keeps complaining about Might be a runaway multi-line ;;
On a more serious note. Simply
Wiggins d'Anconia said:
Scott Taylor wrote:
I did not.
Hi,
How can I get all the characters out of a csv file.
Input looks like
bla bla;bla bla;bla bla
and it has to look like
bla bla;bla bla; bla bla
I tried $text=~ tr(#\##);
but perl keeps complaining about Might be a runaway multi-line
Hi,
Thanks, this works great.
Bernard
On Tuesday 30 August 2005 23:23, Scott Taylor wrote:
Hi,
How can I get all the characters out of a csv file.
Input looks like
bla bla;bla bla;bla bla
and it has to look like
bla bla;bla bla; bla bla
I tried $text=~ tr(#\##);
but perl
Bernard van de Koppel wrote:
Hi,
Hello,
How can I get all the characters out of a csv file.
Input looks like
bla bla;bla bla;bla bla
and it has to look like
bla bla;bla bla; bla bla
I tried $text=~ tr(#\##);
$text =~ tr///d;
John
--
use Perl;
program
fulfillment
--
To
On Jul 31, Octavian Rasnita said:
select ... limit 0,30;
but I cannot use:
$sth = $dbh-prepare(select ... limit ?,?);
$sth-execute(0, 30);
... because DBI replaces the values entered with '0' and '30' and the query
won't be valid.
No, you probably can't do that because your SQL engine
On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote:
I had to add a 'chomp' and make sure the line endings in my file were
correct, but this worked and I learned something useful as well.
Thank you. :-)
--charlie
Only do things in the loop that must be done in the loop. Reconnecting,
Subject: escaping @
I'm sure this is very simple and I am overlooking something. I want to
read a list of bad email addresses from a file and remove them from my
database.
If I print $_, the email addresses are correct, if I try to remove them
from the db I get errors on just the characters
Charles Farinella wrote:
I'm sure this is very simple and I am overlooking something. I want to
read a list of bad email addresses from a file and remove them from my
database.
If I print $_, the email addresses are correct, if I try to remove them
from the db I get errors on just the
On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote:
Charles Farinella wrote:
I'm sure this is very simple and I am overlooking something. I want to
read a list of bad email addresses from a file and remove them from my
database.
If I print $_, the email addresses are correct, if I
Charles Farinella wrote:
On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote:
Charles Farinella wrote:
I'm sure this is very simple and I am overlooking something. I want to
read a list of bad email addresses from a file and remove them from my
database.
If I print $_, the email addresses
Lawrence Statton wrote:
On Mon, 2005-07-18 at 11:53, Wiggins d'Anconia wrote:
Charles Farinella wrote:
I'm sure this is very simple and I am overlooking something. I want to
read a list of bad email addresses from a file and remove them from my
database.
If I print $_, the email addresses
Scott,
You're trying to use an ampersand in your URL. Ampersands are special
characters in URLs so you must escape it if you want it to be passed as
the actual character instead of carrying the special meaning.
See http://www.december.com/html/spec/esccodes.html
On Fri, 2005-06-24 at 12:51
Joshua Colson said:
Scott,
You're trying to use an ampersand in your URL. Ampersands are special
characters in URLs so you must escape it if you want it to be passed as
the actual character instead of carrying the special meaning.
See http://www.december.com/html/spec/esccodes.html
As I
Scott Taylor wrote:
Joshua Colson said:
Scott,
You're trying to use an ampersand in your URL. Ampersands are special
characters in URLs so you must escape it if you want it to be passed as
the actual character instead of carrying the special meaning.
See
print form name=\test\ action=\http://www.somewhere.com\;\n;
printinput type=\text\ name=\frage_text\ size=\100\
value=\$frage_text\ /\n;
print /form\n;
This wasn't really the question, but...
If you have to write html within perl, use qq( ) instead of .
It's a lot easier to read, and
, 2004 11:44 AM
To: 'Jan Eden'; Perl Lists
Subject: RE: Escaping quotes in variable content
Try this:
input type=\text\ name=\frage_text\ size=\100\ value=\$frage_text\
-Original Message-
From: Jan Eden [mailto:[EMAIL PROTECTED]
Sent: 11 May 2004 03:59 PM
To: Perl Lists
Subject
On 11 May 2004, at 14:58, Jan Eden wrote:
how can I escape quotes within a variable's content? I use the
following directive to fill an HTML form:
input type=text name=frage_text size=100 value=$frage_text /
Unfortunately, if $frage_text contains a double quote, the browser
will stop displaying
Hi David,
David Dorward wrote on 11.05.2004:
On 11 May 2004, at 14:58, Jan Eden wrote:
how can I escape quotes within a variable's content? I use the
following directive to fill an HTML form: input type=text
name=frage_text size=100 value=$frage_text / Unfortunately,
if $frage_text contains a
Try this:
input type=\text\ name=\frage_text\ size=\100\ value=\$frage_text\
-Original Message-
From: Jan Eden [mailto:[EMAIL PROTECTED]
Sent: 11 May 2004 03:59 PM
To: Perl Lists
Subject: Escaping quotes in variable content
Hi all,
how can I escape quotes within a variable's
;
printinput type=\text\ name=\frage_text\ size=\100\
value=\$frage_text\ /\n;
print /form\n;
I hope this helps
Regards Ash.
-Original Message-
From: Jan Eden [mailto:[EMAIL PROTECTED]
Sent: 11 May 2004 04:21 PM
To: David Dorward; Perl Lists
Subject: Re: Escaping quotes in variable
the archive, please don't do this. escapeHTML or
HTML::Entities should do very well.
http://danconia.org
-Original Message-
From: Jan Eden [mailto:[EMAIL PROTECTED]
Sent: 11 May 2004 04:21 PM
To: David Dorward; Perl Lists
Subject: Re: Escaping quotes in variable content
Hi
[EMAIL PROTECTED] wrote on 11.05.2004:
print form name=\test\ action=\http://www.somewhere.com\;\n;
printinput type=\text\ name=\frage_text\ size=\100\
value=\$frage_text\ /\n;
print /form\n;
This wasn't really the question, but...
If you have to write html within perl, use qq( )
On Apr 8, 2004, at 4:30 PM, [EMAIL PROTECTED] wrote:
Is there any quick way of parsing a string like:
This,Is,A,String,\,,With,A,Comma
Into a list
(This, Is, A, String, ,, With, A, Comma)
Basically, how can I split it by commas, except when it is escaped.
How about:
my @fields = split
Marcus,
You are going to have to URL escape it. Review URI::Escape...
http://theoryx5.uwinnipeg.ca/CPAN/data/URI/URI/Escape.html
Thanks,
Kristofer
=
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GIT d s+:++ a C++ UL++ US+ P+++ L++
W+++ w PS PE t++ b+ G e r+++ z
--END GEEK CODE
From: Ben Siders [EMAIL PROTECTED]
I've got a real easy one here (in theory). I have some XML files that
were generated by a program, but generated imperfectly. There's some
naked ampersands that need to be converted to amp;. I need a regexp
that will detect them and change them. Sounds
Toby Stuart wrote:
Try this one:
s/(?!\w+;)/amp;/g
Problem is that this will break things like
#64;
Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
--
Jenda Krynicky wrote:
Toby Stuart wrote:
Try this one:
s/(?!\w+;)/amp;/g
Problem is that this will break things like
#64;
Why not just:
s/(?!amp;)/amp;/g
i.e. change every ampersand that isn't followed by 'amp;' into amp;
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
-Original Message-
From: Ben Siders [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 7:38 AM
To: Perl
Subject: Escaping Ampersands in XML
I've got a real easy one here (in theory). I have some XML
files that
were generated by a program, but generated
on Tue, 04 Jun 2002 17:14:54 GMT, Barry Jones wrote:
Hi,
I'm trying to do a patter match for everything contained within
{{ stuff }}. Now I've gotten this to work just fine with ** stuff **,
^^ and a several others, but I can't get curly braces to work and I have
no idea why. I've
-Original Message-
From: Barry Jones [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 1:15 PM
To: Beginners @ Perl (E-mail)
Subject: Escaping characters
Hi,
I'm trying to do a patter match for everything contained within
{{ stuff }}. Now I've gotten this to
Jones; Beginners @ Perl (E-mail)
Subject: RE: Escaping characters
-Original Message-
From: Barry Jones [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 1:15 PM
To: Beginners @ Perl (E-mail)
Subject: Escaping characters
Hi,
I'm trying to do a patter match
I'll gotta stop sending over-caffinated emails...wow, -w works...
Scott Wahlstrom wrote:
Severe newbie that would RTFM if I would have brought it home and i'm not asking the
right monestary search strings so i humbly ask for your help...
i'll go get going on a fresh pot of
easiest i would think is here-doc.
I like:
open (OUTP, hdtst) or die no can open\n;
print OUTP HEHE;
abc def
ghi jkl
HEHE
On Saturday, March 23, 2002, at 08:15 PM, Scott Wahlstrom wrote:
Severe newbie that would RTFM if I would have brought it home and i'm not
asking the right monestary
On Wed, 27 Feb 2002, W P wrote:
I have a CGI script which takes two strings. It searches for the first
string in a file, replacing it with the second one. This file isn't
really important, more for fun, so I'm not too worried about people
deleting the whole file if they actually type out
i don't want to just escape those characters. they were merely examples. i
was hoping maybe there was some built-in way to escape ALL the characters
that mean anything to regular expressions. it just seemed like a lot of
work to put a \ before all the characters that regular expressions
--- W P [EMAIL PROTECTED] wrote:
i don't want to just escape those characters. they were merely examples. i
was hoping maybe there was some built-in way to escape ALL the characters
that mean anything to regular expressions.
Well, technically, *all* characters mean something to a regex. I
Wouldn't single quotes do the trick?
Curtis Poe [EMAIL PROTECTED] wrote: --- W P wrote:
i don't want to just escape those characters. they were merely examples. i
was hoping maybe there was some built-in way to escape ALL the characters
that mean anything to regular expressions.
Well,
Try 'v$session' instead of v$session
The single quote doesn't interpolate variables like the double-quote.
From perldoc perlop
Customary Interpolates
'' no
yes
`` yes
qw{}no
// yes
:-Original Message-
:From:
-Original Message-
From: Stephen Neu [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 25, 2001 12:04 PM
To: Perl Beginners (E-mail)
Subject: RE: escaping v$session
Try 'v$session' instead of v$session
The single quote doesn't interpolate variables like the double-quote
:@active = qx(
:sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID -!
:select count(distinct(process)) ACTIVE from --- v$session ---
:where last_call_et 60 and
:process in (select ltrim(rtrim(to_char(process_id) )) from
:session_list);
:quit
:!
:);
Ok, so you're using qx(foo), which is the same
On 25 Jun 2001 12:15:15 -0400, Yacketta, Ronald wrote:
snip /
this is what I am trying todo
@active = qx(
sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID -!
select count(distinct(process)) ACTIVE from --- v$session ---
where last_call_et 60 and
process in (select
:@active = qx(
:sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID -!
:select count(distinct(process)) ACTIVE from --- v$session ---
:where last_call_et 60 and
:process in (select ltrim(rtrim(to_char(process_id) )) from
:session_list);
:quit
:!
:);
Oh... Didn't see the other variables you were
On 25 Jun 2001 12:57:39 -0400, Yacketta, Ronald wrote:
This one was really close :)
I had to change
select count(distinct(process)) ACTIVE from . 'v$session' .
to
select count(distinct(process)) ACTIVE from . 'v\$session' .
and it worked!
Thanxs everyone!
Ron
What version
On 25 Jun 2001 09:47:08 -0800, Michael Fowler wrote:
On Mon, Jun 25, 2001 at 01:09:51PM -0400, Chas Owens wrote:
On 25 Jun 2001 12:57:39 -0400, Yacketta, Ronald wrote:
select count(distinct(process)) ACTIVE from . 'v$session' .
select count(distinct(process)) ACTIVE from .
On Mon, Jun 25, 2001 at 02:09:59PM -0400, Chas Owens wrote:
@active = qx(
sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID -!
select count(distinct(process)) ACTIVE from v\\\$session
where last_call_et 60 and
process in (select ltrim(rtrim(to_char(process_id) )) from
session_list);
quit
!
On Mon, Jun 25, 2001 at 02:24:21PM -0400, Chas Owens wrote:
Let me see if I have this straight:
Perl was ignoring $session because of the \ and then passing the output
to the shell (stripping the \).
Yes.
The shell saw $session so it tried to replace it with the enviromental
variable
64 matches
Mail list logo