RE: -e with single quotes

2003-12-11 Thread Thomas Bätzler
Dan Muey [EMAIL PROTECTED] asked:

 I'm tryign to do a perl -e '' command and am wondering if it is 
 possible to do single quotes inside the single quotes.

perl -e print \joe's mama\n\;

perl -e 'print joe.chr(39).s mama;'

HTH,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: -e with single quotes

2003-12-11 Thread Dan Muey


Thanks for all the suggestions everyone!
I'll keep playing around until I get it all ironed out.

Thanks!
Dan

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




-e with single quotes

2003-12-10 Thread Dan Muey
Hello group.

I'm tryign to do a perl -e '' command and am wondering if it is 
possible to do single quotes inside the single quotes.
IE

perl -e 'print joe's mama;'
Obvo=iously won't work
perl -e 'print joe\'s mama;'
And any other versions of \\' all fail.

Is there a way to use a single quote inside a single quoted -e command?
Using a different character would just cause the same problem but with 
different characters right?

TIA

Dan

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: -e with single quotes

2003-12-10 Thread Tom Kinzer
Guessing here but maybe you don't want to use *Perl's* escape, but instead
use your *shell's* escape.

Whatchu running from?

-Tom Kinzer

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 3:05 PM
To: beginners
Subject: -e with single quotes


Hello group.

I'm tryign to do a perl -e '' command and am wondering if it is
possible to do single quotes inside the single quotes.
IE

perl -e 'print joe's mama;'
Obvo=iously won't work
perl -e 'print joe\'s mama;'
And any other versions of \\' all fail.

Is there a way to use a single quote inside a single quoted -e command?
Using a different character would just cause the same problem but with
different characters right?

TIA

Dan

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: -e with single quotes

2003-12-10 Thread Tim Johnson

Hmmm, that's a tough one.  Normally you can still escape a single quote
inside single quotes, but maybe in this case it would be just easier to
do a: 

C:\ perl
print 'joe\'s mama';
^Z

(for windows anyway)

-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 10, 2003 3:05 PM
To: beginners
Subject: -e with single quotes

Hello group.

I'm tryign to do a perl -e '' command and am wondering if it is possible
to do single quotes inside the single quotes.
IE

perl -e 'print joe's mama;'
Obvo=iously won't work
perl -e 'print joe\'s mama;'
And any other versions of \\' all fail.

Is there a way to use a single quote inside a single quoted -e command?
Using a different character would just cause the same problem but with
different characters right?

TIA

Dan

--
To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
http://learn.perl.org/first-response



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: -e with single quotes

2003-12-10 Thread Jenda Krynicky
From: Dan Muey [EMAIL PROTECTED]
 I'm tryign to do a perl -e '' command and am wondering if it is 
 possible to do single quotes inside the single quotes.
 IE
 
 perl -e 'print joe's mama;'
 Obvo=iously won't work
 perl -e 'print joe\'s mama;'
 And any other versions of \\' all fail.
 
 Is there a way to use a single quote inside a single quoted -e
 command? Using a different character would just cause the same problem
 but with different characters right?

WHAT IS YOUR OPERATING SYSTEM AND/OR SHELL ???

This is not really a Perl question ... you need your shell/command 
prompt to do something, not Perl.

If you use Windows and its cmd.exe/command.com you have to use 
doublequotes. Fullstop.

perl -e print qq{joe's mama\n}

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.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: -e with single quotes

2003-12-10 Thread Dan Muey
 Guessing here but maybe you don't want to use *Perl's* 
 escape, but instead use your *shell's* escape.

Oh yeah, duh. I thought \ was my shell's escape character(bash)

 
 Whatchu running from?

Nothing, just want to be able to use single quotes :)

 
 -Tom Kinzer
 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: -e with single quotes

2003-12-10 Thread Jeff Westman
Dan Muey [EMAIL PROTECTED] wrote:

 Hello group.
 
 I'm tryign to do a perl -e '' command and am wondering if it is 
 possible to do single quotes inside the single quotes.
 IE
 
 perl -e 'print joe's mama;'
 Obvo=iously won't work
 perl -e 'print joe\'s mama;'
 And any other versions of \\' all fail.
 
 Is there a way to use a single quote inside a single quoted -e command?
 Using a different character would just cause the same problem but with 
 different characters right?

I've had this problem too, specifically when trying to run perl inside a Korn
shell script.  The following, though, will work for you on Win32 or *nix
systems:

$ perl -e '$q=chr(0x27);print joe${q}s mama'
joe's mama


-Jeff

__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: -e with single quotes

2003-12-10 Thread Dan Muey
 Dan Muey [EMAIL PROTECTED] wrote:
 
  Hello group.
  
  I'm tryign to do a perl -e '' command and am wondering if it is
  possible to do single quotes inside the single quotes.
  IE
  
  perl -e 'print joe's mama;'
  Obvo=iously won't work
  perl -e 'print joe\'s mama;'
  And any other versions of \\' all fail.
  
  Is there a way to use a single quote inside a single quoted -e 
  command? Using a different character would just cause the 
 same problem 
  but with different characters right?
 
 I've had this problem too, specifically when trying to run 
 perl inside a Korn shell script.  The following, though, will 
 work for you on Win32 or *nix
 systems:
 
 $ perl -e '$q=chr(0x27);print joe${q}s mama'
 joe's mama
 

Beautiful Jeff, Beuatifull. I'll give that spin and see how she does.
Thanks again!

 
 -Jeff
 
 __
 Do you Yahoo!?
 New Yahoo! Photos - easier uploading and sharing. 
http://photos.yahoo.com/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: -e with single quotes

2003-12-10 Thread perl-beginners
On Wed, Dec 10, 2003 at 05:05:26PM -0600, Dan Muey wrote:
 perl -e 'print joe's mama;'
 Obvo=iously won't work
 perl -e 'print joe\'s mama;'
 And any other versions of \\' all fail.

As you were told, this is a question of your shell. If you are
using a bourne shell (zsh, bash, ksh, etc...) try this:

  perl -e 'print joe'\''s mama;'
  ^  ^ ^^^
  1  2 345

The trick is:
  1. start single quoted string
  2. end single quoted string
  3. escaped single quote
  4. start single quoted string
  5. end single quoted string

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response