Re: escape character in regex

2022-10-10 Thread John W. Krahn
On 2022-10-10 18:12, Henrik Park wrote: I know "/" is a special character for regex, which should be escaped. But if I put "/" in a variable and use the variable in regex, then it doesn't need the explicit escape. Like this one: $ perl -le '$delimiter="/"; $str="hello/world/buddy"; @list=sp

escape character in regex

2022-10-10 Thread Henrik Park
Hello I know "/" is a special character for regex, which should be escaped. But if I put "/" in a variable and use the variable in regex, then it doesn't need the explicit escape. Like this one: $ perl -le '$delimiter="/"; $str="hello/world/buddy"; @list=split/$delimiter/,$str;print "@list"'

Re: How to redefine the default escape character

2009-10-27 Thread mahesh bhasme
Hi Vijay, I don't think that we change default character because it's in perl's inbuild code. Thanks, Mahesh On Wed, Oct 28, 2009 at 9:05 AM, Vijay Gururaja wrote: > Hi, All! > > The default character to escape is backslash (\). Is there any way to > redefine this and set it to any other char

Re: How to redefine the default escape character

2009-10-27 Thread Uri Guttman
> "VG" == Vijay Gururaja writes: VG> Hi, All! VG>The default character to escape is backslash (\). Is there any way VG> to redefine this and set it to any other character? VG>For e.g. if I wanted to use '^' instead of '\'. VG>*print "Hello World ^n";* it can't be done

How to redefine the default escape character

2009-10-27 Thread Vijay Gururaja
Hi, All! The default character to escape is backslash (\). Is there any way to redefine this and set it to any other character? For e.g. if I wanted to use '^' instead of '\'. *print "Hello World ^n";* Thanks, Vijay Gururaja

Re: system ("find...") - escape character help

2008-02-11 Thread Pad
> I'm pretty sure all sane user and admin tools forbid this, > although if you edit /etc/passwd (shadow?) directly, you deserve > your BOFH award. :) Thanks everyone for your input and i used successfully chown/chmod in my routines as provided by John Krahn. Yes, it is username and not the uid!!

Re: system ("find...") - escape character help

2008-02-09 Thread Randal L. Schwartz
> ""John" == "John W Krahn" <[EMAIL PROTECTED]> writes: >>> # If 29334 is the user *name* and not the UID >>> # then do this instead: >>> #return if getpwuid( $uid ) ne '29334'; If you have a strictly numeric username, life will be a real pain. I'm pretty sure all sane user and admin tools f

Re: system ("find...") - escape character help

2008-02-08 Thread John W. Krahn
Pad wrote: On Feb 8, 6:24 am, [EMAIL PROTECTED] (John W. Krahn) wrote: This may work better (UNTESTED): #!/bin/perl use warnings; use strict; use File::Find; my $tagname = 'XYZ'; my $user= getpwnam 'orauser'; my $seq = '01'; find sub { my ( $uid, $gid ) = ( lstat )[ 4, 5 ];

Re: system ("find...") - escape character help

2008-02-08 Thread Tom Phoenix
On Feb 8, 2008 12:52 PM, Pad <[EMAIL PROTECTED]> wrote: > Can you pl.help me how to get chmod cmd that I am trying to set run > on those directories. I was thinking of using system (" find ... - > exec chmod 755 {} \; ") So, does Perl's chmod() function work for you? You should be able to us

Re: system ("find...") - escape character help

2008-02-08 Thread Pad
(please notice '\' just before semi-colon). > > > I used 'echo' statement just to show you what is the problem. In > > reality, I wanted to use find cmd to change the permission say, > > > system( " find /${tagname}_$seq/oradata/$tagname -user

Re: system ("find...") - escape character help

2008-02-08 Thread John W. Krahn
agname -user 29334 -exec chown $user {} \\\; "); Please let me know why the escape character does n't work for me? Any help to resolve the problem is much appreciated. This may work better (UNTESTED): #!/bin/perl use warnings; use strict; use File::Find; my $tagname = 'XYZ&#x

system ("find...") - escape character help

2008-02-08 Thread Pad
user 29334 -exec chown $user {} \\\; "); Please let me know why the escape character does n't work for me? Any help to resolve the problem is much appreciated. Thanks pad -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: escape character

2007-03-22 Thread Beginner
On 21 Mar 2007 at 20:05, Dr.Ruud wrote: > "Beginner" schreef: > > > The Iconv route hasn't been too successful either. I tried > > Text::Iconv->new('ISO8859-1','utf8'); > > Thinking that my data is currently ISO8859-1but the results were not > > as I had hoped. Where I had MICROSCÓPIO, I got MIC

Re: escape character

2007-03-21 Thread Dr.Ruud
"Beginner" schreef: > The Iconv route hasn't been too successful either. I tried > Text::Iconv->new('ISO8859-1','utf8'); > > Thinking that my data is currently ISO8859-1but the results were not > as I had hoped. Where I had MICROSCÓPIO, I got MICROSCÃPIO. I don't think you are showing all charact

Re: escape character

2007-03-21 Thread Tom Phoenix
On 3/21/07, Beginner <[EMAIL PROTECTED]> wrote: s/\xc9/'&#'.$1.';'/ # Hoping for É from É Your pattern didn't include parentheses, so there's no $1. Do you want something like this, maybe? s!([^\x20-\x7e])! '&#' . ord($1) . ';' !ge; Or you could just use HTML::Entities

Re: escape character

2007-03-21 Thread Beginner
On 20 Mar 2007 at 12:55, Chas Owens wrote: > On 3/20/07, Beginner <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a large, 1.3GB xml file that I was trying to validate. It > > turns out that the file has a lot of exotic characters in it such as: > > é > > è > > Ä > > È > > ...etc > > Being a la

Re: escape character

2007-03-20 Thread Chas Owens
On 3/20/07, Beginner <[EMAIL PROTECTED]> wrote: Hi, I have a large, 1.3GB xml file that I was trying to validate. It turns out that the file has a lot of exotic characters in it such as: é è Ä È ...etc The area of encoding and internationalisation is one I have no experience of at all and from

Re: escape character

2007-03-20 Thread yitzle
You can get the hex values from http://ascii-table.com/img/table-apple.gif You can escape them with \xdd where dd is the 0xdd hex value. eg s/[\x80-\xFF]/\?/ On 3/20/07, Beginner <[EMAIL PROTECTED]> wrote: Hi, I have a large, 1.3GB xml file that I was trying to validate. It turns out that the

escape character

2007-03-20 Thread Beginner
Hi, I have a large, 1.3GB xml file that I was trying to validate. It turns out that the file has a lot of exotic characters in it such as: é è Ä È ...etc The area of encoding and internationalisation is one I have no experience of at all and from what I've heard it is rather complex and difficult

RE: perl help : escape character

2006-04-05 Thread Irfan J Sayed
Thanks raymond . it's working now. Regards Irfan Sayed "Raymond Raj" <[EMAIL PROTECTED]> 04/06/2006 11:23 AM Please respond to <[EMAIL PROTECTED]> To Irfan J Sayed/India/[EMAIL PROTECTED], cc Subject RE: perl help : escape character > -Origina

RE: perl help : escape character

2006-04-05 Thread Raymond Raj
> -Original Message- > From: Irfan J Sayed [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 06, 2006 11:29 AM > To: beginners@perl.org > Subject: perl help : escape character > > > Hi All, > > I am running following clearcase command > > my @acti

perl help : escape character

2006-04-05 Thread Irfan J Sayed
. I think this error is something related to escape character . Please let me know how to handle such situation. Regards Irfan Sayed

Re: redefining Net::Telnet "escape" character

2005-02-28 Thread Joe Mecklin
On Mon, 28 Feb 2005 10:05:32 -0500, Wiggins d'Anconia <[EMAIL PROTECTED]> wrote: > Joe Mecklin wrote: > > ok, per the instructions, binmode only converts CR LF to \n, which is > > not what i'm looking for. > > > > Out of curiousity isn't the escap

Re: redefining Net::Telnet "escape" character

2005-02-28 Thread Wiggins d'Anconia
Joe Mecklin wrote: ok, per the instructions, binmode only converts CR LF to \n, which is not what i'm looking for. Out of curiousity isn't the escape character used for client side handling? In this case why would you need to worry about the escape character, as you can drop to a sub

Re: redefining Net::Telnet "escape" character

2005-02-28 Thread Joe Mecklin
{ my ($prematch, $match) = $t->waitfor(String => "login:", Errmode => 'return'); print "$prematch $match\n\n"; print "\nchanging \"escape\" character"; print "\n"; $t->put("^]");

Re: redefining Net::Telnet "escape" character

2005-02-25 Thread Joe Mecklin
CTED]> > Date: Friday, February 25, 2005 8:44 am > Subject: redefining Net::Telnet "escape" character > > > i sent this to the comp.lang.perl.modules newsgroup as the > > documentation suggests and got no response at all, so i thought i'd > > see if

Re: redefining Net::Telnet "escape" character

2005-02-25 Thread mgoland
Joe, Try turning binmod on. If it fails post some code and a bit more od a description of what you are trying to do. hth, Mark G. - Original Message - From: Joe Mecklin <[EMAIL PROTECTED]> Date: Friday, February 25, 2005 8:44 am Subject: redefining Net::Telnet "escape"

redefining Net::Telnet "escape" character

2005-02-25 Thread Joe Mecklin
ified this for sure yet because i had my "epiphany" just as i was leaving work for the day, and i've been forced to take the rest of the week off for personal reasons). question: what is one/the way to redefine the net::telnet escape character from ^] to another ^[ (or anything else?)