Re: Windoze Woez

2009-12-12 Thread Erez Schatz
2009/12/12 Philip Potter : > 2009/12/12 Shawn H Corey : >> Alan Haggai Alavi wrote: >>> Hi, >>> >>> Windows requires you to use double quotes in place of single quotes. Saving >>> to >>> a file and executing it is the only way that is cross-platform, I suppose. >> >> Doesn't Windows respond to her

Re: Windoze Woez

2009-12-12 Thread Philip Potter
2009/12/12 Shawn H Corey : > Alan Haggai Alavi wrote: >> Hi, >> >> Windows requires you to use double quotes in place of single quotes. Saving >> to >> a file and executing it is the only way that is cross-platform, I suppose. > > Doesn't Windows respond to here redirects? > > perl <> print "Hello

Re: Windoze Woez

2009-12-12 Thread Shawn H Corey
Alan Haggai Alavi wrote: > Hi, > > Windows requires you to use double quotes in place of single quotes. Saving > to > a file and executing it is the only way that is cross-platform, I suppose. Doesn't Windows respond to here redirects? perl < print "Hello world\n"; > EOD -- Just my 0.00

Re: Windoze Woez

2009-12-12 Thread Alan Haggai Alavi
Hi, Windows requires you to use double quotes in place of single quotes. Saving to a file and executing it is the only way that is cross-platform, I suppose. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For addit

Re: Windoze Woez

2009-12-12 Thread Parag Kalra
VOV...I was not knowing this...Thanks There is so much still left to learn in Perl. :) Cheers, Parag On Sat, Dec 12, 2009 at 3:20 AM, John W. Krahn wrote: > Parag Kalra wrote: > >> >> On Sat, Dec 12, 2009 at 1:55 AM, John W. Krahn wrote: >> >> Parag Kalra wrote: >>> >>> This works on L

Re: Windoze Woez

2009-12-12 Thread John W. Krahn
Parag Kalra wrote: On Sat, Dec 12, 2009 at 1:55 AM, John W. Krahn wrote: Parag Kalra wrote: This works on Linux - perl -e 'foreach (Sugar,Sex,Simplicity,Sleep,Success,Smoking) { print "I am only addicted to - 'Shekels' \n" if ($_ =~ /^s.*/i) }' This works on Windoze - perl -e "foreach (Su

Re: Windoze Woez

2009-12-12 Thread Philip Potter
2009/12/12 Parag Kalra : > How is it going to new line without a new line character - '\n'. If I am not > wrong - 'q/ /' signifies quoted context thus - a replacement for double > quotes but still you should need a new line character to go to next line. q// is single quotes, qq// is double quotes.

Re: Windoze Woez

2009-12-12 Thread Parag Kalra
Thanks Philip for the wonderful explanation. And thanks John, your code worked like a breeze both on Windoze & *Nix :) And good thing is it provided the solution to insert a new-line character which was not present in my Windoze code. One question though in following code - >>perl -le "/^s/i &&

Re: Windoze Woez

2009-12-12 Thread Owen
> 2009/12/12 Parag Kalra : > > > In the end though, I fail to see the utility of writing one-liners > which execute on both linux and windows. I may never have been on linux if that had been the case. Back in Perl 4 days, I had W3.1, and read c.l.p.m. All the big guns in those days had one lin

Re: Windoze Woez

2009-12-12 Thread John W. Krahn
Parag Kalra wrote: Hello All, Hello, This works on Linux - perl -e 'foreach (Sugar,Sex,Simplicity,Sleep,Success,Smoking) { print "I am only addicted to - 'Shekels' \n" if ($_ =~ /^s.*/i) }' This works on Windoze - perl -e "foreach (Sugar,Sex,Simplicity,Sleep,Success,Smoking) { print 'I am on

Re: Windoze Woez

2009-12-12 Thread Philip Potter
2009/12/12 Parag Kalra : > Hello All, > > This works on Linux - > perl -e 'foreach (Sugar,Sex,Simplicity,Sleep,Success,Smoking) { print "I am > only addicted to - 'Shekels' \n" if ($_ =~ /^s.*/i) }' > > This works on Windoze - perl -e "foreach (Sugar,Sex,Simplicity,Sleep,Success,Smoking) { print '