[Chicago-talk] Piping a command into perl?

Jay Strauss me at heyjay.com
Sat Mar 18 14:58:51 PST 2006


On Saturday 18 March 2006 4:55 pm, Andy Lester wrote:
> On Mar 18, 2006, at 4:50 PM, Jay Strauss wrote:
> > How would I pipe a command into perl?
> >
> > for example:
> >
> > $ echo "Hello\n" | perl
> >
> >
> > doesn't work.  But I'd like to do something like that
>
> What would you expect that to do?

I'd like it to print Hello

I know I can do similar with -e, but I'm calling perl from inside a bash 
script, and I have a bash variable with a bunch of perl code in it.

so I'd like to do:

$results=echo $bash_var | perl

Jay


More information about the Chicago-talk mailing list