Re: [Boston.pm] Need to read multiple lines from a socket

2004-05-18 Thread Uri Guttman
> "RN" == Ron Newman <[EMAIL PROTECTED]> writes: >> >> Is there a way to set the line seaprator for sockets only? When I set $/ >> to undef that works only for STDIN. RN> Setting it to undef is not what you want to do. That means "read RN> in the rest of the file at once" -- w

Re: [Boston.pm] Need to read multiple lines from a socket

2004-05-18 Thread Ron Newman
> >Is there a way to set the line seaprator for sockets only? When I set $/ >to undef that works only for STDIN. Setting it to undef is not what you want to do. That means "read in the rest of the file at once" -- which will block forever if you're reading from something that doesn't have an

[Boston.pm] Need to read multiple lines from a socket

2004-05-18 Thread Ranga Nathan
Is there a way to read multiple lines from a socket? This is a blocking socket, with the server running on the mainframe. The server sends multiple lines at one time. Perhaps I can make some changes here but mainframe stuff is always messy to fix. I dont seem to have problems sending multiple l

Re: [Boston.pm] Need a regex :-)

2004-05-18 Thread Greg London
oops, didn't see the part about skipping the first. will have to use a lookbehind. $string =~ s{(?<=:)([^:]+):}{$1\\:}g; Uri Guttman said: >> "GL" == Greg London <[EMAIL PROTECTED]> writes: > > GL> $string =~ s{:}{\\:}g; > > that converts the first : as well as the rest. he wants all but t

Re: [Boston.pm] Need a regex :-)

2004-05-18 Thread Christopher Redinger
Here's what I've come up with for you. I didn't go through the troubling of commenting, I figured I'd let you work through all those colons for fun. This is tested, so it does work. It's certainly not the most efficient solution, but that wasn't part of your spec. :) $string =~ s/(?<=\:)([^:]+):/$

Re: [Boston.pm] Need a regex :-)

2004-05-18 Thread Kripa Sundar
> On Tue, 18 May 2004, Greg London wrote: > > > $string =~ s{:}{\\:}g; > > That prefixes all colons. > > He wants the first one to not have the prefix. > > I think the solution is more complex than this. Not too much more complex. :-) || % echo "a:b:c:d:e" | perl -pe 's/(:[^:]*)(?=:)/$1\\/

Re: [Boston.pm] Need a regex :-)

2004-05-18 Thread Glen Peterson
I don't think this is what you want, and I'm not sure you would want to do what you want if you could do it. Assuming that "OH" will always be the same length, you can use a look-behind regex like: CODE #!/usr/bin/perl -w use strict; my $str = "OH: If I was an Osc:ar Mayer Wiener, tha:t is

Re: [Boston.pm] Need a regex :-)

2004-05-18 Thread Chris Devers
On Tue, 18 May 2004, Greg London wrote: > $string =~ s{:}{\\:}g; That prefixes all colons. He wants the first one to not have the prefix. I think the solution is more complex than this. -- Chris Devers ___ Boston-pm mailing list [EMAIL PROTECTED] h

Re: [Boston.pm] Need a regex :-)

2004-05-18 Thread Uri Guttman
> "GL" == Greg London <[EMAIL PROTECTED]> writes: GL> $string =~ s{:}{\\:}g; that converts the first : as well as the rest. he wants all but the first escaped. >> OH: If I was an Osc:ar Mayer Wiener, tha:t is what I:d Truly like to b:e >> OH: If I was an Osc\:ar Mayer Wiener, tha\:t is

RE: [Boston.pm] Need a regex :-)

2004-05-18 Thread Nick Marden
# Note the lack of 'g' on the second regexp ($str =~ s#:#\\:#g) =~ s#\\:#:#; Technically, this is two passes, but it can be written on one line. Nick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven W. Orr Sent: Tuesday, May 18, 2004 3:56 PM To:

Re: [Boston.pm] Need a regex :-)

2004-05-18 Thread Anthony R. J. Ball
> I have a string with (possibly) multiple colons in it, > > OH: If I was an Osc:ar Mayer Wiener, tha:t is what I:d Truly like to b:e > > I am looking for a single regex to turn all subsequent colons into \: > > So given the above input I'd like to end up with > > OH: If I was an Osc\:ar Mayer Wien

RE: [Boston.pm] Need a regex :-)

2004-05-18 Thread Steven W. Orr
On Tuesday, May 18th 2004 at 11:33 -0400, quoth malia, sean: =>( my $str = "OH: If I was an Osc:ar Mayer Wiener, tha:t is what I:d Truly =>like to b:e" ) =~ s/:/\\:/g; => =>That should do it. => =>Let me know if that's what you wanted. Thank you no. I want all of the colons to be transformed *

Re: [Boston.pm] Need a regex :-)

2004-05-18 Thread Chris Devers
On Tue, 18 May 2004, Steven W. Orr wrote: > I have a string with (possibly) multiple colons in it, > > OH: If I was an Osc:ar Mayer Wiener, tha:t is what I:d Truly like to b:e > > I am looking for a single regex to turn all subsequent colons into \: > > So given the above input I'd like to end up

Re: [Boston.pm] Need a regex :-)

2004-05-18 Thread Greg London
$string =~ s{:}{\\:}g; "Steven W. Orr" wrote: > > I have a string with (possibly) multiple colons in it, > > OH: If I was an Osc:ar Mayer Wiener, tha:t is what I:d Truly like to b:e > > I am looking for a single regex to turn all subsequent colons into \: > > So given the above input I'd like

[Boston.pm] Need a regex :-)

2004-05-18 Thread Steven W. Orr
I have a string with (possibly) multiple colons in it, OH: If I was an Osc:ar Mayer Wiener, tha:t is what I:d Truly like to b:e I am looking for a single regex to turn all subsequent colons into \: So given the above input I'd like to end up with OH: If I was an Osc\:ar Mayer Wiener, tha\:t is

[Boston.pm] modules standard with perl?

2004-05-18 Thread Greg London
Is there a list somewhere of the modules that come standard with the current distribution of perl? I'm specifically trying to find out if "Storable" comes with standard perl. The Storable.pm module DSLIP info lists Development Stage as "Standard, supplied with Perl 5" http://cpan.uwinnipeg.ca/dist