Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Read into stdin pipe characters

by w3ntp (Beadle)
on Oct 05, 2010 at 20:16 UTC ( #863672=note: print w/replies, xml ) Need Help??


in reply to Re: Read into stdin pipe characters
in thread Read into stdin pipe characters

This input string does not contain quotes. Otherwise this would be easy

Replies are listed 'Best First'.
Re^3: Read into stdin pipe characters
by ikegami (Pope) on Oct 05, 2010 at 23:23 UTC

    You seem to be confusing the string and the literal (piece of shell code) that produces the string.

    The string may not have quotes, but the shell string literal that produces the string must use quotes or some alternative. For example, with bash, you could use any of the following shell commands:

    my_prog.pl a b 'c|d|e|f' my_prog.pl a b "c|d|e|f" my_prog.pl a b c\|d\|e\|f

    In all cases, a string of four letters separated by pipes will be passed to Perl by the shell. print $ARGV[2] will result in the following:

    c|d|e|f
Re^3: Read into stdin pipe characters
by ReturnOfThelonious (Beadle) on Oct 05, 2010 at 21:11 UTC
    First, please use <code> tags for your code. It's very, very difficult to read your program.

    Are you sure the error is coming from perl? How are you passing pipe characters on the command line if you're not using quotes?

    Also, please "use strict;" and "use warnings;" before posting:
    <code>

    #!/usr/local/bin/perl use strict; use warnings; my $stuff = $ARGV[2]; print $stuff; exit;

    </code>

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://863672]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2017-10-20 21:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (267 votes). Check out past polls.

    Notices?