> "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
>
>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
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
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
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/(?<=\:)([^:]+):/$
> 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\\/
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
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
> "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
# 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:
> 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
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 *
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
$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
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
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
16 matches
Mail list logo