Code Comments
Programming Forum and web based access to our favorite programming groups.I installed perl for WIN from ActiveState D:\study\perl>perl -v This is perl, v5.8.6 built for MSWin32-x86-multi-thread (with 3 registered patches, see perl -V for more detail) Copyright 1987-2004, Larry Wall ... And I was going to try to test some code from: http://www.perldoc.com/perl5.8.4/pod/func/split.html Q: let's say I wanted to run a single line of code such as: print join(':', split(/ */, 'hi there')); ... should I be able to run if from the command line like: >perl -e print join(':', split(/ */, 'hi there')); Q: should produce the line: " produces the output 'h:i:t:h:e:r:e'. " right after the command right ??? - thanks & take care M.D. <aka> _ _ | |_ ___ _ __ ___ __ _ | |_ ___ ___ | __| / _ \ | '_ ` _ \ / _` | | __| / _ \ / _ \ | |_ | (_) | | | | | | | | (_| | | |_ | (_) | | __/ \__| \___/ |_| |_| |_| \__,_| \__| \___/ \___|
Post Follow-up to this messageMichael De Tomaso wrote:
> I installed perl for WIN from ActiveState
<snip>
> Q: let's say I wanted to run a single line of code such as:
>
> print join(':', split(/ */, 'hi there'));
>
> ... should I be able to run if from the command line like:
>
Yes, but you are supposed to surround the statement with quotes; in the
case of Windows it must be double-quotes:
perl -e "print join(':', split(/ */, 'hi there'))"
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Post Follow-up to this messageTry putting " quotes " around your statement:
perl -e "print join(':', split(/ */, 'hi there'))";
h:i:t:h:e:r:e
- take care M.D.
http://www.livejournal.com/users/datamd/1860.html
---
EOL - tron
"Michael De Tomaso" <mdetomaso@bak.rr.com> wrote in message
news:VxG7e.56$K25.34@news-wrt-01.socal.rr.com...
>I installed perl for WIN from ActiveState
>
> D:\study\perl>perl -v
>
> This is perl, v5.8.6 built for MSWin32-x86-multi-thread
> (with 3 registered patches, see perl -V for more detail)
>
> Copyright 1987-2004, Larry Wall
>
> ...
>
> And I was going to try to test some code from:
>
> http://www.perldoc.com/perl5.8.4/pod/func/split.html
>
>
>
> Q: let's say I wanted to run a single line of code such as:
>
> print join(':', split(/ */, 'hi there'));
>
> ... should I be able to run if from the command line like:
>
>
>
> Q: should produce the line: " produces the output 'h:i:t:h:e:r:e'. " right
> after the command right ???
>
> - thanks & take care M.D.
>
> <aka>
> _ _
> | |_ ___ _ __ ___ __ _ | |_ ___ ___
> | __| / _ \ | '_ ` _ \ / _` | | __| / _ \ / _ \
> | |_ | (_) | | | | | | | | (_| | | |_ | (_) | | __/
> \__| \___/ |_| |_| |_| \__,_| \__| \___/ \___|
>
>
>
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.