[prev in list] [next in list] [prev in thread] [next in thread]
List: groovy-user
Subject: Re: [groovy-user] How to easily read from System.in?
From: "Claus Hausberger" <CHausberger () gmx ! de>
Date: 2008-11-28 10:26:40
Message-ID: 20081128102640.159690 () gmx ! net
[Download RAW message or body]
thanks for all your answers. That's very helpful. I will use this version from now \
on.
Claus
> a bit more Groovy idiomatic:
>
> System.in.withReader {
> print 'input: '
> println it.readLine()
> }
>
> cheers
> Dierk
>
> Am 27.11.2008 um 21:27 schrieb Claus Hausberger:
>
> > Hello
> >
> > I want to port some old Perl scripts to Groovy. In those scripts I
> > have to read a lot from System.in.
> >
> > I got this program working:
> >
> >
> > BufferedReader br = new BufferedReader(new
> > InputStreamReader(System.in))
> > print "input:"
> > String input = br.readLine()
> > println "input was:$input:"
> >
> >
> > It does exactly what I want but I wanted to ask if there is a
> > shorter, more Groovy way to do this.
> >
> >
> > Claus
> > --
> > Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit
> > allen: http://www.gmx.net/de/go/multimessenger
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> > http://xircles.codehaus.org/manage_email
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: \
http://www.gmx.net/de/go/multimessenger
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic