Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Command Line single execution of a line(s) of code
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>
_                                _
| |_   ___    _ __ ___     __ _  | |_   ___     ___
| __| / _ \  | '_ ` _ \   / _` | | __| / _ \   / _ \
| |_ | (_) | | | | | | | | (_| | | |_ | (_) | |  __/
\__| \___/  |_| |_| |_|  \__,_|  \__| \___/   \___|




Report this thread to moderator Post Follow-up to this message
Old Post
Michael De Tomaso
04-15-05 08:58 AM


Re: Command Line single execution of a line(s) of code
Michael 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

Report this thread to moderator Post Follow-up to this message
Old Post
Gunnar Hjalmarsson
04-15-05 08:58 AM


Re: Command Line single execution of a line(s) of code
Try 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>
>    _                                _
>   | |_   ___    _ __ ___     __ _  | |_   ___     ___
>   | __| / _ \  | '_ ` _ \   / _` | | __| / _ \   / _ \
>   | |_ | (_) | | | | | | | | (_| | | |_ | (_) | |  __/
>    \__| \___/  |_| |_| |_|  \__,_|  \__| \___/   \___|
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Michael De Tomaso
04-26-05 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Miscellaneous archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:15 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.